# artsea-project/artsea-webapp architecture

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

- Interactive diagram: https://gitdiagram.com/artsea-project/artsea-webapp
- Repository: https://github.com/artsea-project/artsea-webapp

## Overview

This repository implements a portfolio site with an admin area for managing works, categories, appearance, and profile. The public workflow loads configured artwork for a responsive Bento portfolio, serves individual work pages, and exposes artwork media through a validated media route. Theme settings are resolved at the app root. The admin pages are represented from the tree; their implementations were not sampled, so their data operations and internal flows are not inferred.

Main entry points: [`db/schema.ts`](https://github.com/artsea-project/artsea-webapp/blob/main/db/schema.ts) (Portfolio database), [`app/(public)/layout.tsx`](https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/layout.tsx) (Public layout), [`app/(public)/page.tsx`](https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/page.tsx) (Portfolio home), [`components/AdminSidebar.tsx`](https://github.com/artsea-project/artsea-webapp/blob/main/components/AdminSidebar.tsx) (Admin sidebar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public portfolio"]
  node_public_layout["Public layout<br/>[layout.tsx]"]
  node_site_header["Site header<br/>[Header.tsx]"]
  node_nav_links["Navigation links<br/>[NavLinks.tsx]"]
  node_site_footer["Site footer<br/>[Footer.tsx]"]
  node_home_page["Portfolio home<br/>[page.tsx]"]
  node_bento_view["Bento grid<br/>[bento-box.tsx]"]
  node_bento_card["Artwork card<br/>[bento-card.tsx]"]
  node_work_page["Work detail<br/>[page.tsx]"]
end

subgraph group_admin["Admin area"]
  node_admin_layout["Admin layout<br/>[layout.tsx]"]
  node_admin_sidebar["Admin sidebar<br/>[AdminSidebar.tsx]"]
  node_admin_nav["Admin navigation"]
  node_admin_routes["Admin route map<br/>[admin-routes.ts]"]
  node_admin_actions["Admin actions<br/>[actions.ts]"]
  node_admin_overview["Overview page<br/>[page.tsx]"]
  node_admin_works["Works management<br/>[page.tsx]"]
  node_admin_categories["Category management<br/>[page.tsx]"]
  node_admin_appearance["Appearance settings<br/>[page.tsx]"]
  node_admin_profile["Profile settings<br/>[page.tsx]"]
end

subgraph group_content["Content and media"]
  node_bento_data["Bento data loader<br/>[bento.ts]"]
  node_bento_layout["Layout normalizer<br/>[bento-layout.ts]"]
  node_media_route["Media delivery<br/>[route.ts]"]
  node_media_helpers["Media helpers<br/>[media.ts]"]
  node_database[("Portfolio database<br/>[schema.ts]")]
end

subgraph group_theme["Theme rendering"]
  node_root_layout["Application root<br/>[layout.tsx]"]
  node_theme_loader["Theme settings loader<br/>[get-site-theme.ts]"]
  node_font_resolver["Font resolver<br/>[fonts.ts]"]
end

node_visitor(("Portfolio visitor"))
node_admin_user(("Admin user"))

node_visitor -->|"opens site"| node_public_layout
node_public_layout -->|"renders"| node_site_header
node_public_layout -->|"renders"| node_site_footer
node_site_header -->|"renders"| node_nav_links
node_visitor -->|"opens portfolio"| node_home_page
node_home_page -->|"loads artwork"| node_bento_data
node_home_page -->|"renders grid"| node_bento_view
node_bento_data -->|"queries artwork"| node_database
node_bento_data -->|"normalizes layout"| node_bento_layout
node_bento_view -->|"renders cards"| node_bento_card
node_visitor -->|"opens work"| node_work_page
node_work_page -->|"loads details"| node_database
node_visitor -->|"requests media"| node_media_route
node_media_route -->|"reads media"| node_database
node_media_route -->|"validates and serves"| node_media_helpers
node_admin_user -->|"opens admin"| node_admin_layout
node_admin_layout -->|"renders"| node_admin_sidebar
node_admin_sidebar -->|"renders"| node_admin_nav
node_admin_sidebar -->|"queries"| node_database
node_admin_nav -->|"uses routes"| node_admin_routes
node_admin_nav -->|"invokes"| node_admin_actions
node_admin_user -->|"visits"| node_admin_overview
node_admin_user -->|"manages works"| node_admin_works
node_admin_user -->|"manages categories"| node_admin_categories
node_admin_user -->|"sets appearance"| node_admin_appearance
node_admin_user -->|"edits profile"| node_admin_profile
node_root_layout -->|"loads theme"| node_theme_loader
node_root_layout -->|"resolves fonts"| node_font_resolver
node_theme_loader -->|"reads settings"| node_database

click node_public_layout "https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/layout.tsx"
click node_site_header "https://github.com/artsea-project/artsea-webapp/blob/main/components/Header.tsx"
click node_nav_links "https://github.com/artsea-project/artsea-webapp/blob/main/components/NavLinks.tsx"
click node_site_footer "https://github.com/artsea-project/artsea-webapp/blob/main/components/Footer.tsx"
click node_home_page "https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/page.tsx"
click node_bento_data "https://github.com/artsea-project/artsea-webapp/blob/main/lib/bento.ts"
click node_bento_layout "https://github.com/artsea-project/artsea-webapp/blob/main/lib/bento-layout.ts"
click node_bento_view "https://github.com/artsea-project/artsea-webapp/blob/main/components/bento/bento-box.tsx"
click node_bento_card "https://github.com/artsea-project/artsea-webapp/blob/main/components/bento/bento-card.tsx"
click node_work_page "https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/work/%5Bid%5D/page.tsx"
click node_media_route "https://github.com/artsea-project/artsea-webapp/blob/main/app/media/%5BmediaId%5D/route.ts"
click node_media_helpers "https://github.com/artsea-project/artsea-webapp/blob/main/lib/media.ts"
click node_database "https://github.com/artsea-project/artsea-webapp/blob/main/db/schema.ts"
click node_admin_layout "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/layout.tsx"
click node_admin_sidebar "https://github.com/artsea-project/artsea-webapp/blob/main/components/AdminSidebar.tsx"
click node_admin_nav "https://github.com/artsea-project/artsea-webapp/blob/main/components/AdminSidebarNav.tsx"
click node_admin_routes "https://github.com/artsea-project/artsea-webapp/blob/main/lib/admin-routes.ts"
click node_admin_actions "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/actions.ts"
click node_admin_overview "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/page.tsx"
click node_admin_works "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/works/page.tsx"
click node_admin_categories "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/categories/page.tsx"
click node_admin_appearance "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/appearance/page.tsx"
click node_admin_profile "https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/profile/page.tsx"
click node_root_layout "https://github.com/artsea-project/artsea-webapp/blob/main/app/layout.tsx"
click node_theme_loader "https://github.com/artsea-project/artsea-webapp/blob/main/lib/theme/get-site-theme.ts"
click node_font_resolver "https://github.com/artsea-project/artsea-webapp/blob/main/lib/theme/fonts.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_public_layout,node_site_header,node_nav_links,node_site_footer,node_home_page,node_bento_view,node_bento_card,node_work_page,node_admin_user toneBlue
class node_admin_layout,node_admin_sidebar,node_admin_nav,node_admin_routes,node_admin_actions,node_admin_overview,node_admin_works,node_admin_categories,node_admin_appearance,node_admin_profile toneAmber
class node_bento_data,node_bento_layout,node_media_route,node_media_helpers,node_database toneMint
class node_root_layout,node_theme_loader,node_font_resolver toneRose
class node_visitor toneIndigo
```

## Components

### Public portfolio

- [Public layout](https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/layout.tsx): `app/(public)/layout.tsx`
- [Site header](https://github.com/artsea-project/artsea-webapp/blob/main/components/Header.tsx): `components/Header.tsx`
- [Navigation links](https://github.com/artsea-project/artsea-webapp/blob/main/components/NavLinks.tsx): `components/NavLinks.tsx`
- [Site footer](https://github.com/artsea-project/artsea-webapp/blob/main/components/Footer.tsx): `components/Footer.tsx`
- [Portfolio home](https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/page.tsx): `app/(public)/page.tsx`
- [Bento grid](https://github.com/artsea-project/artsea-webapp/blob/main/components/bento/bento-box.tsx): `components/bento/bento-box.tsx`
- [Artwork card](https://github.com/artsea-project/artsea-webapp/blob/main/components/bento/bento-card.tsx): `components/bento/bento-card.tsx`
- [Work detail](https://github.com/artsea-project/artsea-webapp/blob/main/app/(public)/work/%5Bid%5D/page.tsx): `app/(public)/work/[id]/page.tsx`

### Admin area

- [Admin layout](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/layout.tsx): `app/admin/layout.tsx`
- [Admin sidebar](https://github.com/artsea-project/artsea-webapp/blob/main/components/AdminSidebar.tsx): `components/AdminSidebar.tsx`
- [Admin navigation](https://github.com/artsea-project/artsea-webapp/blob/main/components/AdminSidebarNav.tsx): `components/AdminSidebarNav.tsx`
- [Admin route map](https://github.com/artsea-project/artsea-webapp/blob/main/lib/admin-routes.ts): `lib/admin-routes.ts`
- [Admin actions](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/actions.ts): `app/admin/actions.ts`
- [Overview page](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Works management](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/works/page.tsx): `app/admin/works/page.tsx`
- [Category management](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/categories/page.tsx): `app/admin/categories/page.tsx`
- [Appearance settings](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/appearance/page.tsx): `app/admin/appearance/page.tsx`
- [Profile settings](https://github.com/artsea-project/artsea-webapp/blob/main/app/admin/profile/page.tsx): `app/admin/profile/page.tsx`

### Content and media

- [Bento data loader](https://github.com/artsea-project/artsea-webapp/blob/main/lib/bento.ts): `lib/bento.ts`
- [Layout normalizer](https://github.com/artsea-project/artsea-webapp/blob/main/lib/bento-layout.ts): `lib/bento-layout.ts`
- [Media delivery](https://github.com/artsea-project/artsea-webapp/blob/main/app/media/%5BmediaId%5D/route.ts): `app/media/[mediaId]/route.ts`
- [Media helpers](https://github.com/artsea-project/artsea-webapp/blob/main/lib/media.ts): `lib/media.ts`
- [Portfolio database](https://github.com/artsea-project/artsea-webapp/blob/main/db/schema.ts): `db/schema.ts`

### Theme rendering

- [Application root](https://github.com/artsea-project/artsea-webapp/blob/main/app/layout.tsx): `app/layout.tsx`
- [Theme settings loader](https://github.com/artsea-project/artsea-webapp/blob/main/lib/theme/get-site-theme.ts): `lib/theme/get-site-theme.ts`
- [Font resolver](https://github.com/artsea-project/artsea-webapp/blob/main/lib/theme/fonts.ts): `lib/theme/fonts.ts`

### Other components

- **Portfolio visitor**
- **Admin user**

## Connections

- Portfolio visitor → Public layout: opens site (evidence: `app/(public)/layout.tsx`)
- Public layout → Site header: renders (evidence: `app/(public)/layout.tsx`)
- Public layout → Site footer: renders (evidence: `app/(public)/layout.tsx`)
- Site header → Navigation links: renders (evidence: `components/Header.tsx`)
- Portfolio visitor → Portfolio home: opens portfolio (evidence: `app/(public)/page.tsx`)
- Portfolio home → Bento data loader: loads artwork (evidence: `app/(public)/page.tsx`)
- Portfolio home → Bento grid: renders grid (evidence: `app/(public)/page.tsx`)
- Bento data loader → Portfolio database: queries artwork (evidence: `lib/bento.ts`)
- Bento data loader → Layout normalizer: normalizes layout (evidence: `lib/bento.ts`)
- Bento grid → Artwork card: renders cards (evidence: `components/bento/bento-box.tsx`)
- Portfolio visitor → Work detail: opens work (evidence: `app/(public)/work/[id]/page.tsx`)
- Work detail → Portfolio database: loads details (evidence: `app/(public)/work/[id]/page.tsx`)
- Portfolio visitor → Media delivery: requests media (evidence: `app/media/[mediaId]/route.ts`)
- Media delivery → Portfolio database: reads media (evidence: `app/media/[mediaId]/route.ts`)
- Media delivery → Media helpers: validates and serves (evidence: `app/media/[mediaId]/route.ts`)
- Admin user → Admin layout: opens admin (evidence: `app/admin/layout.tsx`)
- Admin layout → Admin sidebar: renders (evidence: `app/admin/layout.tsx`)
- Admin sidebar → Admin navigation: renders (evidence: `components/AdminSidebar.tsx`)
- Admin sidebar → Portfolio database: queries (evidence: `components/AdminSidebar.tsx`)
- Admin navigation → Admin route map: uses routes (evidence: `components/AdminSidebarNav.tsx`)
- Admin navigation → Admin actions: invokes (evidence: `components/AdminSidebarNav.tsx`)
- Admin user → Overview page: visits (evidence: `app/admin/page.tsx`)
- Admin user → Works management: manages works (evidence: `app/admin/works/page.tsx`)
- Admin user → Category management: manages categories (evidence: `app/admin/categories/page.tsx`)
- Admin user → Appearance settings: sets appearance (evidence: `app/admin/appearance/page.tsx`)
- Admin user → Profile settings: edits profile (evidence: `app/admin/profile/page.tsx`)
- Application root → Theme settings loader: loads theme (evidence: `app/layout.tsx`)
- Application root → Font resolver: resolves fonts (evidence: `app/layout.tsx`)
- Theme settings loader → Portfolio database: reads settings (evidence: `lib/theme/get-site-theme.ts`)
