# ideawithflo/portfolio architecture

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

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

## Overview

1. **Repository shape**
   This is a two-part portfolio system: `web/` is the public Next.js site, and `cms/` is a Sanity Studio used to author content. The repo also contains `assets/` for original source files and animation assets that are consumed or mirrored by the frontend.

2. **Public website runtime (`web/`)**
   The public-facing app is a Next.js 14 App Router application written in TypeScript and styled with Tailwind CSS. It is the main delivery surface for pages, project detail routes, SEO metadata, and interactive portfolio UI.

3. **Content management boundary (`cms/`)**
   The CMS is a separate Sanity v3 studio. It runs independently from the website and is the only authoring interface for editable content such as projects and site settings. Publishing in Sanity is what makes content visible on the website.

4. **Data model**
   The CMS schema layer is small and explicit: `project.ts`, `settings.ts`, and `post.ts` define the content types. `project` appears to be the core portfolio entity, while `settings` likely stores global site configuration and featured content. The schema files define the shape of content the frontend can query.

5. **Frontend data access**
   The `web/lib/` folder is the boundary between the site and Sanity. `sanity.ts` configures the Sanity client, and `queries.ts` centralizes the GROQ queries used by pages and components. This keeps data fetching separate from presentation.

6. **Routing and page composition**
   The site is organized around App Router pages in `web/app/`: a homepage, legal pages (`agb`, `datenschutz`, `impressum`), a `new` page, a project listing, dynamic project detail routes (`projects/[slug]`), and workflow pages (`workflow` and `workflow/[slug]`). This suggests a mostly content-driven structure with dynamic rendering for individual entries.

7. **UI component layer**
   Reusable UI is factored into `web/components/` rather than being embedded in pages. The main sections include `Hero`, `About`, `Services`, `Projects`, `FeaturedProject`, `ProjectSlider`, `Contact`, and navigation/theme components. Pages assemble these into the site’s marketing and portfolio experience.

8. **Interactive and media features**
   Several components represent specialized client-side features: `ThemeProvider`/`ThemeToggle` handle dark/light mode, `CookieBanner` handles consent UX, `ModelViewer` supports 3D GLB assets, and `Konfetti` appears to wrap the confetti effect sourced from `assets/input.konfetti`. These are presentation features layered on top of the CMS data.

9. **SEO and platform metadata**
   The app includes `StructuredData` for JSON-LD, a sitemap route, and `robots.txt` in `public/`. `app/layout.tsx` likely owns global metadata and verification tags, which makes SEO a first-class architectural concern rather than an afterthought.

10. **Static asset flow**
   Public files live in `web/public/`, including 3D models under `public/models/`. This separates immutable static media from CMS-managed content. The `assets/` directory holds original source material, while the Next.js app consumes the built/public versions.

11. **Deployment and environment**
   The intended production runtime is Vercel for the Next.js app, with Sanity hosted separately. The frontend depends on environment variables for the Sanity project ID, dataset, and site URL, so deployment is split between static/runtime site config and externally hosted CMS content.

