# muhammad-umer34/forge architecture

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

- Interactive diagram: https://gitdiagram.com/muhammad-umer34/forge
- Repository: https://github.com/muhammad-umer34/forge

## Overview

FORGE is a web application for turning a plain-language website request into a planned, generated, and previewable website. A user works through the frontend studio; the API starts a persistent agent run that clarifies requirements, assembles a site and data plan, generates files, and supports preview and ongoing site-data management. Authentication and project management are supporting capabilities. The supplied README contains no capability detail, so this map relies on the tree and the shown source index/excerpts; several agent-stage connections are therefore marked unverified rather than asserted as inspected calls.

Main entry points: [`backend/main.py`](https://github.com/muhammad-umer34/forge/blob/main/backend/main.py) (HTTP application), [`agents/frontend_generator/compiler.py`](https://github.com/muhammad-umer34/forge/blob/main/agents/frontend_generator/compiler.py) (Site generation), [`agents/planning`](https://github.com/muhammad-umer34/forge/tree/main/agents/planning) (Site and data planning), [`agents/orchestrator/graph.py`](https://github.com/muhammad-umer34/forge/blob/main/agents/orchestrator/graph.py) (Run orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_studio["Forge studio<br/>[ForgeStudio.tsx]"]
  node_request_ui["Request composer"]
  node_plan_ui["Plan review<br/>[PlanReview.tsx]"]
  node_projects_ui["Project workspace<br/>[ProjectsScreen.tsx]"]
  node_frontend_client["Frontend API client<br/>[client.ts]"]
end

subgraph group_api["API and accounts"]
  node_api_app["HTTP application<br/>[main.py]"]
  node_request_api["Build request API<br/>[requests.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_auth_service["Account sessions<br/>[auth.py]"]
end

subgraph group_forge["Forge workflow"]
  node_orchestrator["Run orchestrator<br/>[graph.py]"]
  node_clarification["Requirement clarification"]
  node_planning["Site and data planning"]
  node_catalogue["Component catalogue<br/>[catalogue.py]"]
  node_generation["Site generation<br/>[compiler.py]"]
  node_backend_generation["Data backend generation<br/>[agent.py]"]
  node_integration["Generated integration"]
  node_build_worker["Build worker<br/>[build_worker.py]"]
end

subgraph group_runtime["Generated site runtime"]
  node_preview["Live preview<br/>[preview.py]"]
  node_site_template["Generated site template<br/>[page.tsx]"]
  node_site_data_api["Site data API<br/>[site_data.py]"]
  node_owner_data_api["Owner data API<br/>[owner_data.py]"]
end

subgraph group_persistence["Persistence"]
  node_file_store[("Generated file store<br/>[file_store.py]")]
  node_database[("PostgreSQL persistence<br/>[session.py]")]
  node_state[("Run state<br/>[state.py]")]
end

node_user(("Site owner"))

node_user -->|"describes site"| node_studio
node_studio -.->|"composes request"| node_request_ui
node_request_ui -.->|"submits request"| node_frontend_client
node_frontend_client -.->|"calls API"| node_request_api
node_api_app -->|"registers route"| node_request_api
node_request_api -->|"starts run"| node_orchestrator
node_orchestrator -.->|"clarifies brief"| node_clarification
node_clarification -.->|"forms plan"| node_planning
node_planning -->|"uses features"| node_catalogue
node_planning -.->|"supplies plan"| node_generation
node_generation -->|"requests backend"| node_backend_generation
node_planning -->|"defines data plan"| node_backend_generation
node_generation -->|"writes site files"| node_file_store
node_generation -->|"builds site"| node_build_worker
node_backend_generation -->|"writes generated files"| node_file_store
node_integration -.->|"joins outputs"| node_generation
node_build_worker -->|"prepares preview"| node_preview
node_preview -->|"serves site"| node_site_template
node_api_app -->|"compiles graph"| node_orchestrator
node_api_app -->|"configures store"| node_file_store
node_api_app -->|"stops previews"| node_preview
node_orchestrator -.->|"tracks run"| node_state
node_api_app -->|"opens sessions"| node_database
node_auth_api -->|"delegates accounts"| node_auth_service
node_auth_service -->|"uses session"| node_database
node_api_app -.->|"registers route"| node_auth_api
node_studio -.->|"reviews plan"| node_plan_ui
node_user -.->|"manages projects"| node_projects_ui
node_projects_ui -.->|"requests project data"| node_frontend_client
node_api_app -->|"registers route"| node_site_data_api
node_api_app -->|"registers route"| node_owner_data_api

click node_studio "https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/ForgeStudio.tsx"
click node_request_ui "https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/RequestComposer.tsx"
click node_plan_ui "https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/PlanReview.tsx"
click node_projects_ui "https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/projects/ProjectsScreen.tsx"
click node_frontend_client "https://github.com/muhammad-umer34/forge/blob/main/frontend/src/services/client.ts"
click node_api_app "https://github.com/muhammad-umer34/forge/blob/main/backend/main.py"
click node_request_api "https://github.com/muhammad-umer34/forge/blob/main/backend/routes/requests.py"
click node_auth_api "https://github.com/muhammad-umer34/forge/blob/main/backend/routes/auth.py"
click node_auth_service "https://github.com/muhammad-umer34/forge/blob/main/backend/services/auth.py"
click node_orchestrator "https://github.com/muhammad-umer34/forge/blob/main/agents/orchestrator/graph.py"
click node_clarification "https://github.com/muhammad-umer34/forge/tree/main/agents/clarification"
click node_planning "https://github.com/muhammad-umer34/forge/tree/main/agents/planning"
click node_catalogue "https://github.com/muhammad-umer34/forge/blob/main/agents/catalogue.py"
click node_generation "https://github.com/muhammad-umer34/forge/blob/main/agents/frontend_generator/compiler.py"
click node_backend_generation "https://github.com/muhammad-umer34/forge/blob/main/agents/backend_generator/agent.py"
click node_integration "https://github.com/muhammad-umer34/forge/tree/main/agents/integration"
click node_build_worker "https://github.com/muhammad-umer34/forge/blob/main/agents/build_worker.py"
click node_preview "https://github.com/muhammad-umer34/forge/blob/main/agents/preview.py"
click node_site_template "https://github.com/muhammad-umer34/forge/blob/main/site_template/app/page.tsx"
click node_site_data_api "https://github.com/muhammad-umer34/forge/blob/main/backend/routes/site_data.py"
click node_owner_data_api "https://github.com/muhammad-umer34/forge/blob/main/backend/routes/owner_data.py"
click node_file_store "https://github.com/muhammad-umer34/forge/blob/main/agents/file_store.py"
click node_database "https://github.com/muhammad-umer34/forge/blob/main/backend/db/session.py"
click node_state "https://github.com/muhammad-umer34/forge/blob/main/agents/state.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_studio,node_request_ui,node_plan_ui,node_projects_ui,node_frontend_client toneBlue
class node_api_app,node_request_api,node_auth_api,node_auth_service toneAmber
class node_orchestrator,node_clarification,node_planning,node_catalogue,node_generation,node_backend_generation,node_integration,node_build_worker toneMint
class node_preview,node_site_template,node_site_data_api,node_owner_data_api toneRose
class node_file_store,node_database,node_state,node_user toneIndigo
```

## Components

### User experience

- [Forge studio](https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/ForgeStudio.tsx): `frontend/src/components/clarification/ForgeStudio.tsx`
- [Request composer](https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/RequestComposer.tsx): `frontend/src/components/clarification/RequestComposer.tsx`
- [Plan review](https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/clarification/PlanReview.tsx): `frontend/src/components/clarification/PlanReview.tsx`
- [Project workspace](https://github.com/muhammad-umer34/forge/blob/main/frontend/src/components/projects/ProjectsScreen.tsx): `frontend/src/components/projects/ProjectsScreen.tsx`
- [Frontend API client](https://github.com/muhammad-umer34/forge/blob/main/frontend/src/services/client.ts): `frontend/src/services/client.ts`

### API and accounts

- [HTTP application](https://github.com/muhammad-umer34/forge/blob/main/backend/main.py): `backend/main.py`
- [Build request API](https://github.com/muhammad-umer34/forge/blob/main/backend/routes/requests.py): `backend/routes/requests.py`
- [Authentication API](https://github.com/muhammad-umer34/forge/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Account sessions](https://github.com/muhammad-umer34/forge/blob/main/backend/services/auth.py): `backend/services/auth.py`

### Forge workflow

- [Run orchestrator](https://github.com/muhammad-umer34/forge/blob/main/agents/orchestrator/graph.py): `agents/orchestrator/graph.py`
- [Requirement clarification](https://github.com/muhammad-umer34/forge/tree/main/agents/clarification): `agents/clarification`
- [Site and data planning](https://github.com/muhammad-umer34/forge/tree/main/agents/planning): `agents/planning`
- [Component catalogue](https://github.com/muhammad-umer34/forge/blob/main/agents/catalogue.py): `agents/catalogue.py`
- [Site generation](https://github.com/muhammad-umer34/forge/blob/main/agents/frontend_generator/compiler.py): `agents/frontend_generator/compiler.py`
- [Data backend generation](https://github.com/muhammad-umer34/forge/blob/main/agents/backend_generator/agent.py): `agents/backend_generator/agent.py`
- [Generated integration](https://github.com/muhammad-umer34/forge/tree/main/agents/integration): `agents/integration`
- [Build worker](https://github.com/muhammad-umer34/forge/blob/main/agents/build_worker.py): `agents/build_worker.py`

### Generated site runtime

- [Live preview](https://github.com/muhammad-umer34/forge/blob/main/agents/preview.py): `agents/preview.py`
- [Generated site template](https://github.com/muhammad-umer34/forge/blob/main/site_template/app/page.tsx): `site_template/app/page.tsx`
- [Site data API](https://github.com/muhammad-umer34/forge/blob/main/backend/routes/site_data.py): `backend/routes/site_data.py`
- [Owner data API](https://github.com/muhammad-umer34/forge/blob/main/backend/routes/owner_data.py): `backend/routes/owner_data.py`

### Persistence

- [Generated file store](https://github.com/muhammad-umer34/forge/blob/main/agents/file_store.py): `agents/file_store.py`
- [PostgreSQL persistence](https://github.com/muhammad-umer34/forge/blob/main/backend/db/session.py): `backend/db/session.py`
- [Run state](https://github.com/muhammad-umer34/forge/blob/main/agents/state.py): `agents/state.py`

### Other components

- **Site owner**

## Connections

- Site owner → Forge studio: describes site
- Forge studio → Request composer: composes request
- Request composer → Frontend API client: submits request
- Frontend API client → Build request API: calls API
- HTTP application → Build request API: registers route (evidence: `backend/main.py`)
- Build request API → Run orchestrator: starts run (evidence: `backend/routes/requests.py`)
- Run orchestrator → Requirement clarification: clarifies brief
- Requirement clarification → Site and data planning: forms plan
- Site and data planning → Component catalogue: uses features (evidence: `agents/planning/assemble.py`)
- Site and data planning → Site generation: supplies plan (evidence: `agents/frontend_generator/compiler.py`)
- Site generation → Data backend generation: requests backend (evidence: `agents/frontend_generator/compiler.py`)
- Site and data planning → Data backend generation: defines data plan (evidence: `agents/backend_generator/agent.py`)
- Site generation → Generated file store: writes site files (evidence: `agents/frontend_generator/compiler.py`)
- Site generation → Build worker: builds site (evidence: `agents/frontend_generator/compiler.py`)
- Data backend generation → Generated file store: writes generated files (evidence: `agents/backend_generator/agent.py`)
- Generated integration → Site generation: joins outputs
- Build worker → Live preview: prepares preview (evidence: `agents/preview.py`)
- Live preview → Generated site template: serves site (evidence: `agents/preview.py`)
- HTTP application → Run orchestrator: compiles graph (evidence: `backend/main.py`)
- HTTP application → Generated file store: configures store (evidence: `backend/main.py`)
- HTTP application → Live preview: stops previews (evidence: `backend/main.py`)
- Run orchestrator → Run state: tracks run
- HTTP application → PostgreSQL persistence: opens sessions (evidence: `backend/main.py`)
- Authentication API → Account sessions: delegates accounts (evidence: `backend/routes/auth.py`)
- Account sessions → PostgreSQL persistence: uses session (evidence: `backend/services/auth.py`)
- HTTP application → Authentication API: registers route
- Forge studio → Plan review: reviews plan
- Site owner → Project workspace: manages projects
- Project workspace → Frontend API client: requests project data
- HTTP application → Site data API: registers route (evidence: `backend/main.py`)
- HTTP application → Owner data API: registers route (evidence: `backend/main.py`)
