Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ NexusAI β€” Full Stack Agentic AI Platform

A production-ready full stack platform with AI agents, RAG pipeline, real-time streaming, and enterprise-grade infrastructure β€” built from scratch.

FastAPI Next.js TypeScript Python MongoDB Redis Docker LangGraph MIT License


πŸ‘‹ About This Project

I built NexusAI because I wanted a single platform that combines everything I've been learning β€” full stack development with TypeScript and Python, agentic AI with LangGraph, real-time WebSocket communication, RAG pipelines, and production DevOps with Docker and Kubernetes.

Most AI projects I found online were either just a Python script calling an API, or a simple chatbot with no real backend. I wanted to build something that feels like a real production system β€” with proper authentication, background workers, observability, and a clean architecture.

This is that project.


🧠 What It Does

NexusAI is a full stack AI agent platform where users can:

  • Chat with AI agents that can use tools (web search, database queries, file reading)
  • Upload documents and query them using RAG (Retrieval-Augmented Generation)
  • Stream responses in real time via WebSocket β€” no waiting for the full response
  • Manage conversations with full history persistence
  • Monitor everything β€” agent runs, API latency, token usage, errors

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Frontend (Next.js 15)               β”‚
β”‚   React 19 Β· TypeScript Β· Tailwind Β· Zustand    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚  REST + WebSocket
                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Backend (FastAPI)                  β”‚
β”‚                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚           AI Agents (LangGraph)          β”‚   β”‚
β”‚  β”‚  Planner β†’ Tool Use β†’ Critic β†’ Response  β”‚   β”‚
β”‚  β”‚  Tools: search Β· code Β· database Β· files β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚            RAG Pipeline                  β”‚   β”‚
β”‚  β”‚  Ingest β†’ Chunk β†’ Embed β†’ Store β†’ Search β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                 β”‚
β”‚  Auth Β· Rate Limiting Β· Webhooks Β· Admin Panel  β”‚
β”‚  Celery Workers Β· Prometheus Β· Sentry           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚          β”‚          β”‚
         β–Ό          β–Ό          β–Ό
    PostgreSQL    Redis    Vector DB
    MongoDB               (Qdrant/Chroma)

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
Next.js 15 + React 19 UI framework with App Router
TypeScript Type safety across the entire frontend
Tailwind CSS v4 Styling
Zustand State management
WebSocket client Real-time streaming

Backend

Technology Purpose
Python 3.11 + FastAPI High-performance async API
LangGraph + LangChain Multi-agent orchestration
Pydantic v2 Data validation
SQLAlchemy (async) ORM for PostgreSQL
Celery + Redis Background task queue
JWT + OAuth2 Authentication

Databases & Infrastructure

Technology Purpose
PostgreSQL Primary relational database
MongoDB Document storage
Redis Caching, sessions, task queue
Qdrant / ChromaDB Vector database for RAG
Docker + Kubernetes Containerization and orchestration
GitHub Actions CI/CD pipeline
Prometheus + Sentry Monitoring and error tracking

✨ Key Features

πŸ€– Multi-Agent AI System

Built with LangGraph β€” agents follow a Planner β†’ Tool Use β†’ Critic β†’ Synthesizer pipeline. Each agent can call tools autonomously, maintain memory across sessions, and stream tokens back to the frontend in real time.

πŸ“„ RAG Pipeline

Upload PDFs, DOCX, or plain text files. The system parses, chunks, embeds, and stores them in a vector database. Agents automatically search the knowledge base when answering questions.

⚑ Real-time Streaming

WebSocket-based streaming means users see tokens as they're generated β€” not a loading spinner for 10 seconds. Includes tool call visualization so users can see what the agent is doing.

πŸ”’ Production Auth

JWT access tokens + refresh tokens, API key support, and Google OAuth2. HTTP-only cookies on the frontend. Role-based access control.

πŸ“Š Observability

Full tracing via Logfire (for PydanticAI) and LangSmith (for LangChain). Prometheus metrics endpoint. Sentry for error tracking. Every agent run, tool call, and LLM request is traced.

