# zepa-ui/zepa.design architecture

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

- Interactive diagram: https://gitdiagram.com/zepa-ui/zepa.design
- Repository: https://github.com/zepa-ui/zepa.design

## Overview

Zepa UI is a curated React/Next.js library and showcase for reusable UI components, motion systems, and immersive experiences. Developers browse and filter the catalogue, inspect a component’s preview and code, then copy or install it; category playgrounds offer additional interactive demos. Signed-in users can bookmark and like components, while view/install activity feeds statistics. Admin pages support catalogue and usage oversight, and separate landing and enterprise pages present the product. Relationships below follow the supplied excerpts, SOURCE INDEX references, and README; unsampled subsystems are represented at their supported directory paths.

Main entry points: [`lib/db/queries.ts`](https://github.com/zepa-ui/zepa.design/blob/main/lib/db/queries.ts) (Database queries), [`app/components/page.tsx`](https://github.com/zepa-ui/zepa.design/blob/main/app/components/page.tsx) (Browse and filter), [`app/playground/hero/page.tsx`](https://github.com/zepa-ui/zepa.design/blob/main/app/playground/hero/page.tsx) (Hero playground), [`lib/tmdb/server.ts`](https://github.com/zepa-ui/zepa.design/blob/main/lib/tmdb/server.ts) (TMDB poster service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalogue and demos"]
  node_catalogue["Component catalogue<br/>[items.ts]"]
  node_catalogue_index["Registry exports<br/>[index.ts]"]
  node_component_demos["Grid demos"]
  node_hero_demos["Hero demos"]
  node_other_demos["Motion and visual demos"]
  node_browse["Browse and filter<br/>[page.tsx]"]
  node_showcase["Component cards<br/>[showcase-grid.tsx]"]
  node_detail["Component detail<br/>[page.tsx]"]
  node_detail_client["Detail interactions"]
  node_playground["Hero playground<br/>[page.tsx]"]
  node_playground_demo["Demo renderer"]
  node_tmdb_route["Poster API<br/>[route.ts]"]
  node_tmdb_service["TMDB poster service<br/>[server.ts]"]
  node_tmdb_discover["Provider filters<br/>[discover.ts]"]
end

subgraph group_accounts["Accounts and activity"]
  node_stats_hook["Stats client"]
  node_stats_api["Stats service<br/>[api.ts]"]
  node_bookmarks_api["Bookmark API<br/>[route.ts]"]
  node_likes_api["Like API<br/>[route.ts]"]
  node_activity_routes["View and install APIs"]
  node_queries["Database queries<br/>[queries.ts]"]
  node_db_client["Database client<br/>[index.ts]"]
  node_db_schema["Application tables<br/>[schema.ts]"]
  node_clerk_webhook["User sync webhook<br/>[route.ts]"]
end

subgraph group_operations["Administration"]
  node_admin["Admin pages"]
  node_admin_auth["Admin authorization<br/>[admin.ts]"]
  node_dashboard["User dashboard"]
end

subgraph group_product["Product presentation"]
  node_enterprise["Enterprise page"]
  node_enterprise_data["Enterprise content data<br/>[data.ts]"]
  node_enterprise_services["Enterprise services<br/>[services.tsx]"]
end

node_developer(("Developer"))
node_browser(("Site visitor"))
node_clerk{{"Clerk"}}
node_neon[("Neon database")]
node_tmdb{{"TMDB"}}

node_developer -->|"browses"| node_browse
node_browse -->|"reads registry"| node_catalogue_index
node_browse -->|"renders items"| node_showcase
node_showcase -->|"shows catalogue"| node_catalogue
node_catalogue_index -->|"exports"| node_catalogue
node_catalogue -->|"indexes metadata"| node_component_demos
node_browser -->|"opens component"| node_detail
node_detail -->|"renders detail"| node_detail_client
node_detail_client -->|"tracks activity"| node_stats_hook
node_developer -->|"tries demos"| node_playground
node_playground -->|"selects local demo"| node_hero_demos
node_playground -->|"renders remote demo"| node_playground_demo
node_playground_demo -->|"renders examples"| node_other_demos
node_stats_hook -->|"sends events"| node_activity_routes
node_activity_routes -->|"records counts"| node_stats_api
node_stats_api -->|"updates stats"| node_queries
node_browser -->|"manages bookmarks"| node_bookmarks_api
node_bookmarks_api -->|"reads and writes"| node_queries
node_browser -->|"likes components"| node_likes_api
node_likes_api -->|"reads and writes"| node_queries
node_clerk -->|"authenticates"| node_bookmarks_api
node_clerk -->|"authenticates"| node_likes_api
node_clerk_webhook -->|"syncs users"| node_queries
node_queries -->|"queries through"| node_db_client
node_db_client -->|"configures schema"| node_db_schema
node_db_client -->|"connects to"| node_neon
node_admin -->|"checks access"| node_admin_auth
node_admin -->|"loads records"| node_queries
node_dashboard -->|"loads submissions"| node_queries
node_browser -->|"views services"| node_enterprise
node_enterprise -->|"renders sections"| node_enterprise_services
node_enterprise_services -->|"uses service data"| node_enterprise_data
node_browser -.->|"requests posters"| node_tmdb_route
node_tmdb_route -->|"fetches assets"| node_tmdb_service
node_tmdb_service -->|"uses provider filters"| node_tmdb_discover
node_tmdb_service -->|"requests poster data"| node_tmdb

click node_catalogue "https://github.com/zepa-ui/zepa.design/blob/main/content/registry/items.ts"
click node_catalogue_index "https://github.com/zepa-ui/zepa.design/blob/main/content/registry/index.ts"
click node_component_demos "https://github.com/zepa-ui/zepa.design/tree/main/content/registry/grid-sections"
click node_hero_demos "https://github.com/zepa-ui/zepa.design/tree/main/content/registry/hero-sections"
click node_other_demos "https://github.com/zepa-ui/zepa.design/tree/main/content/registry"
click node_browse "https://github.com/zepa-ui/zepa.design/blob/main/app/components/page.tsx"
click node_showcase "https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/showcase-grid.tsx"
click node_detail "https://github.com/zepa-ui/zepa.design/blob/main/app/components/%5Bslug%5D/page.tsx"
click node_detail_client "https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/component-detail-client.tsx"
click node_playground "https://github.com/zepa-ui/zepa.design/blob/main/app/playground/hero/page.tsx"
click node_playground_demo "https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/playground-demo.tsx"
click node_stats_hook "https://github.com/zepa-ui/zepa.design/blob/main/hooks/use-component-stats.ts"
click node_stats_api "https://github.com/zepa-ui/zepa.design/blob/main/lib/stats/api.ts"
click node_bookmarks_api "https://github.com/zepa-ui/zepa.design/blob/main/app/api/bookmarks/route.ts"
click node_likes_api "https://github.com/zepa-ui/zepa.design/blob/main/app/api/like/%5Bslug%5D/route.ts"
click node_activity_routes "https://github.com/zepa-ui/zepa.design/tree/main/app/api"
click node_queries "https://github.com/zepa-ui/zepa.design/blob/main/lib/db/queries.ts"
click node_db_client "https://github.com/zepa-ui/zepa.design/blob/main/lib/db/index.ts"
click node_db_schema "https://github.com/zepa-ui/zepa.design/blob/main/lib/db/schema.ts"
click node_clerk_webhook "https://github.com/zepa-ui/zepa.design/blob/main/app/api/webhooks/clerk/route.ts"
click node_tmdb_route "https://github.com/zepa-ui/zepa.design/blob/main/app/api/tmdb/posters/route.ts"
click node_tmdb_service "https://github.com/zepa-ui/zepa.design/blob/main/lib/tmdb/server.ts"
click node_tmdb_discover "https://github.com/zepa-ui/zepa.design/blob/main/lib/tmdb/discover.ts"
click node_admin "https://github.com/zepa-ui/zepa.design/tree/main/app/admin"
click node_admin_auth "https://github.com/zepa-ui/zepa.design/blob/main/lib/auth/admin.ts"
click node_dashboard "https://github.com/zepa-ui/zepa.design/tree/main/app/dashboard"
click node_enterprise "https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/enterprise-page.tsx"
click node_enterprise_data "https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/data.ts"
click node_enterprise_services "https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/services.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_catalogue,node_catalogue_index,node_component_demos,node_hero_demos,node_other_demos,node_browse,node_showcase,node_detail,node_detail_client,node_playground,node_playground_demo,node_tmdb_route,node_tmdb_service,node_tmdb_discover toneBlue
class node_stats_hook,node_stats_api,node_bookmarks_api,node_likes_api,node_activity_routes,node_queries,node_db_client,node_db_schema,node_clerk_webhook,node_neon toneAmber
class node_admin,node_admin_auth,node_dashboard toneMint
class node_enterprise,node_enterprise_data,node_enterprise_services toneRose
class node_developer,node_browser,node_clerk,node_tmdb toneIndigo
```

## Components

### Catalogue and demos

- [Component catalogue](https://github.com/zepa-ui/zepa.design/blob/main/content/registry/items.ts): `content/registry/items.ts`
- [Registry exports](https://github.com/zepa-ui/zepa.design/blob/main/content/registry/index.ts): `content/registry/index.ts`
- [Grid demos](https://github.com/zepa-ui/zepa.design/tree/main/content/registry/grid-sections): `content/registry/grid-sections`
- [Hero demos](https://github.com/zepa-ui/zepa.design/tree/main/content/registry/hero-sections): `content/registry/hero-sections`
- [Motion and visual demos](https://github.com/zepa-ui/zepa.design/tree/main/content/registry): `content/registry`
- [Browse and filter](https://github.com/zepa-ui/zepa.design/blob/main/app/components/page.tsx): `app/components/page.tsx`
- [Component cards](https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/showcase-grid.tsx): `components/showcase/showcase-grid.tsx`
- [Component detail](https://github.com/zepa-ui/zepa.design/blob/main/app/components/%5Bslug%5D/page.tsx): `app/components/[slug]/page.tsx`
- [Detail interactions](https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/component-detail-client.tsx): `components/showcase/component-detail-client.tsx`
- [Hero playground](https://github.com/zepa-ui/zepa.design/blob/main/app/playground/hero/page.tsx): `app/playground/hero/page.tsx`
- [Demo renderer](https://github.com/zepa-ui/zepa.design/blob/main/components/showcase/playground-demo.tsx): `components/showcase/playground-demo.tsx`
- [Poster API](https://github.com/zepa-ui/zepa.design/blob/main/app/api/tmdb/posters/route.ts): `app/api/tmdb/posters/route.ts`
- [TMDB poster service](https://github.com/zepa-ui/zepa.design/blob/main/lib/tmdb/server.ts): `lib/tmdb/server.ts`
- [Provider filters](https://github.com/zepa-ui/zepa.design/blob/main/lib/tmdb/discover.ts): `lib/tmdb/discover.ts`

### Accounts and activity

- [Stats client](https://github.com/zepa-ui/zepa.design/blob/main/hooks/use-component-stats.ts): `hooks/use-component-stats.ts`
- [Stats service](https://github.com/zepa-ui/zepa.design/blob/main/lib/stats/api.ts): `lib/stats/api.ts`
- [Bookmark API](https://github.com/zepa-ui/zepa.design/blob/main/app/api/bookmarks/route.ts): `app/api/bookmarks/route.ts`
- [Like API](https://github.com/zepa-ui/zepa.design/blob/main/app/api/like/%5Bslug%5D/route.ts): `app/api/like/[slug]/route.ts`
- [View and install APIs](https://github.com/zepa-ui/zepa.design/tree/main/app/api): `app/api`
- [Database queries](https://github.com/zepa-ui/zepa.design/blob/main/lib/db/queries.ts): `lib/db/queries.ts`
- [Database client](https://github.com/zepa-ui/zepa.design/blob/main/lib/db/index.ts): `lib/db/index.ts`
- [Application tables](https://github.com/zepa-ui/zepa.design/blob/main/lib/db/schema.ts): `lib/db/schema.ts`
- [User sync webhook](https://github.com/zepa-ui/zepa.design/blob/main/app/api/webhooks/clerk/route.ts): `app/api/webhooks/clerk/route.ts`

### Administration

- [Admin pages](https://github.com/zepa-ui/zepa.design/tree/main/app/admin): `app/admin`
- [Admin authorization](https://github.com/zepa-ui/zepa.design/blob/main/lib/auth/admin.ts): `lib/auth/admin.ts`
- [User dashboard](https://github.com/zepa-ui/zepa.design/tree/main/app/dashboard): `app/dashboard`

### Product presentation

- [Enterprise page](https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/enterprise-page.tsx): `components/enterprise/enterprise-page.tsx`
- [Enterprise content data](https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/data.ts): `components/enterprise/data.ts`
- [Enterprise services](https://github.com/zepa-ui/zepa.design/blob/main/components/enterprise/services.tsx): `components/enterprise/services.tsx`

### Other components

- **Developer**
- **Site visitor**
- **Clerk**
- **Neon database**
- **TMDB**

## Connections

- Developer → Browse and filter: browses (evidence: `README.md`)
- Browse and filter → Registry exports: reads registry (evidence: `app/components/page.tsx`)
- Browse and filter → Component cards: renders items (evidence: `app/components/page.tsx`)
- Component cards → Component catalogue: shows catalogue (evidence: `components/showcase/showcase-grid.tsx`)
- Registry exports → Component catalogue: exports
- Component catalogue → Grid demos: indexes metadata (evidence: `content/registry/items.ts`)
- Site visitor → Component detail: opens component (evidence: `app/components/[slug]/page.tsx`)
- Component detail → Detail interactions: renders detail (evidence: `app/components/[slug]/page.tsx`)
- Detail interactions → Stats client: tracks activity (evidence: `components/showcase/component-detail-client.tsx`)
- Developer → Hero playground: tries demos (evidence: `README.md`)
- Hero playground → Hero demos: selects local demo (evidence: `app/playground/hero/page.tsx`)
- Hero playground → Demo renderer: renders remote demo (evidence: `app/playground/hero/page.tsx`)
- Demo renderer → Motion and visual demos: renders examples (evidence: `components/showcase/playground-demo.tsx`)
- Stats client → View and install APIs: sends events (evidence: `hooks/use-component-stats.ts`)
- View and install APIs → Stats service: records counts (evidence: `app/api/view/[slug]/route.ts`)
- Stats service → Database queries: updates stats (evidence: `lib/stats/api.ts`)
- Site visitor → Bookmark API: manages bookmarks (evidence: `app/api/bookmarks/route.ts`)
- Bookmark API → Database queries: reads and writes (evidence: `app/api/bookmarks/route.ts`)
- Site visitor → Like API: likes components (evidence: `app/api/like/[slug]/route.ts`)
- Like API → Database queries: reads and writes (evidence: `app/api/like/[slug]/route.ts`)
- Clerk → Bookmark API: authenticates (evidence: `app/api/bookmarks/route.ts`)
- Clerk → Like API: authenticates (evidence: `app/api/like/[slug]/route.ts`)
- User sync webhook → Database queries: syncs users (evidence: `app/api/webhooks/clerk/route.ts`)
- Database queries → Database client: queries through (evidence: `lib/db/queries.ts`)
- Database client → Application tables: configures schema (evidence: `lib/db/index.ts`)
- Database client → Neon database: connects to (evidence: `lib/db/index.ts`)
- Admin pages → Admin authorization: checks access (evidence: `app/admin/page.tsx`)
- Admin pages → Database queries: loads records (evidence: `app/admin/page.tsx`)
- User dashboard → Database queries: loads submissions (evidence: `app/dashboard/submissions/page.tsx`)
- Site visitor → Enterprise page: views services
- Enterprise page → Enterprise services: renders sections (evidence: `components/enterprise/enterprise-page.tsx`)
- Enterprise services → Enterprise content data: uses service data (evidence: `components/enterprise/services.tsx`)
- Site visitor → Poster API: requests posters
- Poster API → TMDB poster service: fetches assets (evidence: `app/api/tmdb/posters/route.ts`)
- TMDB poster service → Provider filters: uses provider filters (evidence: `lib/tmdb/server.ts`)
- TMDB poster service → TMDB: requests poster data (evidence: `lib/tmdb/server.ts`)
