← Back to Architecture

Technology Architecture

Technology stack, infrastructure components, and deployment architecture

Complete Technology Stack

Modern, cloud-native technology stack across all layers

graph TB
    subgraph "Frontend Technologies"
        Next[Next.js 15.3.1<br/>React 18.2.0]
        TW[Tailwind CSS<br/>Styling]
        Axios[Axios 1.9.0<br/>HTTP Client]
        Charts[Recharts<br/>Visualizations]
    end

    subgraph "Backend Technologies"
        FA[FastAPI 0.115.6<br/>Web Framework]
        Pyd[Pydantic 2.8.2<br/>Data Validation]
        Uv[Uvicorn 0.34.2<br/>ASGI Server]
        HTTPX[HTTPX 0.28.1<br/>Async HTTP]
    end

    subgraph "AI & LLM Stack"
        Gemini[Gemini 2.5 Flash<br/>Primary LLM]
        OpenAI[OpenAI GPT<br/>Fallback]
        Claude[Anthropic Claude<br/>Alternative]
        LC[LangChain<br/>Orchestration]
    end

    subgraph "Database Layer"
        Turso[Turso LibSQL<br/>Primary DB]
        Redis[Redis 5.0.1<br/>Caching]
        Alembic[Alembic<br/>Migrations]
    end

    subgraph "Cloud Infrastructure - GCP"
        CR[Cloud Run<br/>Containers]
        GCS[Cloud Storage<br/>Objects]
        CB[Cloud Build<br/>CI/CD]
        CL[Cloud Logging<br/>Monitoring]
    end

    subgraph "Security & Auth"
        JWT[PyJWT 2.10.1<br/>Tokens]
        Bcrypt[bcrypt 4.3.0<br/>Hashing]
        Pass[passlib 1.7.4<br/>Passwords]
        Crypt[cryptography<br/>Encryption]
    end

    subgraph "Development & DevOps"
        Docker[Docker<br/>Containers]
        Pytest[Pytest<br/>Testing]
        Git[Git<br/>Version Control]
        GH[GitHub<br/>Repository]
    end

    Next --> FA
    TW --> Next
    Axios --> FA
    Charts --> Next

    FA --> Gemini
    FA --> Pyd
    Uv --> FA
    HTTPX --> FA

    Gemini --> LC
    OpenAI --> LC
    Claude --> LC

    FA --> Turso
    FA --> Redis
    Alembic --> Turso

    FA --> CR
    GCS --> CR
    CB --> CR
    CL --> CR

    JWT --> FA
    Bcrypt --> FA
    Pass --> FA
    Crypt --> FA

    Docker --> CR
    Pytest --> FA
    Git --> GH
    GH --> CB

    style Next fill:#61dafb
    style FA fill:#009688
    style Gemini fill:#4285f4
    style Turso fill:#ff6f00
    style CR fill:#4285f4
    style JWT fill:#d63aff

Technology Details

🐍 Backend Stack

FastAPI0.115.6
Python3.11+
Pydantic2.8.2
Uvicorn0.34.2
HTTPX0.28.1
Async✓ Full Support

⚛️ Frontend Stack

Next.js15.3.1
React18.2.0
TypeScript5.x
Tailwind CSSLatest
Axios1.9.0
SSR✓ Enabled

🧠 AI/LLM Stack

Gemini 2.5 FlashPrimary
Max Tokens6000 output
Temperature0.7
Timeout30-45s
Vision Support✓ Yes
Streaming✓ Yes

🗄️ Database Stack

Turso (LibSQL)Primary
Clientlibsql 0.0.55
ConnectionAsync Pool
Redis Cache5.0.1
MigrationsPython-based
Indexes15+ strategic

Deployment Architecture

Cloud-native deployment on Google Cloud Platform

graph TB
    subgraph "User Layer"
        Users[👥 Global Users]
    end

    subgraph "CDN & Load Balancing"
        CF[Cloud Front<br/>Global CDN]
        LB[Load Balancer<br/>HTTPS/SSL]
    end

    subgraph "Google Cloud Run - Production"
        CR1[Backend API<br/>Container 1]
        CR2[Backend API<br/>Container 2]
        CR3[Backend API<br/>Container N]
    end

    subgraph "Cloud Services"
        GCS[Cloud Storage<br/>Avatars & Files]
        SM[Secret Manager<br/>API Keys]
        CL[Cloud Logging<br/>Monitoring]
        CM[Cloud Monitoring<br/>Metrics]
    end

    subgraph "External Services"
        Turso[(Turso Cloud<br/>Database)]
        Redis[(Redis Cloud<br/>Cache)]
        Gemini[Google Gemini<br/>AI API]
    end

    subgraph "CI/CD Pipeline"
        GH[GitHub<br/>Repository]
        CB[Cloud Build<br/>Automated]
        GCR[Container Registry<br/>Images]
    end

    Users --> CF
    CF --> LB
    LB --> CR1
    LB --> CR2
    LB --> CR3

    CR1 <--> GCS
    CR2 <--> GCS
    CR3 <--> GCS

    CR1 --> SM
    CR2 --> SM
    CR3 --> SM

    CR1 --> CL
    CR2 --> CL
    CR3 --> CL

    CR1 <--> Turso
    CR2 <--> Turso
    CR3 <--> Turso

    CR1 <--> Redis
    CR2 <--> Redis
    CR3 <--> Redis

    CR1 <--> Gemini
    CR2 <--> Gemini
    CR3 <--> Gemini

    GH --> CB
    CB --> GCR
    GCR --> CR1
    GCR --> CR2
    GCR --> CR3

    CL --> CM

    style Users fill:#e3f2fd
    style CF fill:#fff3e0
    style LB fill:#fff3e0
    style CR1 fill:#e8f5e9
    style CR2 fill:#e8f5e9
    style CR3 fill:#e8f5e9
    style GCS fill:#f3e5f5
    style Turso fill:#ffebee
    style Redis fill:#fce4ec
    style Gemini fill:#e1f5fe

Infrastructure Specifications

☁️ Cloud Run

  • Memory: 2GB-4GB
  • CPU: 2 vCPU
  • Timeout: 300s
  • Min Instances: 1
  • Max Instances: 100
  • Concurrency: 80
  • Region: us-central1

🗄️ Database

  • Provider: Turso Cloud
  • Type: LibSQL
  • Location: Multi-region
  • Backup: Automated
  • Replication: Yes
  • Connection Pool: 20
  • WAL Mode: Enabled

⚡ Caching

  • Provider: Redis Cloud
  • Memory: 1GB
  • Persistence: RDB
  • Eviction: LRU
  • Fallback: In-memory
  • Hit Rate: 70-80%
  • Latency: <5ms