Dashboard
DocsSelf-HostingArchitecture Overview

Architecture Overview

Opentrace is a full-stack application consisting of four main services, each deployable as a Docker container.

System Architecture

text
┌─────────────────────────────────────────────────────────────┐
│                      Client (Next.js)                       │
│                    docs.opentrace.online                     │
│                                                             │
│   Landing Page  ─  Projects  ─  Knowledge Base  ─  Chat    │
│                         │                                   │
│                    Clerk Auth                                │
└─────────────────────┬───────────────────────────────────────┘
                      │ HTTP/REST
┌─────────────────────▼───────────────────────────────────────┐
│                  Server (FastAPI/Python)                     │
│                                                             │
│   Routes (REST API)  ─  Services  ─  Models                │
│         │                                                   │
│   ┌─────▼──────┐    ┌───────────────┐                      │
│   │  RAG        │    │  Agents       │                      │
│   │  Ingestion  │    │  (LangGraph)  │                      │
│   │  Retrieval  │    │               │                      │
│   └─────┬──────┘    └───────┬───────┘                      │
│         │                   │                               │
└─────────┼───────────────────┼───────────────────────────────┘
          │                   │
  ┌───────▼───────────────────▼───────┐    ┌──────────────┐
  │       Supabase (PostgreSQL)       │    │   AWS S3      │
  │       + pgvector extension        │    │   (file       │
  │                                   │    │   storage)    │
  │  users │ projects │ documents     │    └──────────────┘
  │  document_chunks │ chats │ msgs   │
  └───────────────────────────────────┘

  ┌───────────────┐    ┌──────────────┐
  │  Redis         │    │ Celery       │
  │  (broker)      │◄──►│ Worker       │
  │                │    │ (async tasks)│
  └───────────────┘    └──────────────┘

Service Breakdown

ServiceTechnologyPortPurpose
ClientNext.js 16 + TypeScript3000Frontend UI — landing page, dashboard, chat interface
ServerFastAPI + Python 3.128000REST API — business logic, RAG orchestration, auth verification
Celery WorkerCelery + PythonBackground task processing — document ingestion pipeline
RedisRedis 7 Alpine6379Message broker for Celery task queue

External Services

ServicePurpose
SupabasePostgreSQL database with pgvector for vector storage, full-text search, and RPC functions
AWS S3File storage for uploaded documents (presigned URL upload)
OpenAIGPT-4o for chat, GPT-4o-mini for guardrails, text-embedding-3-large for vectors
ClerkAuthentication and user management (JWT tokens, webhooks)
TavilyWeb search API (optional, for agentic RAG)
ScrapingBeeWeb page crawling for URL ingestion

Data Flow

  1. Upload: Client → presigned URL → S3 → confirm → Celery task → ingestion pipeline → Supabase
  2. Chat: Client → Server → LangGraph Agent → RAG retrieval (Supabase pgvector) → LLM (OpenAI) → streamed response
  3. Auth: Client → Clerk → JWT → Server verifies → process request
Was this page helpful?