# demos2003/demos-portfoliov2 architecture

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

- Interactive diagram: https://gitdiagram.com/demos2003/demos-portfoliov2
- Repository: https://github.com/demos2003/demos-portfoliov2

## Overview

This is a portfolio website with an admin-managed content system and an interactive AI assistant. Visitors browse portfolio sections, project listings and case studies; Demi answers questions using site content and can submit a visitor message to the admin inbox. Admins authenticate and manage portfolio content and messages. The sampled source confirms the homepage's data-loading, Demi's API flow, and several data-layer operations; other admin mutations and integrations are represented only where the file tree or source index supports them.

Main entry points: [`app/admin/(dashboard)/page.tsx`](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/page.tsx) (Admin dashboard), [`app/page.tsx`](https://github.com/demos2003/demos-portfoliov2/blob/main/app/page.tsx) (Portfolio home), [`lib/data/projects.ts`](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/projects.ts) (Project data), [`app/api/demi/route.ts`](https://github.com/demos2003/demos-portfoliov2/blob/main/app/api/demi/route.ts) (Chat API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_visitor["Visitor experience"]
  node_home["Portfolio home<br/>[page.tsx]"]
  node_projectlisting["Project listings<br/>[page.tsx]"]
  node_case["Project case study<br/>[page.tsx]"]
  node_sitecontent["Portfolio sections<br/>[about.tsx]"]
  node_contactui["Contact form<br/>[contact.tsx]"]
end

subgraph group_demi["Demi assistant"]
  node_demiui["Demi interface<br/>[demi.tsx]"]
  node_demihome["Demi home scene<br/>[demi-home.tsx]"]
  node_sprite["Demi sprite<br/>[demi-sprite.tsx]"]
  node_chatapi["Chat API<br/>[route.ts]"]
  node_prompt["Prompt context<br/>[context.ts]"]
  node_ratelimit["Request limits<br/>[rate-limit.ts]"]
end

subgraph group_admin["Admin CMS"]
  node_login["Admin login<br/>[page.tsx]"]
  node_dashboard["Admin dashboard<br/>[page.tsx]"]
  node_aboutadmin["About editor<br/>[page.tsx]"]
  node_blogadmin["Blog editor<br/>[page.tsx]"]
  node_projectsadmin["Project editor<br/>[page.tsx]"]
  node_skillsadmin["Skills editor<br/>[page.tsx]"]
  node_messagesadmin["Message inbox<br/>[page.tsx]"]
end

subgraph group_data["Content data"]
  node_aboutdata["About data<br/>[about.ts]"]
  node_blogdata["Blog data<br/>[blog.ts]"]
  node_projectdata["Project data<br/>[projects.ts]"]
  node_skilldata["Skills data<br/>[skills.ts]"]
  node_contactdata["Contact data<br/>[contact.ts]"]
  node_supabase["Supabase client<br/>[server.ts]"]
end

node_visitor(("Visitor"))
node_anthropic["Anthropic"]
node_emailjs["EmailJS"]
node_database[("Supabase")]

node_visitor -->|"opens"| node_home
node_visitor -.->|"browses"| node_projectlisting
node_projectlisting -->|"loads projects"| node_projectdata
node_visitor -.->|"opens project"| node_case
node_home -->|"loads content"| node_aboutdata
node_home -->|"loads posts"| node_blogdata
node_home -->|"loads projects"| node_projectdata
node_home -->|"loads skills"| node_skilldata
node_home -->|"renders sections"| node_sitecontent
node_home -->|"renders assistant"| node_demiui
node_case -->|"loads project"| node_projectdata
node_demiui -->|"renders"| node_demihome
node_demiui -->|"renders"| node_sprite
node_demiui -.->|"sends chat"| node_chatapi
node_chatapi -->|"checks limits"| node_ratelimit
node_chatapi -->|"builds prompt"| node_prompt
node_chatapi -->|"streams response"| node_anthropic
node_prompt -->|"loads projects"| node_projectdata
node_prompt -->|"loads skills"| node_skilldata
node_prompt -->|"loads profile"| node_aboutdata
node_prompt -->|"loads posts"| node_blogdata
node_chatapi -->|"records message"| node_contactdata
node_chatapi -->|"requests notification"| node_emailjs
node_visitor -.->|"submits inquiry"| node_contactui
node_login -.->|"authenticates"| node_dashboard
node_dashboard -.->|"manages profile"| node_aboutadmin
node_dashboard -.->|"manages posts"| node_blogadmin
node_dashboard -.->|"manages projects"| node_projectsadmin
node_dashboard -.->|"manages skills"| node_skillsadmin
node_dashboard -.->|"opens inbox"| node_messagesadmin
node_aboutadmin -->|"loads profile"| node_aboutdata
node_blogadmin -->|"loads posts"| node_blogdata
node_projectsadmin -->|"loads projects"| node_projectdata
node_skillsadmin -->|"loads skills"| node_skilldata
node_messagesadmin -->|"loads messages"| node_contactdata
node_dashboard -->|"reads summary"| node_projectdata
node_dashboard -->|"reads summary"| node_blogdata
node_dashboard -->|"reads summary"| node_contactdata
node_aboutdata -->|"queries"| node_supabase
node_projectdata -->|"queries"| node_supabase
node_supabase -->|"connects"| node_database
node_blogdata -->|"queries"| node_supabase
node_skilldata -->|"queries"| node_supabase
node_contactdata -->|"queries"| node_supabase

click node_home "https://github.com/demos2003/demos-portfoliov2/blob/main/app/page.tsx"
click node_projectlisting "https://github.com/demos2003/demos-portfoliov2/blob/main/app/projects/page.tsx"
click node_case "https://github.com/demos2003/demos-portfoliov2/blob/main/app/projects/%5Bslug%5D/page.tsx"
click node_sitecontent "https://github.com/demos2003/demos-portfoliov2/blob/main/components/about.tsx"
click node_contactui "https://github.com/demos2003/demos-portfoliov2/blob/main/components/contact.tsx"
click node_demiui "https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi.tsx"
click node_demihome "https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi-home.tsx"
click node_sprite "https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi-sprite.tsx"
click node_chatapi "https://github.com/demos2003/demos-portfoliov2/blob/main/app/api/demi/route.ts"
click node_prompt "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/demi/context.ts"
click node_ratelimit "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/demi/rate-limit.ts"
click node_login "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(auth)/login/page.tsx"
click node_dashboard "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/page.tsx"
click node_aboutadmin "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/about/page.tsx"
click node_blogadmin "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/blog/page.tsx"
click node_projectsadmin "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/projects/page.tsx"
click node_skillsadmin "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/skills/page.tsx"
click node_messagesadmin "https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/messages/page.tsx"
click node_aboutdata "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/about.ts"
click node_blogdata "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/blog.ts"
click node_projectdata "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/projects.ts"
click node_skilldata "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/skills.ts"
click node_contactdata "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/contact.ts"
click node_supabase "https://github.com/demos2003/demos-portfoliov2/blob/main/lib/supabase/server.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_home,node_projectlisting,node_case,node_sitecontent,node_contactui toneBlue
class node_demiui,node_demihome,node_sprite,node_chatapi,node_prompt,node_ratelimit,node_database toneAmber
class node_login,node_dashboard,node_aboutadmin,node_blogadmin,node_projectsadmin,node_skillsadmin,node_messagesadmin toneMint
class node_aboutdata,node_blogdata,node_projectdata,node_skilldata,node_contactdata,node_supabase toneRose
class node_visitor,node_anthropic,node_emailjs toneIndigo
```

## Components

### Visitor experience

- [Portfolio home](https://github.com/demos2003/demos-portfoliov2/blob/main/app/page.tsx): `app/page.tsx`
- [Project listings](https://github.com/demos2003/demos-portfoliov2/blob/main/app/projects/page.tsx): `app/projects/page.tsx`
- [Project case study](https://github.com/demos2003/demos-portfoliov2/blob/main/app/projects/%5Bslug%5D/page.tsx): `app/projects/[slug]/page.tsx`
- [Portfolio sections](https://github.com/demos2003/demos-portfoliov2/blob/main/components/about.tsx): `components/about.tsx`
- [Contact form](https://github.com/demos2003/demos-portfoliov2/blob/main/components/contact.tsx): `components/contact.tsx`

### Demi assistant

- [Demi interface](https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi.tsx): `components/demi/demi.tsx`
- [Demi home scene](https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi-home.tsx): `components/demi/demi-home.tsx`
- [Demi sprite](https://github.com/demos2003/demos-portfoliov2/blob/main/components/demi/demi-sprite.tsx): `components/demi/demi-sprite.tsx`
- [Chat API](https://github.com/demos2003/demos-portfoliov2/blob/main/app/api/demi/route.ts): `app/api/demi/route.ts`
- [Prompt context](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/demi/context.ts): `lib/demi/context.ts`
- [Request limits](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/demi/rate-limit.ts): `lib/demi/rate-limit.ts`

### Admin CMS

- [Admin login](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(auth)/login/page.tsx): `app/admin/(auth)/login/page.tsx`
- [Admin dashboard](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/page.tsx): `app/admin/(dashboard)/page.tsx`
- [About editor](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/about/page.tsx): `app/admin/(dashboard)/about/page.tsx`
- [Blog editor](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/blog/page.tsx): `app/admin/(dashboard)/blog/page.tsx`
- [Project editor](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/projects/page.tsx): `app/admin/(dashboard)/projects/page.tsx`
- [Skills editor](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/skills/page.tsx): `app/admin/(dashboard)/skills/page.tsx`
- [Message inbox](https://github.com/demos2003/demos-portfoliov2/blob/main/app/admin/(dashboard)/messages/page.tsx): `app/admin/(dashboard)/messages/page.tsx`

### Content data

- [About data](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/about.ts): `lib/data/about.ts`
- [Blog data](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/blog.ts): `lib/data/blog.ts`
- [Project data](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/projects.ts): `lib/data/projects.ts`
- [Skills data](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/skills.ts): `lib/data/skills.ts`
- [Contact data](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/data/contact.ts): `lib/data/contact.ts`
- [Supabase client](https://github.com/demos2003/demos-portfoliov2/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`

### Other components

- **Visitor**
- **Anthropic**
- **EmailJS**
- **Supabase**

## Connections

- Visitor → Portfolio home: opens (evidence: `app/page.tsx`)
- Visitor → Project listings: browses
- Project listings → Project data: loads projects (evidence: `app/projects/page.tsx`)
- Visitor → Project case study: opens project
- Portfolio home → About data: loads content (evidence: `app/page.tsx`)
- Portfolio home → Blog data: loads posts (evidence: `app/page.tsx`)
- Portfolio home → Project data: loads projects (evidence: `app/page.tsx`)
- Portfolio home → Skills data: loads skills (evidence: `app/page.tsx`)
- Portfolio home → Portfolio sections: renders sections (evidence: `app/page.tsx`)
- Portfolio home → Demi interface: renders assistant (evidence: `app/page.tsx`)
- Project case study → Project data: loads project (evidence: `app/projects/[slug]/page.tsx`)
- Demi interface → Demi home scene: renders (evidence: `components/demi/demi.tsx`)
- Demi interface → Demi sprite: renders (evidence: `components/demi/demi.tsx`)
- Demi interface → Chat API: sends chat
- Chat API → Request limits: checks limits (evidence: `app/api/demi/route.ts`)
- Chat API → Prompt context: builds prompt (evidence: `app/api/demi/route.ts`)
- Chat API → Anthropic: streams response (evidence: `app/api/demi/route.ts`)
- Prompt context → Project data: loads projects (evidence: `lib/demi/context.ts`)
- Prompt context → Skills data: loads skills (evidence: `lib/demi/context.ts`)
- Prompt context → About data: loads profile (evidence: `lib/demi/context.ts`)
- Prompt context → Blog data: loads posts (evidence: `lib/demi/context.ts`)
- Chat API → Contact data: records message (evidence: `app/api/demi/route.ts`)
- Chat API → EmailJS: requests notification (evidence: `app/api/demi/route.ts`)
- Visitor → Contact form: submits inquiry
- Admin login → Admin dashboard: authenticates
- Admin dashboard → About editor: manages profile
- Admin dashboard → Blog editor: manages posts
- Admin dashboard → Project editor: manages projects
- Admin dashboard → Skills editor: manages skills
- Admin dashboard → Message inbox: opens inbox
- About editor → About data: loads profile (evidence: `app/admin/(dashboard)/about/page.tsx`)
- Blog editor → Blog data: loads posts (evidence: `app/admin/(dashboard)/blog/page.tsx`)
- Project editor → Project data: loads projects (evidence: `app/admin/(dashboard)/projects/page.tsx`)
- Skills editor → Skills data: loads skills (evidence: `app/admin/(dashboard)/skills/page.tsx`)
- Message inbox → Contact data: loads messages (evidence: `app/admin/(dashboard)/messages/page.tsx`)
- Admin dashboard → Project data: reads summary (evidence: `app/admin/(dashboard)/page.tsx`)
- Admin dashboard → Blog data: reads summary (evidence: `app/admin/(dashboard)/page.tsx`)
- Admin dashboard → Contact data: reads summary (evidence: `app/admin/(dashboard)/page.tsx`)
- About data → Supabase client: queries (evidence: `lib/data/about.ts`)
- Project data → Supabase client: queries (evidence: `lib/data/projects.ts`)
- Supabase client → Supabase: connects (evidence: `lib/supabase/server.ts`)
- Blog data → Supabase client: queries (evidence: `lib/data/blog.ts`)
- Skills data → Supabase client: queries (evidence: `lib/data/skills.ts`)
- Contact data → Supabase client: queries (evidence: `lib/data/contact.ts`)
