# lrondal/web-portfolio-generator architecture

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

- Interactive diagram: https://gitdiagram.com/lrondal/web-portfolio-generator
- Repository: https://github.com/lrondal/web-portfolio-generator

## Overview

Portfolio Generator is a FastAPI web app for managing user profiles and their projects, then presenting each user as a portfolio. The main creation flow is: open the add-user page, enter profile details and dynamically add projects, submit the user and then its projects, and return to the home page. Users can also browse the user list, view a generated portfolio, and delete users or projects. The excerpts show API handlers, SQLite persistence, and the form script; template internals and some UI wiring are not sampled, so those links rely only on README documentation.

Main entry points: [`main.py`](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py) (FastAPI routes), [`static/add-user.js`](https://github.com/lrondal/web-portfolio-generator/blob/main/static/add-user.js) (Project form logic), [`template/add-user.html`](https://github.com/lrondal/web-portfolio-generator/blob/main/template/add-user.html) (Add-user page), [`template/index.html`](https://github.com/lrondal/web-portfolio-generator/blob/main/template/index.html) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_add_page["Add-user page<br/>[add-user.html]"]
  node_form_script["Project form logic<br/>[add-user.js]"]
  node_home_template["Home page<br/>[index.html]"]
  node_users_template["Users listing<br/>[users.html]"]
  node_portfolio_template["Portfolio view<br/>[cv.html]"]
end

subgraph group_api["Application API"]
  node_app_routes["FastAPI routes<br/>[main.py]"]
end

subgraph group_domain["Portfolio data"]
  node_user_creation["Create user<br/>[main.py]"]
  node_project_creation["Create project<br/>[main.py]"]
  node_user_listing["List users<br/>[main.py]"]
  node_portfolio_lookup["Load portfolio<br/>[main.py]"]
  node_user_deletion["Delete user<br/>[main.py]"]
  node_project_deletion["Delete project<br/>[main.py]"]
end

subgraph group_persistence["Persistence"]
  node_data_models["User and project models<br/>[main.py]"]
  node_sqlite_store[("SQLite database<br/>[main.py]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens form"| node_add_page
node_add_page -.->|"loads script"| node_form_script
node_form_script -->|"POST user"| node_user_creation
node_form_script -->|"POST projects"| node_project_creation
node_form_script -->|"redirects after submit"| node_home_template
node_visitor -->|"opens home"| node_home_template
node_visitor -->|"views users"| node_users_template
node_visitor -->|"opens portfolio"| node_portfolio_template
node_app_routes -->|"routes POST"| node_user_creation
node_app_routes -->|"routes POST"| node_project_creation
node_app_routes -->|"routes listing"| node_user_listing
node_app_routes -->|"routes portfolio"| node_portfolio_lookup
node_app_routes -->|"routes delete"| node_user_deletion
node_app_routes -->|"routes delete"| node_project_deletion
node_app_routes -->|"renders home"| node_home_template
node_app_routes -->|"renders users"| node_users_template
node_app_routes -->|"renders form"| node_add_page
node_app_routes -->|"renders portfolio"| node_portfolio_template
node_user_creation -->|"writes user"| node_sqlite_store
node_project_creation -->|"writes project"| node_sqlite_store
node_user_listing -->|"reads users"| node_sqlite_store
node_portfolio_lookup -->|"reads profile and projects"| node_sqlite_store
node_user_deletion -->|"deletes user and projects"| node_sqlite_store
node_project_deletion -->|"deletes project"| node_sqlite_store
node_app_routes -->|"defines records"| node_data_models

click node_add_page "https://github.com/lrondal/web-portfolio-generator/blob/main/template/add-user.html"
click node_form_script "https://github.com/lrondal/web-portfolio-generator/blob/main/static/add-user.js"
click node_home_template "https://github.com/lrondal/web-portfolio-generator/blob/main/template/index.html"
click node_users_template "https://github.com/lrondal/web-portfolio-generator/blob/main/template/users.html"
click node_portfolio_template "https://github.com/lrondal/web-portfolio-generator/blob/main/template/cv.html"
click node_app_routes "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_user_creation "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_project_creation "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_user_listing "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_portfolio_lookup "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_user_deletion "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_project_deletion "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_data_models "https://github.com/lrondal/web-portfolio-generator/blob/main/main.py"
click node_sqlite_store "https://github.com/lrondal/web-portfolio-generator/blob/main/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_add_page,node_form_script,node_home_template,node_users_template,node_portfolio_template toneBlue
class node_app_routes toneAmber
class node_user_creation,node_project_creation,node_user_listing,node_portfolio_lookup,node_user_deletion,node_project_deletion toneMint
class node_data_models,node_sqlite_store toneRose
class node_visitor toneIndigo
```

## Components

### Web interface

- [Add-user page](https://github.com/lrondal/web-portfolio-generator/blob/main/template/add-user.html): `template/add-user.html`
- [Project form logic](https://github.com/lrondal/web-portfolio-generator/blob/main/static/add-user.js): `static/add-user.js`
- [Home page](https://github.com/lrondal/web-portfolio-generator/blob/main/template/index.html): `template/index.html`
- [Users listing](https://github.com/lrondal/web-portfolio-generator/blob/main/template/users.html): `template/users.html`
- [Portfolio view](https://github.com/lrondal/web-portfolio-generator/blob/main/template/cv.html): `template/cv.html`

### Application API

- [FastAPI routes](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`

### Portfolio data

- [Create user](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [Create project](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [List users](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [Load portfolio](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [Delete user](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [Delete project](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`

### Persistence

- [User and project models](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`
- [SQLite database](https://github.com/lrondal/web-portfolio-generator/blob/main/main.py): `main.py`

### Other components

- **Visitor**

## Connections

- Visitor → Add-user page: opens form (evidence: `README.md`)
- Add-user page → Project form logic: loads script
- Project form logic → Create user: POST user (evidence: `static/add-user.js`)
- Project form logic → Create project: POST projects (evidence: `static/add-user.js`)
- Project form logic → Home page: redirects after submit (evidence: `static/add-user.js`)
- Visitor → Home page: opens home (evidence: `README.md`)
- Visitor → Users listing: views users (evidence: `README.md`)
- Visitor → Portfolio view: opens portfolio (evidence: `README.md`)
- FastAPI routes → Create user: routes POST (evidence: `main.py`)
- FastAPI routes → Create project: routes POST (evidence: `main.py`)
- FastAPI routes → List users: routes listing (evidence: `main.py`)
- FastAPI routes → Load portfolio: routes portfolio (evidence: `main.py`)
- FastAPI routes → Delete user: routes delete (evidence: `main.py`)
- FastAPI routes → Delete project: routes delete (evidence: `main.py`)
- FastAPI routes → Home page: renders home (evidence: `main.py`)
- FastAPI routes → Users listing: renders users (evidence: `main.py`)
- FastAPI routes → Add-user page: renders form (evidence: `main.py`)
- FastAPI routes → Portfolio view: renders portfolio (evidence: `main.py`)
- Create user → SQLite database: writes user (evidence: `main.py`)
- Create project → SQLite database: writes project (evidence: `main.py`)
- List users → SQLite database: reads users (evidence: `main.py`)
- Load portfolio → SQLite database: reads profile and projects (evidence: `main.py`)
- Delete user → SQLite database: deletes user and projects (evidence: `main.py`)
- Delete project → SQLite database: deletes project (evidence: `main.py`)
- FastAPI routes → User and project models: defines records (evidence: `main.py`)
