# caffeine-addictt/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/caffeine-addictt/portfolio
- Repository: https://github.com/caffeine-addictt/portfolio

## Overview

This is a Rust portfolio website: HTTP requests are routed to pages and form handlers, which render HTML and, for blog and contact workflows, use the database; contact submissions also trigger a Discord webhook. The graph includes the documented website areas and the core runtime layers. Source excerpts show the blog and contact data flows, but not the project handler or its data wiring, so that relationship is omitted.

Main entry points: [`src/routes/mod.rs`](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/mod.rs) (Route dispatcher), [`src/config.rs`](https://github.com/caffeine-addictt/portfolio/blob/main/src/config.rs) (Template setup), [`src/routes/contact.rs`](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/contact.rs) (Contact form), [`src/database/mod.rs`](https://github.com/caffeine-addictt/portfolio/blob/main/src/database/mod.rs) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website"]
  node_home["Home and privacy<br/>[index.rs]"]
  node_projects["Projects pages<br/>[projects.rs]"]
  node_blog["Blog pages<br/>[blog.rs]"]
  node_contact["Contact form<br/>[contact.rs]"]
  node_errors["Error pages<br/>[error.rs]"]
  node_templates["HTML templates"]
end

subgraph group_runtime["Runtime"]
  node_server["HTTP server<br/>[main.rs]"]
  node_router["Route dispatcher<br/>[mod.rs]"]
  node_renderer["Template setup<br/>[config.rs]"]
end

subgraph group_data["Content and storage"]
  node_timeline["Work and education"]
  node_project_data["Project content<br/>[projects.json]"]
  node_database["Database access<br/>[mod.rs]"]
  node_migrations["Schema migrations<br/>[migrate.rs]"]
end

subgraph group_integrations["Integrations"]
  node_turso[("Turso database")]
  node_webhook["Webhook sender<br/>[webhook.rs]"]
  node_discord["Discord webhook"]
end

node_visitor(("Site visitor"))

node_visitor -->|"requests pages"| node_server
node_server -->|"serves routes"| node_router
node_router -->|"routes home"| node_home
node_router -->|"routes projects"| node_projects
node_router -->|"routes blog"| node_blog
node_router -->|"routes contact"| node_contact
node_router -->|"handles fallback"| node_errors
node_server -->|"initializes templates"| node_renderer
node_home -->|"renders pages"| node_renderer
node_home -->|"loads timeline data"| node_timeline
node_blog -->|"queries posts"| node_database
node_blog -->|"renders posts"| node_renderer
node_contact -->|"stores submission"| node_database
node_contact -->|"sends submission"| node_webhook
node_contact -->|"renders result"| node_renderer
node_database -->|"runs migrations"| node_migrations
node_database -->|"syncs database"| node_turso
node_webhook -->|"posts message"| node_discord
node_renderer -->|"loads templates"| node_templates

click node_server "https://github.com/caffeine-addictt/portfolio/blob/main/src/main.rs"
click node_router "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/mod.rs"
click node_home "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/index.rs"
click node_projects "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/projects.rs"
click node_blog "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/blog.rs"
click node_contact "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/contact.rs"
click node_errors "https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/error.rs"
click node_renderer "https://github.com/caffeine-addictt/portfolio/blob/main/src/config.rs"
click node_templates "https://github.com/caffeine-addictt/portfolio/tree/main/templates"
click node_timeline "https://github.com/caffeine-addictt/portfolio/tree/main/data"
click node_project_data "https://github.com/caffeine-addictt/portfolio/blob/main/data/projects.json"
click node_database "https://github.com/caffeine-addictt/portfolio/blob/main/src/database/mod.rs"
click node_migrations "https://github.com/caffeine-addictt/portfolio/blob/main/src/database/migrate.rs"
click node_webhook "https://github.com/caffeine-addictt/portfolio/blob/main/src/services/webhook.rs"

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_home,node_projects,node_blog,node_contact,node_errors,node_templates toneBlue
class node_server,node_router,node_renderer toneAmber
class node_timeline,node_project_data,node_database,node_migrations toneMint
class node_turso,node_webhook,node_discord toneRose
class node_visitor toneIndigo
```

## Components

### Website

- [Home and privacy](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/index.rs): `src/routes/index.rs`
- [Projects pages](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/projects.rs): `src/routes/projects.rs`
- [Blog pages](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/blog.rs): `src/routes/blog.rs`
- [Contact form](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/contact.rs): `src/routes/contact.rs`
- [Error pages](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/error.rs): `src/routes/error.rs`
- [HTML templates](https://github.com/caffeine-addictt/portfolio/tree/main/templates): `templates`

### Runtime

- [HTTP server](https://github.com/caffeine-addictt/portfolio/blob/main/src/main.rs): `src/main.rs`
- [Route dispatcher](https://github.com/caffeine-addictt/portfolio/blob/main/src/routes/mod.rs): `src/routes/mod.rs`
- [Template setup](https://github.com/caffeine-addictt/portfolio/blob/main/src/config.rs): `src/config.rs`

### Content and storage

- [Work and education](https://github.com/caffeine-addictt/portfolio/tree/main/data): `data`
- [Project content](https://github.com/caffeine-addictt/portfolio/blob/main/data/projects.json): `data/projects.json`
- [Database access](https://github.com/caffeine-addictt/portfolio/blob/main/src/database/mod.rs): `src/database/mod.rs`
- [Schema migrations](https://github.com/caffeine-addictt/portfolio/blob/main/src/database/migrate.rs): `src/database/migrate.rs`

### Integrations

- **Turso database**
- [Webhook sender](https://github.com/caffeine-addictt/portfolio/blob/main/src/services/webhook.rs): `src/services/webhook.rs`
- **Discord webhook**

### Other components

- **Site visitor**

## Connections

- Site visitor → HTTP server: requests pages
- HTTP server → Route dispatcher: serves routes (evidence: `src/main.rs`)
- Route dispatcher → Home and privacy: routes home (evidence: `src/routes/mod.rs`)
- Route dispatcher → Projects pages: routes projects (evidence: `src/routes/mod.rs`)
- Route dispatcher → Blog pages: routes blog (evidence: `src/routes/mod.rs`)
- Route dispatcher → Contact form: routes contact (evidence: `src/routes/mod.rs`)
- Route dispatcher → Error pages: handles fallback (evidence: `src/routes/mod.rs`)
- HTTP server → Template setup: initializes templates (evidence: `src/main.rs`)
- Home and privacy → Template setup: renders pages (evidence: `src/routes/index.rs`)
- Home and privacy → Work and education: loads timeline data (evidence: `src/routes/index.rs`)
- Blog pages → Database access: queries posts (evidence: `src/routes/blog.rs`)
- Blog pages → Template setup: renders posts (evidence: `src/routes/blog.rs`)
- Contact form → Database access: stores submission (evidence: `src/routes/contact.rs`)
- Contact form → Webhook sender: sends submission (evidence: `src/routes/contact.rs`)
- Contact form → Template setup: renders result (evidence: `src/routes/contact.rs`)
- Database access → Schema migrations: runs migrations (evidence: `src/database/mod.rs`)
- Database access → Turso database: syncs database (evidence: `src/database/mod.rs`)
- Webhook sender → Discord webhook: posts message (evidence: `src/services/webhook.rs`)
- Template setup → HTML templates: loads templates (evidence: `src/config.rs`)
