explaingit

ramkumarmn/hub_backend

30PythonAudience · developerComplexity · 4/5Setup · hard

TLDR

Hub Backend is a FastAPI Python server for an app combining AI chat with local LLMs, document search with vector embeddings, user auth, to-do lists, and async document processing.

Mindmap

mindmap
  root((hub_backend))
    Core features
      AI chat via Ollama
      Document RAG search
      Auth and sessions
      To-do list
    Tech stack
      FastAPI Python
      PostgreSQL pgvector
      Redis
      ChromaDB
      RabbitMQ
    Storage
      AWS S3 files
      ChromaDB vectors
      PostgreSQL records
    Architecture
      JWT auth
      Async task queue
      Modular routes
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run AI chat sessions against a locally hosted LLM without sending user data to a third-party API.

USE CASE 2

Upload documents and query their contents using RAG-powered vector search backed by ChromaDB and pgvector.

USE CASE 3

Build a self-hosted productivity backend combining chat, document management, and to-do features with FastAPI.

Tech stack

PythonFastAPIPostgreSQLRedisChromaDBOllamaSQLAlchemy

Getting it running

Difficulty · hard Time to first run · 1h+

Requires PostgreSQL, Redis, RabbitMQ, AWS S3, and Ollama with a pulled model before the server will start.

License not specified in this repository.

In plain English

Hub Backend is the server-side component for an application called Hub. It is built with FastAPI and Python, and handles authentication, AI-powered chat, document management, a to-do list, and admin operations. The AI chat feature uses a locally running language model via Ollama, a tool that lets you run open-source LLMs on your own machine without sending data to a cloud provider. In development the setup uses a smaller model (llama3.2:3b), while the production configuration is tuned for a larger one (llama3.1:70b). For document handling, the backend uses ChromaDB as a vector store, meaning it can index uploaded files and let users search or ask questions about their content using retrieval-augmented generation (RAG). File storage goes to AWS S3. Authentication uses standard JWT tokens with bcrypt for password hashing. Sessions are cached in Redis, which also handles rate limiting. The database is PostgreSQL 16 with the pgvector extension for similarity search. SQLAlchemy handles all database interactions, and Alembic manages schema migrations. Asynchronous tasks, such as document processing, are queued through RabbitMQ using the aio-pika library. The project structure separates models, schemas, routes, services, and background tasks into distinct directories. Routes cover auth, chat, documents, todos, notifications, and admin. Each area follows a consistent pattern so adding new feature areas is straightforward. Getting the stack running locally requires PostgreSQL, Redis, a RabbitMQ broker, an AWS S3 bucket (or compatible storage), and Ollama installed with at least the smaller model pulled. The README documents every environment variable needed via a config module loaded from the environment at startup.

Copy-paste prompts

Prompt 1
How do I set up Hub Backend locally with Ollama, PostgreSQL, Redis, and ChromaDB using the provided environment variables?
Prompt 2
Walk me through how Hub Backend indexes an uploaded document into ChromaDB and then answers a question about it.
Prompt 3
How does Hub Backend handle JWT authentication and where is session state stored in Redis?
Prompt 4
Add a new feature area to Hub Backend following the existing models, schemas, routes, and services pattern.
Open on GitHub → Explain another repo

← ramkumarmn on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.