# dennis-1am/project-lam-fam-business architecture

> Architecture diagram of the GitHub repository dennis-1am/project-lam-fam-business, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dennis-1am/project-lam-fam-business
- Repository: https://github.com/dennis-1am/project-lam-fam-business
- Video tour (about a minute): https://gitdiagram.com/dennis-1am/project-lam-fam-business/video

## Overview

Family Business Catalog is a multilingual product-showcase site: visitors browse and filter listings, open image galleries, and switch stored translations; there is no cart or checkout. Owners authenticate, then create, edit, hide, or delete listings with prices, tags, translations, and multiple cropped images. The graph connects documented pages to the server actions and APIs they use, plus the sampled persistence, upload, session, and translation layers. Page/action internals beyond the excerpts are represented only where README capabilities support them; uncertain wiring is omitted.

Main entry points: [`lib/db.ts`](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/db.ts) (Catalog database), [`app/actions.ts`](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/actions.ts) (Product actions), [`components/product-form.tsx`](https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/product-form.tsx) (Listing editor), [`app/page.tsx`](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/page.tsx) (Catalog feed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer catalog"]
  node_home["Catalog feed<br/>[page.tsx]"]
  node_listing["Product detail<br/>[page.tsx]"]
  node_tagfilter["Tag browsing<br/>[tag-filter.tsx]"]
  node_language["Language switch"]
  node_layout["Site shell<br/>[layout.tsx]"]
end

subgraph group_admin["Owner management"]
  node_adminlist["Product management<br/>[page.tsx]"]
  node_newproduct["Create listing<br/>[page.tsx]"]
  node_editproduct["Edit listing<br/>[page.tsx]"]
  node_productform["Listing editor<br/>[product-form.tsx]"]
  node_loginpage["Admin login<br/>[page.tsx]"]
end

subgraph group_services["Application services"]
  node_actions["Product actions<br/>[actions.ts]"]
  node_tagactions["Tag actions<br/>[tag-actions.ts]"]
  node_authapi["Session endpoints<br/>[route.ts]"]
  node_uploadapi["Upload endpoint<br/>[route.ts]"]
  node_imageapi["Image serving<br/>[route.ts]"]
  node_tagsapi["Tag endpoint<br/>[route.ts]"]
  node_translation["Auto translation<br/>[translate.ts]"]
  node_auth["Session auth<br/>[auth.ts]"]
  node_languagecontext["Language state"]
end

subgraph group_state["Persistence and media"]
  node_database[("Catalog database<br/>[db.ts]")]
  node_storage[("Image storage<br/>[storage.ts]")]
end

node_visitor(("Visitor"))
node_owner(("Catalog owner"))
node_translateprovider{{"Google Translate"}}

node_visitor -->|"browses"| node_home
node_home -->|"opens listing"| node_listing
node_home -->|"filters by tag"| node_tagfilter
node_tagfilter -->|"loads tags"| node_tagsapi
node_tagsapi -->|"reads tags"| node_database
node_visitor -->|"selects language"| node_language
node_language -->|"sets preference"| node_languagecontext
node_layout -->|"provides context"| node_languagecontext
node_home -->|"reads products"| node_database
node_listing -->|"reads listing"| node_database
node_listing -->|"requests images"| node_imageapi
node_owner -->|"signs in"| node_loginpage
node_loginpage -->|"submits credentials"| node_authapi
node_authapi -->|"verifies and creates session"| node_auth
node_owner -->|"manages listings"| node_adminlist
node_adminlist -->|"reads products"| node_database
node_owner -->|"creates listing"| node_newproduct
node_newproduct -->|"renders editor"| node_productform
node_owner -->|"edits listing"| node_editproduct
node_editproduct -->|"renders editor"| node_productform
node_productform -->|"uploads images"| node_uploadapi
node_uploadapi -->|"checks session"| node_auth
node_uploadapi -->|"saves files"| node_storage
node_imageapi -->|"reads files"| node_storage
node_productform -->|"submits listing"| node_actions
node_actions -->|"requires admin"| node_auth
node_actions -->|"writes listings"| node_database
node_actions -->|"deletes unused files"| node_storage
node_actions -->|"translates changed fields"| node_translation
node_translation -->|"stores translations"| node_database
node_translation -.->|"requests translations"| node_translateprovider
node_productform -->|"manages tags"| node_tagactions
node_tagactions -->|"writes tags"| node_database

click node_home "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/page.tsx"
click node_listing "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/product/%5Bid%5D/page.tsx"
click node_tagfilter "https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/tag-filter.tsx"
click node_language "https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/language-selector.tsx"
click node_layout "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/layout.tsx"
click node_adminlist "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/page.tsx"
click node_newproduct "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/new/page.tsx"
click node_editproduct "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/%5Bid%5D/edit/page.tsx"
click node_productform "https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/product-form.tsx"
click node_loginpage "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/login/page.tsx"
click node_actions "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/actions.ts"
click node_tagactions "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/tag-actions.ts"
click node_authapi "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/auth/login/route.ts"
click node_uploadapi "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/upload/route.ts"
click node_imageapi "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/images/%5Bname%5D/route.ts"
click node_tagsapi "https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/tags/route.ts"
click node_translation "https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/translate.ts"
click node_auth "https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/auth.ts"
click node_languagecontext "https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/language-context.tsx"
click node_database "https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/db.ts"
click node_storage "https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/storage.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_listing,node_tagfilter,node_language,node_layout toneBlue
class node_adminlist,node_newproduct,node_editproduct,node_productform,node_loginpage toneAmber
class node_actions,node_tagactions,node_authapi,node_uploadapi,node_imageapi,node_tagsapi,node_translation,node_auth,node_languagecontext toneMint
class node_database,node_storage toneRose
class node_visitor,node_owner,node_translateprovider toneIndigo
```

## Components

### Customer catalog

- [Catalog feed](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/page.tsx): `app/page.tsx`
- [Product detail](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/product/%5Bid%5D/page.tsx): `app/product/[id]/page.tsx`
- [Tag browsing](https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/tag-filter.tsx): `components/tag-filter.tsx`
- [Language switch](https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/language-selector.tsx): `components/language-selector.tsx`
- [Site shell](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/layout.tsx): `app/layout.tsx`

### Owner management

- [Product management](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/page.tsx): `app/admin/page.tsx`
- [Create listing](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/new/page.tsx): `app/admin/new/page.tsx`
- [Edit listing](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/%5Bid%5D/edit/page.tsx): `app/admin/[id]/edit/page.tsx`
- [Listing editor](https://github.com/dennis-1am/project-lam-fam-business/blob/master/components/product-form.tsx): `components/product-form.tsx`
- [Admin login](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/admin/login/page.tsx): `app/admin/login/page.tsx`

### Application services

- [Product actions](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/actions.ts): `app/actions.ts`
- [Tag actions](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/tag-actions.ts): `app/tag-actions.ts`
- [Session endpoints](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Upload endpoint](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/upload/route.ts): `app/api/upload/route.ts`
- [Image serving](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/images/%5Bname%5D/route.ts): `app/api/images/[name]/route.ts`
- [Tag endpoint](https://github.com/dennis-1am/project-lam-fam-business/blob/master/app/api/tags/route.ts): `app/api/tags/route.ts`
- [Auto translation](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/translate.ts): `lib/translate.ts`
- [Session auth](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/auth.ts): `lib/auth.ts`
- [Language state](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/language-context.tsx): `lib/language-context.tsx`

### Persistence and media

- [Catalog database](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/db.ts): `lib/db.ts`
- [Image storage](https://github.com/dennis-1am/project-lam-fam-business/blob/master/lib/storage.ts): `lib/storage.ts`

### Other components

- **Visitor**
- **Catalog owner**
- **Google Translate**

## Connections

- Visitor → Catalog feed: browses
- Catalog feed → Product detail: opens listing
- Catalog feed → Tag browsing: filters by tag
- Tag browsing → Tag endpoint: loads tags
- Tag endpoint → Catalog database: reads tags
- Visitor → Language switch: selects language
- Language switch → Language state: sets preference
- Site shell → Language state: provides context
- Catalog feed → Catalog database: reads products
- Product detail → Catalog database: reads listing
- Product detail → Image serving: requests images
- Catalog owner → Admin login: signs in
- Admin login → Session endpoints: submits credentials
- Session endpoints → Session auth: verifies and creates session
- Catalog owner → Product management: manages listings
- Product management → Catalog database: reads products
- Catalog owner → Create listing: creates listing
- Create listing → Listing editor: renders editor
- Catalog owner → Edit listing: edits listing
- Edit listing → Listing editor: renders editor
- Listing editor → Upload endpoint: uploads images
- Upload endpoint → Session auth: checks session
- Upload endpoint → Image storage: saves files
- Image serving → Image storage: reads files
- Listing editor → Product actions: submits listing
- Product actions → Session auth: requires admin
- Product actions → Catalog database: writes listings
- Product actions → Image storage: deletes unused files
- Product actions → Auto translation: translates changed fields
- Auto translation → Catalog database: stores translations
- Auto translation → Google Translate: requests translations
- Listing editor → Tag actions: manages tags
- Tag actions → Catalog database: writes tags
