# devalous17/ai-finals architecture

> Architecture diagram of the GitHub repository devalous17/ai-finals, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devalous17/ai-finals
- Repository: https://github.com/devalous17/ai-finals

## Overview

AI Software Factory is a prototype for turning a user brief and chosen design direction into a generated website. The workflow runs from the dashboard to the FastAPI build endpoint, which creates a lightweight plan, requests a complete page from Gemini, converts inline assets into editable frontend files, and serves the saved project. The dashboard also loads provider status and design presets and displays build results. Backend, database, testing, and repair stages are explicitly planned, not implemented; Groq is available for future support tasks, not website generation. Wiring reflects the README and sampled source; unsampled details are omitted.

Main entry points: [`backend/main.py`](https://github.com/devalous17/ai-finals/blob/main/backend/main.py) (Build API), [`frontend/src/main.jsx`](https://github.com/devalous17/ai-finals/blob/main/frontend/src/main.jsx) (Build dashboard), [`llm/router.py`](https://github.com/devalous17/ai-finals/blob/main/llm/router.py) (LLM router), [`backend/generator.py`](https://github.com/devalous17/ai-finals/blob/main/backend/generator.py) (Project generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Build dashboard<br/>[main.jsx]"]
end

subgraph group_build["Build workflow"]
  node_build_api["Build API<br/>[main.py]"]
  node_preset_catalog["Design presets<br/>[presets.py]"]
  node_manager["Brief planner<br/>[manager.py]"]
  node_html_extract["HTML validation<br/>[generator.py]"]
end

subgraph group_models["LLM integration"]
  node_llm_router["LLM router<br/>[router.py]"]
  node_provider_types["Provider types<br/>[base.py]"]
  node_gemini["Gemini provider<br/>[providers.py]"]
  node_groq["Groq provider<br/>[providers.py]"]
  node_mock["Mock provider<br/>[mock.py]"]
end

subgraph group_output["Generated website"]
  node_project_generator["Project generator<br/>[generator.py]"]
  node_layout_writer["Frontend file writer<br/>[project_layout.py]"]
  node_projects[("Saved projects")]
  node_static_server["Generated app server<br/>[main.py]"]
end

node_user(("User"))
node_browser(("Generated website"))
node_gemini_service{{"Gemini API"}}
node_groq_service{{"Groq API"}}

node_user -->|"enters brief"| node_dashboard
node_dashboard -->|"submits build"| node_build_api
node_dashboard -->|"requests status"| node_build_api
node_dashboard -->|"loads presets"| node_build_api
node_build_api -->|"reads choices"| node_preset_catalog
node_build_api -->|"plans brief"| node_manager
node_manager -->|"holds router"| node_llm_router
node_build_api -->|"generates HTML"| node_llm_router
node_llm_router -->|"dispatches"| node_gemini
node_llm_router -->|"falls back"| node_mock
node_gemini -->|"requests content"| node_gemini_service
node_groq -.->|"requests content"| node_groq_service
node_llm_router -.->|"routes support"| node_groq
node_build_api -->|"validates response"| node_html_extract
node_build_api -->|"saves valid page"| node_project_generator
node_project_generator -->|"extracts page"| node_html_extract
node_project_generator -->|"writes frontend"| node_layout_writer
node_layout_writer -->|"writes files"| node_projects
node_build_api -->|"mounts projects"| node_static_server
node_dashboard -->|"opens generated app"| node_static_server
node_static_server -->|"serves website"| node_browser
node_build_api -->|"returns build result"| node_dashboard

click node_dashboard "https://github.com/devalous17/ai-finals/blob/main/frontend/src/main.jsx"
click node_build_api "https://github.com/devalous17/ai-finals/blob/main/backend/main.py"
click node_preset_catalog "https://github.com/devalous17/ai-finals/blob/main/backend/presets.py"
click node_manager "https://github.com/devalous17/ai-finals/blob/main/agents/manager.py"
click node_llm_router "https://github.com/devalous17/ai-finals/blob/main/llm/router.py"
click node_provider_types "https://github.com/devalous17/ai-finals/blob/main/llm/base.py"
click node_gemini "https://github.com/devalous17/ai-finals/blob/main/llm/providers.py"
click node_groq "https://github.com/devalous17/ai-finals/blob/main/llm/providers.py"
click node_mock "https://github.com/devalous17/ai-finals/blob/main/llm/mock.py"
click node_html_extract "https://github.com/devalous17/ai-finals/blob/main/backend/generator.py"
click node_project_generator "https://github.com/devalous17/ai-finals/blob/main/backend/generator.py"
click node_layout_writer "https://github.com/devalous17/ai-finals/blob/main/backend/project_layout.py"
click node_static_server "https://github.com/devalous17/ai-finals/blob/main/backend/main.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_dashboard,node_user toneBlue
class node_build_api,node_preset_catalog,node_manager,node_html_extract toneAmber
class node_llm_router,node_provider_types,node_gemini,node_groq,node_mock,node_gemini_service,node_groq_service toneMint
class node_project_generator,node_layout_writer,node_projects,node_static_server toneRose
class node_browser toneIndigo
```

## Components

### Dashboard

- [Build dashboard](https://github.com/devalous17/ai-finals/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### Build workflow

- [Build API](https://github.com/devalous17/ai-finals/blob/main/backend/main.py): `backend/main.py`
- [Design presets](https://github.com/devalous17/ai-finals/blob/main/backend/presets.py): `backend/presets.py`
- [Brief planner](https://github.com/devalous17/ai-finals/blob/main/agents/manager.py): `agents/manager.py`
- [HTML validation](https://github.com/devalous17/ai-finals/blob/main/backend/generator.py): `backend/generator.py`

### LLM integration

- [LLM router](https://github.com/devalous17/ai-finals/blob/main/llm/router.py): `llm/router.py`
- [Provider types](https://github.com/devalous17/ai-finals/blob/main/llm/base.py): `llm/base.py`
- [Gemini provider](https://github.com/devalous17/ai-finals/blob/main/llm/providers.py): `llm/providers.py`
- [Groq provider](https://github.com/devalous17/ai-finals/blob/main/llm/providers.py): `llm/providers.py`
- [Mock provider](https://github.com/devalous17/ai-finals/blob/main/llm/mock.py): `llm/mock.py`

### Generated website

- [Project generator](https://github.com/devalous17/ai-finals/blob/main/backend/generator.py): `backend/generator.py`
- [Frontend file writer](https://github.com/devalous17/ai-finals/blob/main/backend/project_layout.py): `backend/project_layout.py`
- **Saved projects**
- [Generated app server](https://github.com/devalous17/ai-finals/blob/main/backend/main.py): `backend/main.py`

### Other components

- **User**
- **Generated website**
- **Gemini API**
- **Groq API**

## Connections

- User → Build dashboard: enters brief
- Build dashboard → Build API: submits build
- Build dashboard → Build API: requests status
- Build dashboard → Build API: loads presets
- Build API → Design presets: reads choices
- Build API → Brief planner: plans brief
- Brief planner → LLM router: holds router
- Build API → LLM router: generates HTML
- LLM router → Gemini provider: dispatches
- LLM router → Mock provider: falls back
- Gemini provider → Gemini API: requests content
- Groq provider → Groq API: requests content
- LLM router → Groq provider: routes support
- Build API → HTML validation: validates response
- Build API → Project generator: saves valid page
- Project generator → HTML validation: extracts page
- Project generator → Frontend file writer: writes frontend
- Frontend file writer → Saved projects: writes files
- Build API → Generated app server: mounts projects
- Build dashboard → Generated app server: opens generated app
- Generated app server → Generated website: serves website
- Build API → Build dashboard: returns build result