Main entry points: [`web/lib/queries.ts`](https://github.com/ideawithflo/portfolio/blob/main/web/lib/queries.ts) (Queries), [`web/app/page.tsx`](https://github.com/ideawithflo/portfolio/blob/main/web/app/page.tsx) (Home), [`web/components/ModelViewer.tsx`](https://github.com/ideawithflo/portfolio/blob/main/web/components/ModelViewer.tsx) (Media UI), [`web/components/ProjectCard.tsx`](https://github.com/ideawithflo/portfolio/blob/main/web/components/ProjectCard.tsx) (Project UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_web_app_layout["Layout<br/>next app shell<br/>[layout.tsx]"]
  node_web_app_home["Home<br/>app route<br/>[page.tsx]"]
  node_web_app_projects["Projects<br/>app route<br/>[page.tsx]"]
  node_web_app_workflow["Workflow<br/>app route<br/>[page.tsx]"]
  node_web_app_legal["Legal<br/>app routes<br/>[page.tsx]"]
  node_web_components_sections["Sections<br/>[Projects.tsx]"]
  node_web_components_project["Project UI<br/>ui cards<br/>[ProjectCard.tsx]"]
  node_web_components_shell["Shell UI<br/>navigation/theme<br/>[Navbar.tsx]"]
  node_web_components_media["Media UI<br/>interactive media<br/>[ModelViewer.tsx]"]
  node_web_components_seo["SEO<br/>metadata<br/>[StructuredData.tsx]"]
  node_web_lib_sanity["Sanity client<br/>data client<br/>[sanity.ts]"]
  node_web_lib_queries["Queries<br/>[queries.ts]"]
  node_web_app_sitemap["Sitemap<br/>metadata route<br/>[sitemap.ts]"]
end

subgraph group_cms["CMS"]
  node_cms_studio["Studio<br/>[sanity.config.ts]"]
  node_cms_schemas["Schemas<br/>content models<br/>[index.ts]"]
  node_cms_preview["Preview<br/>studio plugin<br/>[previewPane.tsx]"]
end

subgraph group_media["Media assets"]
  node_media_assets["Source assets<br/>original media<br/>[index.html]"]
  node_web_public["Public media<br/>static assets<br/>[robots.txt]"]
end

node_web_app_layout -->|"wraps"| node_web_components_shell
node_web_app_layout -->|"owns"| node_web_components_seo
node_web_app_home -->|"assembles"| node_web_components_sections
node_web_app_home -->|"shows"| node_web_components_project
node_web_app_projects -->|"renders"| node_web_components_project
node_web_app_workflow -->|"reuses"| node_web_components_sections
node_web_app_legal -->|"inherits"| node_web_components_shell
node_web_app_home -->|"reads"| node_web_lib_queries
node_web_app_projects -->|"reads"| node_web_lib_queries
node_web_app_workflow -->|"reads"| node_web_lib_queries
node_web_lib_queries -->|"uses"| node_web_lib_sanity
node_cms_studio -->|"loads"| node_cms_schemas
node_cms_studio -->|"extends"| node_cms_preview
node_web_lib_queries -.->|"targets"| node_cms_schemas
node_cms_schemas -.->|"supports"| node_cms_preview
node_web_components_media -->|"consumes"| node_web_public
node_web_components_media -.->|"mirrors"| node_media_assets
node_web_app_sitemap -->|"publishes"| node_web_public
node_web_components_seo -.->|"aligns"| node_web_app_sitemap
node_web_components_project -.->|"enhances"| node_web_components_media

click node_web_app_layout "https://github.com/ideawithflo/portfolio/blob/main/web/app/layout.tsx"
click node_web_app_home "https://github.com/ideawithflo/portfolio/blob/main/web/app/page.tsx"
click node_web_app_projects "https://github.com/ideawithflo/portfolio/blob/main/web/app/projects/[slug]/page.tsx"
click node_web_app_workflow "https://github.com/ideawithflo/portfolio/blob/main/web/app/workflow/page.tsx"
click node_web_app_legal "https://github.com/ideawithflo/portfolio/blob/main/web/app/agb/page.tsx"
click node_web_components_sections "https://github.com/ideawithflo/portfolio/blob/main/web/components/Projects.tsx"
click node_web_components_project "https://github.com/ideawithflo/portfolio/blob/main/web/components/ProjectCard.tsx"
click node_web_components_shell "https://github.com/ideawithflo/portfolio/blob/main/web/components/Navbar.tsx"
click node_web_components_media "https://github.com/ideawithflo/portfolio/blob/main/web/components/ModelViewer.tsx"
click node_web_components_seo "https://github.com/ideawithflo/portfolio/blob/main/web/components/StructuredData.tsx"
click node_web_lib_sanity "https://github.com/ideawithflo/portfolio/blob/main/web/lib/sanity.ts"
click node_web_lib_queries "https://github.com/ideawithflo/portfolio/blob/main/web/lib/queries.ts"
click node_cms_studio "https://github.com/ideawithflo/portfolio/blob/main/cms/sanity.config.ts"
click node_cms_schemas "https://github.com/ideawithflo/portfolio/blob/main/cms/schemaTypes/index.ts"
click node_cms_preview "https://github.com/ideawithflo/portfolio/blob/main/cms/plugins/previewPane.tsx"
click node_media_assets "https://github.com/ideawithflo/portfolio/blob/main/assets/input.konfetti/index.html"
click node_web_public "https://github.com/ideawithflo/portfolio/blob/main/web/public/robots.txt"
click node_web_app_sitemap "https://github.com/ideawithflo/portfolio/blob/main/web/app/sitemap.ts"

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_web_app_layout,node_web_app_home,node_web_app_projects,node_web_app_workflow,node_web_app_legal,node_web_components_sections,node_web_components_project,node_web_components_shell,node_web_components_media,node_web_components_seo,node_web_lib_sanity,node_web_lib_queries,node_web_app_sitemap toneBlue
class node_cms_studio,node_cms_schemas,node_cms_preview toneAmber
class node_media_assets,node_web_public toneMint
```

## Components

### Web app

Next.js public portfolio site

- [Layout](https://github.com/ideawithflo/portfolio/blob/main/web/app/layout.tsx): next app shell · Global app shell and metadata · `web/app/layout.tsx`
- [Home](https://github.com/ideawithflo/portfolio/blob/main/web/app/page.tsx): app route · Homepage route composition · `web/app/page.tsx`
- [Projects](https://github.com/ideawithflo/portfolio/blob/main/web/app/projects/[slug]/page.tsx): app route · Project listing route · `web/app/projects/[slug]/page.tsx`
- [Workflow](https://github.com/ideawithflo/portfolio/blob/main/web/app/workflow/page.tsx): app route · Workflow listing and detail routes · `web/app/workflow/page.tsx`
- [Legal](https://github.com/ideawithflo/portfolio/blob/main/web/app/agb/page.tsx): app routes · Static legal pages · `web/app/agb/page.tsx`
- [Sections](https://github.com/ideawithflo/portfolio/blob/main/web/components/Projects.tsx): ui sections · Hero, About, Services, Projects, Contact · `web/components/Projects.tsx`
- [Project UI](https://github.com/ideawithflo/portfolio/blob/main/web/components/ProjectCard.tsx): ui cards · Project cards, sliders, featured project · `web/components/ProjectCard.tsx`
- [Shell UI](https://github.com/ideawithflo/portfolio/blob/main/web/components/Navbar.tsx): navigation/theme · Navbar, theme toggle, provider · `web/components/Navbar.tsx`
- [Media UI](https://github.com/ideawithflo/portfolio/blob/main/web/components/ModelViewer.tsx): interactive media · 3D viewer and confetti presentation · `web/components/ModelViewer.tsx`
- [SEO](https://github.com/ideawithflo/portfolio/blob/main/web/components/StructuredData.tsx): metadata · Structured data and consent banner · `web/components/StructuredData.tsx`
- [Sanity client](https://github.com/ideawithflo/portfolio/blob/main/web/lib/sanity.ts): data client · Frontend Sanity connection config · `web/lib/sanity.ts`
- [Queries](https://github.com/ideawithflo/portfolio/blob/main/web/lib/queries.ts): groq queries · Centralized content queries · `web/lib/queries.ts`
- [Sitemap](https://github.com/ideawithflo/portfolio/blob/main/web/app/sitemap.ts): metadata route · XML sitemap generation · `web/app/sitemap.ts`

### CMS

Sanity studio and content schema

- [Studio](https://github.com/ideawithflo/portfolio/blob/main/cms/sanity.config.ts): sanity studio · Sanity authoring application · `cms/sanity.config.ts`
- [Schemas](https://github.com/ideawithflo/portfolio/blob/main/cms/schemaTypes/index.ts): content models · Project, settings, and post schema definitions · `cms/schemaTypes/index.ts`
- [Preview](https://github.com/ideawithflo/portfolio/blob/main/cms/plugins/previewPane.tsx): studio plugin · Preview pane integration · `cms/plugins/previewPane.tsx`

### Media assets

Source and public static assets

- [Source assets](https://github.com/ideawithflo/portfolio/blob/main/assets/input.konfetti/index.html): original media · Original confetti asset sources · `assets/input.konfetti/index.html`
- [Public media](https://github.com/ideawithflo/portfolio/blob/main/web/public/robots.txt): static assets · Built and served static files including models and robots · `web/public/robots.txt`

## Connections

- Layout → Shell UI: wraps · Provides global navigation and theme context
- Layout → SEO: owns · Defines shared metadata and structured data
- Home → Sections: assembles · Homepage composes marketing sections
- Home → Project UI: shows · Homepage highlights portfolio items
- Projects → Project UI: renders · Project routes use card/slider UI
- Workflow → Sections: reuses · Workflow pages share reusable section components
- Legal → Shell UI: inherits · Legal pages share the app shell
- Home → Queries: reads · Homepage fetches portfolio content
- Projects → Queries: reads · Project pages query project data
- Workflow → Queries: reads · Workflow pages query content entries
- Queries → Sanity client: uses · Queries execute through the Sanity client
- Studio → Schemas: loads · Studio registers content types
- Studio → Preview: extends · Studio includes preview tooling
- Queries → Schemas: targets · Frontend queries mirror CMS content models
- Schemas → Preview: supports · Schema content is previewed in studio
- Media UI → Public media: consumes · Viewer and media features use public assets
- Media UI → Source assets: mirrors · Some presentation assets originate in source files
- Sitemap → Public media: publishes · Sitemap and static public files are served together
- SEO → Sitemap: aligns · SEO metadata complements sitemap output
- Project UI → Media UI: enhances · Portfolio UI can embed media-rich presentation
