# qiuethan/orbit architecture

> Architecture diagram of the GitHub repository qiuethan/orbit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qiuethan/orbit
- Repository: https://github.com/qiuethan/orbit

## Overview

##### Project type and purpose
- Orbit is a full-stack web application combining a React/Next.js frontend and a Python FastAPI backend.
- Its purpose is real-time facial recognition, audio capture/transcription, AI-driven topic extraction, web-based profile enrichment, and conversation history management.

##### File structure
- Top-level directories:
– backend/: Python services, subdivided into modules (facial_recognition, recording, search, llm, analysis_pipeline, cache, static, etc.) plus server.py and integration logic.
– frontend/: Next.js app with pages (app/api, dashboard, graph, vision), UI components (layout, main, profile, tasks, outreach), context, data adapters, hooks, and utils.
- Backend modules follow a pipeline/micro-kernel style: each concern (face recog, audio, LLM, web search) is encapsulated.
- Config files: backend/env.example, requirements.txt; frontend/package.json, next.config.mjs, eslint.config.mjs.

##### README for additional insights
- Core components and tech stack spelled out: React/Next.js, FastAPI, InsightFace/DeepFace, Groq Whisper, Cerebras LLM, FaceCheck.id, SERPAPI.
- Data flow: camera + microphone → backend pipelines → cache & logs → frontend real-time updates.

##### Summary
- Backend modules, their sequence in the pipeline, and interactions with external AI services and storage.
- Demonstrate real-time vs batch operations (WebSocket events vs end-of-session integration).
- Detail the separation between the React frontend and Python services while showing synchronous and asynchronous communication channels.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User & Browser"]:::frontend
        Frontend["Next.js App"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        APIServer["FastAPI Server"]:::backend
        subgraph "Backend Services"
            direction TB
            FacialRecog["Facial Recognition Service"]:::backend
            AudioRecorder["Audio Recorder"]:::backend
            AudioTranscriber["Audio Transcriber"]:::backend
            AudioSummarizer["Audio Summarizer"]:::backend
            MainPipeline["Analysis Pipeline Orchestrator"]:::backend
            ConvIntegration["Conversation Integration"]:::backend
            ConvTracker["Conversation Tracker"]:::backend
            SearchEngine["Search Engine Service"]:::backend
            LLMInterface["LLM Topic Extraction"]:::backend
        end
    end

    %% Services & Data Layer
    subgraph "Services / Data Layer"
        direction TB
        Cerebras["Cerebras GPT-OSS"]:::external
        Whisper["Groq Whisper"]:::external
        FaceCheck["FaceCheck.id"]:::external
        SERPAPI["SERPAPI"]:::external
        FileCache["File-system Cache"]:::storage
        TempResults["Temporary Results"]:::storage
        RecordedSessions["Recorded Conversations"]:::storage
        StaticPages["Static Test Pages"]:::storage
    end

    %% Connections
    User -->|"uses"| Frontend
    Frontend -->|"HTTP REST / WebSocket"| APIServer
    APIServer -->|"video frames"| FacialRecog
    APIServer -->|"audio stream"| AudioRecorder
    AudioRecorder -->|"raw audio"| AudioTranscriber
    AudioTranscriber -->|"transcript"| AudioSummarizer
    AudioSummarizer -->|"summary"| MainPipeline
    FacialRecog -->|"recognized faces"| MainPipeline
    MainPipeline -->|"integrate data"| ConvIntegration
    ConvIntegration --> ConvTracker
    ConvTracker --> MainPipeline
    MainPipeline -->|"trigger search"| SearchEngine
    MainPipeline -->|"trigger LLM"| LLMInterface

    FacialRecog -->|"cache lookup / store"| FileCache
    AudioSummarizer -->|"store transcripts"| RecordedSessions
    MainPipeline -->|"temp files"| TempResults
    MainPipeline -->|"update pages"| StaticPages

    FacialRecog -->|"face lookup"| FaceCheck
    AudioTranscriber -->|"transcribe via"| Whisper
    LLMInterface -->|"extract topics via"| Cerebras
    SearchEngine -->|"SERP queries"| SERPAPI

    %% Click Events
    click Frontend "https://github.com/qiuethan/orbit/tree/main/frontend/"
    click APIServer "https://github.com/qiuethan/orbit/blob/main/backend/server.py"
    click FacialRecog "https://github.com/qiuethan/orbit/tree/main/backend/facial_recognition/"
    click AudioRecorder "https://github.com/qiuethan/orbit/blob/main/backend/recording/recorder.py"
    click AudioTranscriber "https://github.com/qiuethan/orbit/blob/main/backend/recording/transcriber.py"
    click AudioSummarizer "https://github.com/qiuethan/orbit/blob/main/backend/recording/summarizer.py"
    click MainPipeline "https://github.com/qiuethan/orbit/blob/main/backend/analysis_pipeline/main_pipeline.py"
    click ConvIntegration "https://github.com/qiuethan/orbit/blob/main/backend/conversation_integration.py"
    click ConvTracker "https://github.com/qiuethan/orbit/blob/main/backend/conversation_tracker.py"
    click SearchEngine "https://github.com/qiuethan/orbit/blob/main/backend/search/search_engine.py"
    click LLMInterface "https://github.com/qiuethan/orbit/blob/main/backend/llm/llm.py"
    click FileCache "https://github.com/qiuethan/orbit/tree/main/backend/cache/"
    click TempResults "https://github.com/qiuethan/orbit/tree/main/backend/temp_results/"
    click RecordedSessions "https://github.com/qiuethan/orbit/tree/main/backend/recorded_conversations/"
    click StaticPages "https://github.com/qiuethan/orbit/tree/main/backend/static/"
    click ConvIntegration "https://github.com/qiuethan/orbit/blob/main/backend/conversation_integration.py"
    click PipelineRunner "https://github.com/qiuethan/orbit/blob/main/backend/pipeline.py"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#000
    classDef backend fill:#C8E6C9,stroke:#000
    classDef external fill:#FFE0B2,stroke:#000
    classDef storage fill:#E0E0E0,stroke:#000
```
