How dennis-1am/project-lam-fam-business works
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: db.ts Catalog database · actions.ts Product actions · product-form.tsx Listing editor · page.tsx Catalog feed
Components 24
Customer catalog
- Catalog feed
app/page.tsx - Product detail
app/product/[id]/page.tsx - Tag browsing
components/tag-filter.tsx - Language switch
components/language-selector.tsx - Site shell
app/layout.tsx
Owner management
- Product management
app/admin/page.tsx - Create listing
app/admin/new/page.tsx - Edit listing
app/admin/[id]/edit/page.tsx - Listing editor
components/product-form.tsx - Admin login
app/admin/login/page.tsx
Application services
- Product actions
app/actions.ts - Tag actions
app/tag-actions.ts - Session endpoints
app/api/auth/login/route.ts - Upload endpoint
app/api/upload/route.ts - Image serving
app/api/images/[name]/route.ts - Tag endpoint
app/api/tags/route.ts - Auto translation
lib/translate.ts - Session auth
lib/auth.ts - Language state
lib/language-context.tsx
Persistence and media
- Catalog database
lib/db.ts - Image storage
lib/storage.ts
Other components
- Visitor
- Catalog owner
- Google Translate
Connections 33
- 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