# karimsamer19/cms-portfolio architecture

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

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

## Overview

Portfolio CMS is a Next.js admin dashboard for maintaining portfolio projects, skills, skill categories, and profile preferences. The main workflow is admin sign-in, route authorization, dashboard navigation, then editing content through page forms and client state into Supabase tables and image buckets. The graph preserves the separate project, skill, category, and settings areas. Relationships for unsampled modules are included only where the README documents them; source-index references support the sampled project and skill flows.

Main entry points: [`app/dashboard/layout.tsx`](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/layout.tsx) (Dashboard shell), [`app/dashboard/projects/page.tsx`](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/projects/page.tsx) (Projects page), [`app/dashboard/skills/page.tsx`](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/page.tsx) (Skills page), [`app/dashboard/settings/page.tsx`](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/page.tsx) (Settings page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and dashboard"]
  node_routes["Route entry<br/>[page.tsx]"]
  node_guard["Route protection<br/>[proxy.ts]"]
  node_dashboard["Dashboard shell<br/>[layout.tsx]"]
end

subgraph group_projects["Project management"]
  node_project_page["Projects page<br/>[page.tsx]"]
  node_project_form["Project editor<br/>[ProjectForm.tsx]"]
  node_project_store["Project state and CRUD<br/>[projectsStore.ts]"]
end

subgraph group_skills["Skills and categories"]
  node_skill_page["Skills page<br/>[page.tsx]"]
  node_skill_manage["Skill management"]
  node_skill_form["Skill editor<br/>[SkillForm.tsx]"]
  node_skill_state["Skill state<br/>[skillsStore.ts]"]
  node_skill_actions["Skill mutations and upload<br/>[skills.ts]"]
  node_category_manage["Category management"]
  node_category_form["Category editor<br/>[CategoryForm.tsx]"]
  node_category_actions["Category mutations<br/>[categories.ts]"]
end

subgraph group_settings["Profile settings"]
  node_settings_page["Settings page<br/>[page.tsx]"]
  node_profile_form["Profile editor<br/>[ProfileForm.tsx]"]
  node_preferences["Dashboard preferences"]
end

node_admin(("Admin user"))
node_clerk{{"Clerk auth"}}
node_supabase[("Supabase database")]
node_storage[("Supabase image buckets")]

node_admin -->|"opens app"| node_routes
node_routes -->|"checks session"| node_clerk
node_routes -->|"redirects signed-in"| node_dashboard
node_admin -->|"requests route"| node_guard
node_guard -->|"checks role"| node_clerk
node_guard -->|"protects routes"| node_dashboard
node_dashboard -.->|"renders section"| node_project_page
node_dashboard -.->|"renders section"| node_skill_page
node_dashboard -.->|"renders section"| node_settings_page
node_admin -->|"manages projects"| node_project_page
node_project_page -->|"fetches and deletes"| node_project_store
node_project_page -->|"renders editor"| node_project_form
node_project_store -->|"reads and writes"| node_supabase
node_project_store -->|"uploads thumbnails"| node_storage
node_admin -->|"manages skills"| node_skill_page
node_skill_page -->|"renders manager"| node_skill_manage
node_skill_page -->|"renders manager"| node_category_manage
node_skill_manage -->|"loads skill state"| node_skill_state
node_skill_manage -->|"renders editor"| node_skill_form
node_skill_state -->|"reads skills"| node_supabase
node_skill_state -->|"dispatches mutations"| node_skill_actions
node_skill_actions -->|"mutates skills"| node_supabase
node_skill_actions -->|"uploads skill icons"| node_storage
node_category_manage -->|"renders editor"| node_category_form
node_admin -->|"adjusts settings"| node_settings_page
node_settings_page -->|"renders profile form"| node_profile_form
node_settings_page -->|"renders preferences"| node_preferences
node_profile_form -.->|"persists profile"| node_supabase
node_category_actions -->|"mutates categories"| node_supabase

click node_routes "https://github.com/karimsamer19/cms-portfolio/blob/main/app/page.tsx"
click node_guard "https://github.com/karimsamer19/cms-portfolio/blob/main/proxy.ts"
click node_dashboard "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/layout.tsx"
click node_project_page "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/projects/page.tsx"
click node_project_form "https://github.com/karimsamer19/cms-portfolio/blob/main/src/components/ProjectForm.tsx"
click node_project_store "https://github.com/karimsamer19/cms-portfolio/blob/main/src/store/projectsStore.ts"
click node_skill_page "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/page.tsx"
click node_skill_manage "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/SkillsMangement.tsx"
click node_skill_form "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/SkillForm.tsx"
click node_skill_state "https://github.com/karimsamer19/cms-portfolio/blob/main/src/store/skillsStore.ts"
click node_skill_actions "https://github.com/karimsamer19/cms-portfolio/blob/main/src/actions/skills.ts"
click node_category_manage "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/CategoriesMangement.tsx"
click node_category_form "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/CategoryForm.tsx"
click node_category_actions "https://github.com/karimsamer19/cms-portfolio/blob/main/src/actions/categories.ts"
click node_settings_page "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/page.tsx"
click node_profile_form "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/components/ProfileForm.tsx"
click node_preferences "https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/components/DashboardPreferences.tsx"

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_routes,node_guard,node_dashboard,node_admin toneBlue
class node_project_page,node_project_form,node_project_store,node_supabase,node_storage toneAmber
class node_skill_page,node_skill_manage,node_skill_form,node_skill_state,node_skill_actions,node_category_manage,node_category_form,node_category_actions toneMint
class node_settings_page,node_profile_form,node_preferences toneRose
class node_clerk toneIndigo
```

## Components

### Access and dashboard

- [Route entry](https://github.com/karimsamer19/cms-portfolio/blob/main/app/page.tsx): `app/page.tsx`
- [Route protection](https://github.com/karimsamer19/cms-portfolio/blob/main/proxy.ts): `proxy.ts`
- [Dashboard shell](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/layout.tsx): `app/dashboard/layout.tsx`

### Project management

- [Projects page](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/projects/page.tsx): `app/dashboard/projects/page.tsx`
- [Project editor](https://github.com/karimsamer19/cms-portfolio/blob/main/src/components/ProjectForm.tsx): `src/components/ProjectForm.tsx`
- [Project state and CRUD](https://github.com/karimsamer19/cms-portfolio/blob/main/src/store/projectsStore.ts): `src/store/projectsStore.ts`

### Skills and categories

- [Skills page](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/page.tsx): `app/dashboard/skills/page.tsx`
- [Skill management](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/SkillsMangement.tsx): `app/dashboard/skills/components/SkillsMangement.tsx`
- [Skill editor](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/SkillForm.tsx): `app/dashboard/skills/components/SkillForm.tsx`
- [Skill state](https://github.com/karimsamer19/cms-portfolio/blob/main/src/store/skillsStore.ts): `src/store/skillsStore.ts`
- [Skill mutations and upload](https://github.com/karimsamer19/cms-portfolio/blob/main/src/actions/skills.ts): `src/actions/skills.ts`
- [Category management](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/CategoriesMangement.tsx): `app/dashboard/skills/components/CategoriesMangement.tsx`
- [Category editor](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/skills/components/CategoryForm.tsx): `app/dashboard/skills/components/CategoryForm.tsx`
- [Category mutations](https://github.com/karimsamer19/cms-portfolio/blob/main/src/actions/categories.ts): `src/actions/categories.ts`

### Profile settings

- [Settings page](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/page.tsx): `app/dashboard/settings/page.tsx`
- [Profile editor](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/components/ProfileForm.tsx): `app/dashboard/settings/components/ProfileForm.tsx`
- [Dashboard preferences](https://github.com/karimsamer19/cms-portfolio/blob/main/app/dashboard/settings/components/DashboardPreferences.tsx): `app/dashboard/settings/components/DashboardPreferences.tsx`

### Other components

- **Admin user**
- **Clerk auth**
- **Supabase database**
- **Supabase image buckets**

## Connections

- Admin user → Route entry: opens app (evidence: `README.md`)
- Route entry → Clerk auth: checks session (evidence: `README.md`)
- Route entry → Dashboard shell: redirects signed-in (evidence: `README.md`)
- Admin user → Route protection: requests route (evidence: `README.md`)
- Route protection → Clerk auth: checks role (evidence: `README.md`)
- Route protection → Dashboard shell: protects routes (evidence: `README.md`)
- Dashboard shell → Projects page: renders section
- Dashboard shell → Skills page: renders section
- Dashboard shell → Settings page: renders section
- Admin user → Projects page: manages projects (evidence: `README.md`)
- Projects page → Project state and CRUD: fetches and deletes (evidence: `app/dashboard/projects/page.tsx`)
- Projects page → Project editor: renders editor (evidence: `app/dashboard/projects/page.tsx`)
- Project state and CRUD → Supabase database: reads and writes (evidence: `src/store/projectsStore.ts`)
- Project state and CRUD → Supabase image buckets: uploads thumbnails (evidence: `src/store/projectsStore.ts`)
- Admin user → Skills page: manages skills (evidence: `README.md`)
- Skills page → Skill management: renders manager (evidence: `app/dashboard/skills/page.tsx`)
- Skills page → Category management: renders manager (evidence: `app/dashboard/skills/page.tsx`)
- Skill management → Skill state: loads skill state (evidence: `src/store/skillsStore.ts`)
- Skill management → Skill editor: renders editor (evidence: `app/dashboard/skills/components/SkillsMangement.tsx`)
- Skill state → Supabase database: reads skills (evidence: `src/store/skillsStore.ts`)
- Skill state → Skill mutations and upload: dispatches mutations (evidence: `src/store/skillsStore.ts`)
- Skill mutations and upload → Supabase database: mutates skills (evidence: `src/actions/skills.ts`)
- Skill mutations and upload → Supabase image buckets: uploads skill icons (evidence: `src/actions/skills.ts`)
- Category management → Category editor: renders editor (evidence: `app/dashboard/skills/components/CategoriesMangement.tsx`)
- Admin user → Settings page: adjusts settings (evidence: `README.md`)
- Settings page → Profile editor: renders profile form (evidence: `app/dashboard/settings/page.tsx`)
- Settings page → Dashboard preferences: renders preferences (evidence: `app/dashboard/settings/page.tsx`)
- Profile editor → Supabase database: persists profile (evidence: `README.md`)
- Category mutations → Supabase database: mutates categories (evidence: `README.md`)
