How basbyte/swiftyshop works
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: prisma.ts Prisma Client · actions.ts Server Actions · products/page.tsx Product Catalogue · app/page.tsx Home and Featured
Components 24
Storefront
- Home and Featured
src/app/page.tsx - Product Catalogue
src/app/products/page.tsx - Catalogue Filters
src/components/ProductFilters.tsx - Product Detail
src/app/product/[id]/page.tsx - Checkout Form
src/components/CheckoutForm.tsx - Store Navigation
src/components/NavbarClient.tsx
Accounts and Orders
- Registration
src/app/register/page.tsx - Login
src/app/login/page.tsx - Customer Orders
src/app/orders/page.tsx - Server Actions
src/app/actions.ts
Administration
- Admin Dashboard
src/app/admin/page.tsx - Order Management
src/app/admin/orders/[id]/page.tsx - Orders Table
src/components/OrderTable.tsx - Product Management
src/app/admin/products/page.tsx - Products Table
src/components/ProductTable.tsx - User Management
src/app/admin/users/page.tsx - Users Table
src/components/UserTable.tsx
Shared Services
- Session and JWT Auth
src/lib/auth.ts - Application Database
prisma/schema.prisma - Prisma Client
src/lib/prisma.ts - Language Selection
src/lib/getLanguage.ts - Translations
src/lib/dictionaries.ts - Language Preference Action
src/actions/setLanguage.ts
Other components
- Shopper
Connections 35
- 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
src/app/page.tsx - Home and Featured → Language Selection: reads locale
src/app/page.tsx - Home and Featured → Translations: uses translations
src/app/page.tsx - Product Catalogue → Prisma Client: queries products
src/app/products/page.tsx - Product Catalogue → Catalogue Filters: renders filters
src/app/products/page.tsx - Product Catalogue → Language Selection: reads locale
src/app/products/page.tsx - Product Catalogue → Translations: uses translations
src/app/products/page.tsx - Product Detail → Prisma Client: loads product
src/app/product/[id]/page.tsx - Product Detail → Checkout Form: renders checkout
src/app/product/[id]/page.tsx - Checkout Form → Server Actions: submits order
src/components/CheckoutForm.tsx - Registration → Server Actions: registers account
src/app/register/page.tsx - Login → Server Actions: submits credentials
src/app/login/page.tsx - Customer Orders → Session and JWT Auth: checks session
src/app/orders/page.tsx - Customer Orders → Prisma Client: loads orders
src/app/orders/page.tsx - Server Actions → Session and JWT Auth: manages sessions
src/app/actions.ts - Server Actions → Prisma Client: mutates records
src/app/actions.ts - Admin Dashboard → Prisma Client: loads metrics
src/app/admin/page.tsx - Order Management → Prisma Client: loads order
src/app/admin/orders/[id]/page.tsx - Order Management → Session and JWT Auth: checks session
src/app/admin/orders/[id]/page.tsx - Order Management → Orders Table: renders controls
- Product Management → Prisma Client: loads products
src/app/admin/products/page.tsx - Product Management → Products Table: renders table
src/app/admin/products/page.tsx - Products Table → Server Actions: manages products
src/components/ProductTable.tsx - User Management → Prisma Client: loads users
src/app/admin/users/page.tsx - User Management → Users Table: renders table
src/app/admin/users/page.tsx - User Management → Session and JWT Auth: checks session
src/app/admin/users/page.tsx - Users Table → Server Actions: manages users
src/components/UserTable.tsx - Orders Table → Server Actions: manages orders
src/components/OrderTable.tsx - Prisma Client → Application Database: connects to
src/lib/prisma.ts - Store Navigation → Language Preference Action: offers language change
src/components/NavbarClient.tsx