# sshh12/prompt-stack architecture

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

- Interactive diagram: https://gitdiagram.com/sshh12/prompt-stack
- Repository: https://github.com/sshh12/prompt-stack

## Overview

No explanation provided

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% User interaction
  UB["User Browser"]:::frontend
  UB --> FE

  %% Frontend Layer
  subgraph "Frontend Layer"
    FE["Next.js Frontend"]:::frontend
    click FE "https://github.com/sshh12/prompt-stack/tree/main/frontend/"
  end

  %% Backend Layer
  subgraph "Backend Layer"
    BE["Python API Server"]:::backend
    click BE "https://github.com/sshh12/prompt-stack/tree/main/backend/"

    CFG["Configuration (config.py)"]:::backend
    click CFG "https://github.com/sshh12/prompt-stack/blob/main/backend/config.py"

    NGINX["Reverse Proxy (nginx.conf)"]:::backend
    click NGINX "https://github.com/sshh12/prompt-stack/blob/main/backend/nginx.conf"

    ROUTERS["HTTP Routers"]:::backend
    click ROUTERS "https://github.com/sshh12/prompt-stack/tree/main/backend/routers/"

    AGENTS["Agents/AI Integration"]:::backend
    click AGENTS "https://github.com/sshh12/prompt-stack/tree/main/backend/agents/"

    TASKS["Tasks Module"]:::backend
    click TASKS "https://github.com/sshh12/prompt-stack/tree/main/backend/tasks/"

    SANDBOX["Sandbox Component"]:::backend
    click SANDBOX "https://github.com/sshh12/prompt-stack/tree/main/backend/sandbox/"

    DB["Database Handling"]:::database
    click DB "https://github.com/sshh12/prompt-stack/tree/main/backend/db/"

    MIGRATIONS["Migrations (Alembic)"]:::database
    click MIGRATIONS "https://github.com/sshh12/prompt-stack/tree/main/backend/alembic/"

    %% Internal backend relationships
    BE --> CFG
    BE --> NGINX
    BE --> ROUTERS
    BE --> AGENTS
    ROUTERS --> DB
    TASKS --- DB
    SANDBOX --- DB
    SANDBOX --> AGENTS
  end

  %% External Integrations
  subgraph "External Integrations"
    EX_AI["External AI Providers (OpenAI, Anthropic)"]:::external
    EX_S3["AWS S3"]:::external
    EX_DEP["Deployment Services"]:::external
    EX_MODAL["Modal Integration"]:::external

    %% External connections from backend
    ROUTERS --> EX_S3
    ROUTERS --> EX_DEP
    ROUTERS --> EX_MODAL
    AGENTS --> EX_AI
  end

  %% Supplementary Tools
  subgraph "Supplementary Tools"
    TOOLS["Supplementary Tooling (scripts)"]:::tools
    click TOOLS "https://github.com/sshh12/prompt-stack/tree/main/scripts/"
  end

  %% Frontend to Backend API communication via HTTP Routers
  FE --> ROUTERS

  %% Legend
  subgraph "Legend"
    LEG1["Solid Arrow: Synchronous Call"]:::legendStyle
    LEG2["Dashed Arrow: Asynchronous Task"]:::legendStyle
    LEG3["Blue: Frontend"]:::legendStyle
    LEG4["Green: Backend"]:::legendStyle
    LEG5["Yellow: Database"]:::legendStyle
    LEG6["Red: External"]:::legendStyle
    LEG7["Light Blue: Tools"]:::legendStyle
  end

  %% Class definitions for colours and styles
  classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
  classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
  classDef database fill:#fff3cd,stroke:#856404,stroke-width:2px;
  classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
  classDef tools fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
  classDef legendStyle fill:#e2e3e5,stroke:#383d41,stroke-width:1px, font-size:10px;
```