πŸ–₯️ Admin Panel

SQLAdmin panel with authentication β€” manage users, view database records, monitor background tasks via Celery Flower.


πŸš€ Getting Started

Prerequisites

  • Python 3.11+
  • Node.js 18+ (or Bun)
  • Docker + Docker Compose
  • An OpenAI or Anthropic API key

1. Clone the repo

git clone https://github.com/arpitkasaudhan/ai-fullstack-platform.git
cd ai-fullstack-platform

2. Set up environment variables

cp .env.example .env
# Edit .env and add your API keys

3. Start with Docker (easiest)

docker-compose up -d

4. Or run locally

Backend:

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload

Frontend:

cd frontend
bun install
bun dev

5. Access the app

Service URL
Frontend http://localhost:3000
API http://localhost:8000
API Docs http://localhost:8000/docs
Admin Panel http://localhost:8000/admin

πŸ“ Project Structure

ai-fullstack-platform/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # FastAPI app entry point
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   └── routes/v1/       # API endpoints (auth, chat, rag, users)
β”‚   β”‚   β”œβ”€β”€ core/                # Config, security, middleware
β”‚   β”‚   β”œβ”€β”€ db/                  # Database models (SQLAlchemy + MongoDB)
β”‚   β”‚   β”œβ”€β”€ schemas/             # Pydantic request/response schemas
β”‚   β”‚   β”œβ”€β”€ repositories/        # Data access layer
β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   β”œβ”€β”€ agents/              # LangGraph AI agents
β”‚   β”‚   β”œβ”€β”€ rag/                 # RAG pipeline (ingest, embed, search)
β”‚   β”‚   └── worker/              # Celery background tasks
β”‚   β”œβ”€β”€ tests/                   # pytest test suite
β”‚   └── alembic/                 # DB migrations
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/                 # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ hooks/               # useChat, useWebSocket, useAuth
β”‚   β”‚   └── stores/              # Zustand state stores
β”‚   └── e2e/                     # Playwright end-to-end tests
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Makefile
└── README.md

πŸ”Œ API Overview

Method Endpoint Description
POST /api/v1/auth/login Login and get JWT tokens
POST /api/v1/auth/refresh Refresh access token
GET /api/v1/chat/conversations List user conversations
POST /api/v1/chat/message Send message to AI agent
WS /api/v1/chat/ws WebSocket for streaming
POST /api/v1/rag/upload Upload document to knowledge base
GET /api/v1/rag/search Search knowledge base
GET /api/v1/users/me Get current user profile

Full interactive docs available at /docs (Swagger) and /redoc.


πŸ§ͺ Running Tests

# Backend tests
cd backend
pytest tests/ -v

# Frontend tests
cd frontend
bun test

# E2E tests
bun playwright test

🐳 Docker Services

services:
  backend    # FastAPI app
  frontend   # Next.js app
  postgres   # Primary database
  mongodb    # Document store
  redis      # Cache + task queue
  celery     # Background workers
  qdrant     # Vector database
  flower     # Celery monitoring UI
  prometheus # Metrics collection

Start everything: docker-compose up -d


πŸ“ˆ What I Learned Building This

  • LangGraph agent patterns β€” how to properly structure multi-step agents with tool use, memory, and human-in-the-loop checkpoints
  • WebSocket streaming with FastAPI and how to handle backpressure and reconnection on the frontend
  • RAG pipeline design β€” the difference between naive chunking and recursive character splitting, and why reranking matters
  • Async Python β€” SQLAlchemy async sessions, async Celery tasks, and how to avoid common pitfalls
  • Production TypeScript patterns β€” Zustand for state, React Query for server state, and proper error boundaries

🀝 Contributing

Contributions, issues and feature requests are welcome. Feel free to open an issue or submit a PR.


πŸ“„ License

MIT License β€” see LICENSE for details.


Built with ❀️ by Arpit Kasaudhan

GitHub β€’ LinkedIn

About

ai-fullstack-platform

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages