# eldasoky1/mvp_plan architecture

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

- Interactive diagram: https://gitdiagram.com/eldasoky1/mvp_plan
- Repository: https://github.com/eldasoky1/mvp_plan

## Overview

The repository describes an EU AI Act compliance co-pilot: a user submits an AI project and deployment context, receives a risk classification, and can retrieve its saved assessment report. The main workflow is visible in the FastAPI routes and AI service; persistence uses SQLAlchemy models and PostgreSQL. The README also documents a React UI and a seeded compliance-rule catalog, though their runtime wiring is not fully shown in the excerpts. The graph keeps those capabilities distinct and marks unverified links accordingly.

Main entry points: [`backend/main.py`](https://github.com/eldasoky1/mvp_plan/blob/main/backend/main.py) (Assessment and reports), [`backend/ai_service.py`](https://github.com/eldasoky1/mvp_plan/blob/main/backend/ai_service.py) (Inference wrapper), [`backend/database/engine.py`](https://github.com/eldasoky1/mvp_plan/blob/main/backend/database/engine.py) (Async database sessions), [`portfolio-preview/src/App.jsx`](https://github.com/eldasoky1/mvp_plan/blob/main/portfolio-preview/src/App.jsx) (React client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_react_ui["React client<br/>[App.jsx]"]
  node_mvp_ui["MVP client<br/>[index.html]"]
end

subgraph group_api["Assessment API"]
  node_api_routes["Assessment and reports<br/>[main.py]"]
  node_request_response["Request and response schemas<br/>[schemas.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

subgraph group_inference["Risk inference"]
  node_ai_service["Inference wrapper<br/>[ai_service.py]"]
  node_keyword_classifier["Keyword fallback<br/>[ai_service.py]"]
  node_trained_predictor["Trained predictor"]
end

subgraph group_data["Persistence and rules"]
  node_session_layer["Async database sessions<br/>[engine.py]"]
  node_orm_models["Project and assessment models<br/>[models.py]"]
  node_rule_seed["Compliance rule seeding<br/>[seed_rules.py]"]
end

node_user(("Project submitter"))
node_postgres[("PostgreSQL")]

node_user -->|"submits project"| node_react_ui
node_react_ui -->|"sends requests"| node_api_routes
node_user -->|"enters project"| node_mvp_ui
node_mvp_ui -->|"sends requests"| node_api_routes
node_api_routes -->|"validates and returns"| node_request_response
node_api_routes -->|"requests assessment"| node_ai_service
node_ai_service -.->|"loads and invokes"| node_trained_predictor
node_ai_service -->|"falls back"| node_keyword_classifier
node_api_routes -->|"obtains session"| node_session_layer
node_session_layer -->|"reads database settings"| node_settings
node_api_routes -->|"creates and queries"| node_orm_models
node_session_layer -->|"connects to"| node_postgres
node_api_routes -->|"persists and reads assessments"| node_postgres
node_rule_seed -.->|"seeds rule catalog"| node_postgres

click node_react_ui "https://github.com/eldasoky1/mvp_plan/blob/main/portfolio-preview/src/App.jsx"
click node_mvp_ui "https://github.com/eldasoky1/mvp_plan/blob/main/frontend/index.html"
click node_api_routes "https://github.com/eldasoky1/mvp_plan/blob/main/backend/main.py"
click node_request_response "https://github.com/eldasoky1/mvp_plan/blob/main/backend/schemas.py"
click node_settings "https://github.com/eldasoky1/mvp_plan/blob/main/backend/config.py"
click node_ai_service "https://github.com/eldasoky1/mvp_plan/blob/main/backend/ai_service.py"
click node_keyword_classifier "https://github.com/eldasoky1/mvp_plan/blob/main/backend/ai_service.py"
click node_session_layer "https://github.com/eldasoky1/mvp_plan/blob/main/backend/database/engine.py"
click node_orm_models "https://github.com/eldasoky1/mvp_plan/blob/main/backend/models.py"
click node_rule_seed "https://github.com/eldasoky1/mvp_plan/blob/main/seed_rules.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_react_ui,node_mvp_ui toneBlue
class node_api_routes,node_request_response,node_settings,node_postgres toneAmber
class node_ai_service,node_keyword_classifier,node_trained_predictor toneMint
class node_session_layer,node_orm_models,node_rule_seed toneRose
class node_user toneIndigo
```

## Components

### User interface

- [React client](https://github.com/eldasoky1/mvp_plan/blob/main/portfolio-preview/src/App.jsx): `portfolio-preview/src/App.jsx`
- [MVP client](https://github.com/eldasoky1/mvp_plan/blob/main/frontend/index.html): `frontend/index.html`

### Assessment API

- [Assessment and reports](https://github.com/eldasoky1/mvp_plan/blob/main/backend/main.py): `backend/main.py`
- [Request and response schemas](https://github.com/eldasoky1/mvp_plan/blob/main/backend/schemas.py): `backend/schemas.py`
- [Runtime settings](https://github.com/eldasoky1/mvp_plan/blob/main/backend/config.py): `backend/config.py`

### Risk inference

- [Inference wrapper](https://github.com/eldasoky1/mvp_plan/blob/main/backend/ai_service.py): `backend/ai_service.py`
- [Keyword fallback](https://github.com/eldasoky1/mvp_plan/blob/main/backend/ai_service.py): `backend/ai_service.py`
- **Trained predictor**

### Persistence and rules

- [Async database sessions](https://github.com/eldasoky1/mvp_plan/blob/main/backend/database/engine.py): `backend/database/engine.py`
- [Project and assessment models](https://github.com/eldasoky1/mvp_plan/blob/main/backend/models.py): `backend/models.py`
- [Compliance rule seeding](https://github.com/eldasoky1/mvp_plan/blob/main/seed_rules.py): `seed_rules.py`

### Other components

- **Project submitter**
- **PostgreSQL**

## Connections

- Project submitter → React client: submits project (evidence: `README.md`)
- React client → Assessment and reports: sends requests (evidence: `README.md`)
- Project submitter → MVP client: enters project (evidence: `README.md`)
- MVP client → Assessment and reports: sends requests (evidence: `README.md`)
- Assessment and reports → Request and response schemas: validates and returns (evidence: `backend/main.py`)
- Assessment and reports → Inference wrapper: requests assessment (evidence: `backend/main.py`)
- Inference wrapper → Trained predictor: loads and invokes
- Inference wrapper → Keyword fallback: falls back (evidence: `backend/ai_service.py`)
- Assessment and reports → Async database sessions: obtains session (evidence: `backend/main.py`)
- Async database sessions → Runtime settings: reads database settings (evidence: `backend/database/engine.py`)
- Assessment and reports → Project and assessment models: creates and queries (evidence: `backend/main.py`)
- Async database sessions → PostgreSQL: connects to (evidence: `README.md`)
- Assessment and reports → PostgreSQL: persists and reads assessments (evidence: `backend/main.py`)
- Compliance rule seeding → PostgreSQL: seeds rule catalog
