# basbyte/swiftyshop architecture

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

- Interactive diagram: https://gitdiagram.com/basbyte/swiftyshop
- Repository: https://github.com/basbyte/swiftyshop

## Overview

SwiftyShop is an electronics storefront with customer accounts, product discovery, checkout and order tracking, plus staff-facing inventory, order and user administration. The main customer path runs from the storefront or product catalogue to a product detail page, checkout submission, and later order tracking. Server actions coordinate account and order mutations with authentication and the database; admin pages provide separate management views. The graph follows the supplied import references and excerpts; unsampled implementation details and undocumented integrations are omitted.

Main entry points: [`src/lib/prisma.ts`](https://github.com/basbyte/swiftyshop/blob/main/src/lib/prisma.ts) (Prisma Client), [`src/app/actions.ts`](https://github.com/basbyte/swiftyshop/blob/main/src/app/actions.ts) (Server Actions), [`src/app/products/page.tsx`](https://github.com/basbyte/swiftyshop/blob/main/src/app/products/page.tsx) (Product Catalogue), [`src/app/page.tsx`](https://github.com/basbyte/swiftyshop/blob/main/src/app/page.tsx) (Home and Featured)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Storefront"]
  node_home["Home and Featured<br/>[page.tsx]"]
  node_catalog["Product Catalogue<br/>[page.tsx]"]
  node_filters["Catalogue Filters<br/>[ProductFilters.tsx]"]
  node_product["Product Detail<br/>[page.tsx]"]
  node_checkout["Checkout Form<br/>[CheckoutForm.tsx]"]
  node_navbar["Store Navigation<br/>[NavbarClient.tsx]"]
end

subgraph group_accounts["Accounts and Orders"]
  node_registration["Registration<br/>[page.tsx]"]
  node_login["Login<br/>[page.tsx]"]
  node_customerorders["Customer Orders<br/>[page.tsx]"]
  node_actions["Server Actions<br/>[actions.ts]"]
end

subgraph group_admin["Administration"]
  node_adminhome["Admin Dashboard<br/>[page.tsx]"]
  node_adminorders["Order Management<br/>[page.tsx]"]
  node_ordertable["Orders Table<br/>[OrderTable.tsx]"]
  node_productadmin["Product Management<br/>[page.tsx]"]
  node_producttable["Products Table<br/>[ProductTable.tsx]"]
  node_useradmin["User Management<br/>[page.tsx]"]
  node_usertable["Users Table<br/>[UserTable.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_auth["Session and JWT Auth<br/>[auth.ts]"]
  node_database[("Application Database<br/>[schema.prisma]")]
  node_prismaclient["Prisma Client<br/>[prisma.ts]"]
  node_language["Language Selection<br/>[getLanguage.ts]"]
  node_dictionary["Translations<br/>[dictionaries.ts]"]
  node_languageaction["Language Preference Action<br/>[setLanguage.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_home
node_shopper -->|"searches products"| node_catalog
node_shopper -->|"registers"| node_registration
node_shopper -->|"signs in"| node_login
node_shopper -->|"views orders"| node_customerorders
node_home -->|"queries products"| node_prismaclient
node_home -->|"reads locale"| node_language
node_home -->|"uses translations"| node_dictionary
node_catalog -->|"queries products"| node_prismaclient
node_catalog -->|"renders filters"| node_filters
node_catalog -->|"reads locale"| node_language
node_catalog -->|"uses translations"| node_dictionary
node_product -->|"loads product"| node_prismaclient
node_product -->|"renders checkout"| node_checkout
node_checkout -->|"submits order"| node_actions
node_registration -->|"registers account"| node_actions
node_login -->|"submits credentials"| node_actions
node_customerorders -->|"checks session"| node_auth
node_customerorders -->|"loads orders"| node_prismaclient
node_actions -->|"manages sessions"| node_auth
node_actions -->|"mutates records"| node_prismaclient
node_adminhome -->|"loads metrics"| node_prismaclient
node_adminorders -->|"loads order"| node_prismaclient
node_adminorders -->|"checks session"| node_auth
node_adminorders -.->|"renders controls"| node_ordertable
node_productadmin -->|"loads products"| node_prismaclient
node_productadmin -->|"renders table"| node_producttable
node_producttable -->|"manages products"| node_actions
node_useradmin -->|"loads users"| node_prismaclient
node_useradmin -->|"renders table"| node_usertable
node_useradmin -->|"checks session"| node_auth
node_usertable -->|"manages users"| node_actions
node_ordertable -->|"manages orders"| node_actions
node_prismaclient -->|"connects to"| node_database
node_navbar -->|"offers language change"| node_languageaction

click node_home "https://github.com/basbyte/swiftyshop/blob/main/src/app/page.tsx"
click node_catalog "https://github.com/basbyte/swiftyshop/blob/main/src/app/products/page.tsx"
click node_filters "https://github.com/basbyte/swiftyshop/blob/main/src/components/ProductFilters.tsx"
click node_product "https://github.com/basbyte/swiftyshop/blob/main/src/app/product/%5Bid%5D/page.tsx"
click node_checkout "https://github.com/basbyte/swiftyshop/blob/main/src/components/CheckoutForm.tsx"
click node_registration "https://github.com/basbyte/swiftyshop/blob/main/src/app/register/page.tsx"
click node_login "https://github.com/basbyte/swiftyshop/blob/main/src/app/login/page.tsx"
click node_customerorders "https://github.com/basbyte/swiftyshop/blob/main/src/app/orders/page.tsx"
click node_actions "https://github.com/basbyte/swiftyshop/blob/main/src/app/actions.ts"
click node_adminhome "https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/page.tsx"
click node_adminorders "https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/orders/%5Bid%5D/page.tsx"
click node_ordertable "https://github.com/basbyte/swiftyshop/blob/main/src/components/OrderTable.tsx"
click node_productadmin "https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/products/page.tsx"
click node_producttable "https://github.com/basbyte/swiftyshop/blob/main/src/components/ProductTable.tsx"
click node_useradmin "https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/users/page.tsx"
click node_usertable "https://github.com/basbyte/swiftyshop/blob/main/src/components/UserTable.tsx"
click node_auth "https://github.com/basbyte/swiftyshop/blob/main/src/lib/auth.ts"
click node_database "https://github.com/basbyte/swiftyshop/blob/main/prisma/schema.prisma"
click node_prismaclient "https://github.com/basbyte/swiftyshop/blob/main/src/lib/prisma.ts"
click node_language "https://github.com/basbyte/swiftyshop/blob/main/src/lib/getLanguage.ts"
click node_dictionary "https://github.com/basbyte/swiftyshop/blob/main/src/lib/dictionaries.ts"
click node_languageaction "https://github.com/basbyte/swiftyshop/blob/main/src/actions/setLanguage.ts"
click node_navbar "https://github.com/basbyte/swiftyshop/blob/main/src/components/NavbarClient.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_home,node_catalog,node_filters,node_product,node_checkout,node_navbar toneBlue
class node_registration,node_login,node_customerorders,node_actions toneAmber
class node_adminhome,node_adminorders,node_ordertable,node_productadmin,node_producttable,node_useradmin,node_usertable toneMint
class node_auth,node_database,node_prismaclient,node_language,node_dictionary,node_languageaction toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Home and Featured](https://github.com/basbyte/swiftyshop/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Product Catalogue](https://github.com/basbyte/swiftyshop/blob/main/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Catalogue Filters](https://github.com/basbyte/swiftyshop/blob/main/src/components/ProductFilters.tsx): `src/components/ProductFilters.tsx`
- [Product Detail](https://github.com/basbyte/swiftyshop/blob/main/src/app/product/%5Bid%5D/page.tsx): `src/app/product/[id]/page.tsx`
- [Checkout Form](https://github.com/basbyte/swiftyshop/blob/main/src/components/CheckoutForm.tsx): `src/components/CheckoutForm.tsx`
- [Store Navigation](https://github.com/basbyte/swiftyshop/blob/main/src/components/NavbarClient.tsx): `src/components/NavbarClient.tsx`

### Accounts and Orders

- [Registration](https://github.com/basbyte/swiftyshop/blob/main/src/app/register/page.tsx): `src/app/register/page.tsx`
- [Login](https://github.com/basbyte/swiftyshop/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Customer Orders](https://github.com/basbyte/swiftyshop/blob/main/src/app/orders/page.tsx): `src/app/orders/page.tsx`
- [Server Actions](https://github.com/basbyte/swiftyshop/blob/main/src/app/actions.ts): `src/app/actions.ts`

### Administration

- [Admin Dashboard](https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Order Management](https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/orders/%5Bid%5D/page.tsx): `src/app/admin/orders/[id]/page.tsx`
- [Orders Table](https://github.com/basbyte/swiftyshop/blob/main/src/components/OrderTable.tsx): `src/components/OrderTable.tsx`
- [Product Management](https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/products/page.tsx): `src/app/admin/products/page.tsx`
- [Products Table](https://github.com/basbyte/swiftyshop/blob/main/src/components/ProductTable.tsx): `src/components/ProductTable.tsx`
- [User Management](https://github.com/basbyte/swiftyshop/blob/main/src/app/admin/users/page.tsx): `src/app/admin/users/page.tsx`
- [Users Table](https://github.com/basbyte/swiftyshop/blob/main/src/components/UserTable.tsx): `src/components/UserTable.tsx`

### Shared Services

- [Session and JWT Auth](https://github.com/basbyte/swiftyshop/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Application Database](https://github.com/basbyte/swiftyshop/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- [Prisma Client](https://github.com/basbyte/swiftyshop/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [Language Selection](https://github.com/basbyte/swiftyshop/blob/main/src/lib/getLanguage.ts): `src/lib/getLanguage.ts`
- [Translations](https://github.com/basbyte/swiftyshop/blob/main/src/lib/dictionaries.ts): `src/lib/dictionaries.ts`
- [Language Preference Action](https://github.com/basbyte/swiftyshop/blob/main/src/actions/setLanguage.ts): `src/actions/setLanguage.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Home and Featured: browses
- Shopper → Product Catalogue: searches products
- Shopper → Registration: registers
- Shopper → Login: signs in
- Shopper → Customer Orders: views orders
- Home and Featured → Prisma Client: queries products (evidence: `src/app/page.tsx`)
- Home and Featured → Language Selection: reads locale (evidence: `src/app/page.tsx`)
- Home and Featured → Translations: uses translations (evidence: `src/app/page.tsx`)
- Product Catalogue → Prisma Client: queries products (evidence: `src/app/products/page.tsx`)
- Product Catalogue → Catalogue Filters: renders filters (evidence: `src/app/products/page.tsx`)
- Product Catalogue → Language Selection: reads locale (evidence: `src/app/products/page.tsx`)
- Product Catalogue → Translations: uses translations (evidence: `src/app/products/page.tsx`)
- Product Detail → Prisma Client: loads product (evidence: `src/app/product/[id]/page.tsx`)
- Product Detail → Checkout Form: renders checkout (evidence: `src/app/product/[id]/page.tsx`)
- Checkout Form → Server Actions: submits order (evidence: `src/components/CheckoutForm.tsx`)
- Registration → Server Actions: registers account (evidence: `src/app/register/page.tsx`)
- Login → Server Actions: submits credentials (evidence: `src/app/login/page.tsx`)
- Customer Orders → Session and JWT Auth: checks session (evidence: `src/app/orders/page.tsx`)
- Customer Orders → Prisma Client: loads orders (evidence: `src/app/orders/page.tsx`)
- Server Actions → Session and JWT Auth: manages sessions (evidence: `src/app/actions.ts`)
- Server Actions → Prisma Client: mutates records (evidence: `src/app/actions.ts`)
- Admin Dashboard → Prisma Client: loads metrics (evidence: `src/app/admin/page.tsx`)
- Order Management → Prisma Client: loads order (evidence: `src/app/admin/orders/[id]/page.tsx`)
- Order Management → Session and JWT Auth: checks session (evidence: `src/app/admin/orders/[id]/page.tsx`)
- Order Management → Orders Table: renders controls
- Product Management → Prisma Client: loads products (evidence: `src/app/admin/products/page.tsx`)
- Product Management → Products Table: renders table (evidence: `src/app/admin/products/page.tsx`)
- Products Table → Server Actions: manages products (evidence: `src/components/ProductTable.tsx`)
- User Management → Prisma Client: loads users (evidence: `src/app/admin/users/page.tsx`)
- User Management → Users Table: renders table (evidence: `src/app/admin/users/page.tsx`)
- User Management → Session and JWT Auth: checks session (evidence: `src/app/admin/users/page.tsx`)
- Users Table → Server Actions: manages users (evidence: `src/components/UserTable.tsx`)
- Orders Table → Server Actions: manages orders (evidence: `src/components/OrderTable.tsx`)
- Prisma Client → Application Database: connects to (evidence: `src/lib/prisma.ts`)
- Store Navigation → Language Preference Action: offers language change (evidence: `src/components/NavbarClient.tsx`)
