Architecture¶
This section documents the architecture of the portfolio website using industry-standard models and diagrams.
On this page¶
| Section | Description |
|---|---|
| Diagrams | C4 model and infrastructure view index |
| System Context | C4 L1 — actors and external systems |
| Container | C4 L2 — deployable units |
| Component Diagrams | C4 L3 — internals of each container |
| Deployment | UML — Azure infrastructure nodes |
| Azure Cloud Architecture | Detailed Azure resource layout |
| Sub-pages | Frontend, Backend, Overview, ADRs |
Diagrams¶
The architecture is documented at multiple levels of abstraction, following the C4 model and supplemented with deployment and cloud-specific views.
C4 Model
| Level | Diagram | Description |
|---|---|---|
| 1 | System Context | Who uses the system and what external systems it interacts with |
| 2 | Container | The high-level technical building blocks and their interactions |
| 3 | Component — Frontend SPA | Internal components of the React SPA container |
| 3 | Component — API Backend | Internal components of the FastAPI backend container |
| 3 | Component — Documentation Site | Internal components of the MkDocs docs container |
Infrastructure Views
| Diagram | Description |
|---|---|
| Deployment | How containers map to Azure infrastructure (UML deployment diagram) |
| Azure Cloud | Detailed Azure resource layout with service icons, both prod and dev |
| Architecture Overview | Combined view with data flows, CI/CD pipelines, and component details |
System Context¶
C4 Level 1 — System Context
The C4 Level 1 diagram shows the portfolio system in context: who uses it and what external systems it depends on.
Key actors:
- Visitors / Recruiters browse the portfolio, download CVs, and send messages via the contact form
- Developer (Sven) pushes code to GitHub, which triggers automated deployments
- External systems: GitHub (CI/CD), Gmail SMTP (email delivery), Microsoft Entra ID (authentication), Azure Cost Management (weekly cost reporting)
Container¶
C4 Level 2 — Container
The C4 Level 2 diagram zooms into the portfolio system to show its containers (deployable units).
Containers:
| Container | Technology | Purpose |
|---|---|---|
| Single-Page Application | React 19 + TypeScript + Vite | Portfolio UI served by nginx; Docs link uses VITE_DOCS_URL |
| API Backend | FastAPI + Python 3.11 | REST API for contact form, CV download, projects, experience, skills |
| UIGen API Explorer | Node 20, @uigen-dev/cli | Auto-generated API Explorer at admin.sven-relijveld.com; guest/admin token auth |
| Documentation Site | MkDocs Material | Architecture docs, ADRs, API reference, cost dashboard |
| nginx Reverse Proxy | nginx 1.25 | Serves frontend static assets, proxies /api/* to backend |
| Azure Key Vault | Managed Service | Stores email credentials, Entra secrets, SWA token, database-url, api-admin-token |
| CMS | Strapi v5 + Node 22 | Headless CMS: project-page-v2 content, REST API at /cms/api/*. Admin at cms.sven-relijveld.com |
| Azure Container Registry | Managed Service | Docker image storage for frontend, backend, UIGen, and CMS |
| PostgreSQL Flexible Server | Azure Managed PostgreSQL | Stores projects, experience, skills data + Strapi content (strapi schema); AAD-only auth via MI |
C4 Level 3 — Component Diagrams¶
The C4 Level 3 diagrams zoom into each container and show its internal components and their relationships.
Frontend SPA Components
Key components:
- Navigation — Wouter routing, anchor-scroll on home
- ContactForm — TanStack Query + useContactForm hook
- CVDownloadButton — EN/NL PDF download
- useProjects hook — TanStack Query with static
initialDatafallback - API Client — openapi-fetch, type-safe from OpenAPI schema
- nginx Reverse Proxy — serves static, proxies
/api/*
API Backend Components
Key components:
- FastAPI App — ASGI entry, CORS, slowapi rate limiting
- ContactRouter —
POST /api/contact - CVRouter —
GET /api/download-cv+ feature-flagged CV generation - ProjectsRouter — projects/experience/skills from PostgreSQL
- AdminRouter —
POST /api/admin/*, bearer token - Database Layer — SQLAlchemy async + asyncpg + Alembic
- Managed Identity Auth — AAD token for PostgreSQL
Documentation Site Components
Key components:
- MkDocs Build Engine — Material theme, static HTML
- mkdocs-drawio plugin — renders
.drawiofiles interactively in-browser (no CI export needed) - Architecture Pages — Markdown + embedded interactive diagrams
- Cost Dashboard Page — auto-committed weekly by
cost-report.yml - SWA Auth Layer — EasyAuth on dev, public on prod
Deployment¶
UML Deployment Diagram
The UML deployment diagram shows how software artifacts are mapped to Azure infrastructure nodes.
Key deployment details:
- Container Apps Environment hosts both frontend and backend containers with auto-scaling (1–5 replicas, triggered at 100 concurrent requests)
- nginx runs inside the frontend container, serving static assets and reverse-proxying
/api/*requests to the backend on port 8000 - Managed Identities provide passwordless access to Key Vault secrets (RBAC: Key Vault Secrets User)
- Azure DNS Zone manages custom domains with managed TLS certificates
Azure Cloud Architecture¶
Azure Cloud Diagram
The detailed Azure cloud diagram shows all Azure resources, their relationships, and configuration across both production and development environments.
Production environment (dna-prod-portfolio-westeurope-rg):
- Container Apps: frontend (www.sven-relijveld.com), backend, and UIGen (admin.sven-relijveld.com) with auto-scaling
- Supporting services: ACR, Key Vault, Log Analytics + App Insights, DNS Zone, PostgreSQL Flexible Server
- Static Web App: docs.sven-relijveld.com (MkDocs Material)
- Azure Cost Management (subscription scope): queried weekly by
cost-report.ymlto generate the cost dashboard
Dev environment (dna-dev-portfolio-westeurope-rg):
- Mirror of prod with EasyAuth protection (Entra SSO) on all services including UIGen (admin.dev.sven-relijveld.com)
- Scale-to-zero capable (min 0 replicas)
- PR preview deployments with image tags
pr-<N>-<sha>
For the full architecture overview with data flows and CI/CD pipeline details, see the Architecture Overview.
Sub-pages¶
| Page | Description |
|---|---|
| Architecture Overview | Combined diagram, data flow, security, scaling, and monitoring details |
| Frontend Architecture | React 19 stack, VITE_DOCS_URL, routing, API request flow, E2E testing |
| Backend Architecture | FastAPI endpoints, PostgreSQL, admin API, CV generation, rate limiting, testing |
| Decision Records | ADRs documenting key technical decisions |
Page history
| Field | Value |
|---|---|
| Last updated | 2026-04-18 |
Changelog
| Date | PRs | Summary |
|---|---|---|
| 2026-03-22 | #93 | Create architecture index page with links to all architecture diagrams and sub-pages |
| 2026-04-17 | React 18 → React 19; add PostgreSQL Flexible Server row; update Key Vault secrets; add C4 Level 3 component diagrams section; add Azure Cost Management to Azure Cloud section | |
| 2026-04-18 | Collapsible sections, top navigation, bullet-list component descriptions | |
| 2026-04-18 | #207 | UIGen added to container table and Azure Cloud section as deployed service |