How ashutoshpatraa/cafe-theory works
Cup Theory is a café ordering portal with a customer storefront and an admin BI/operations portal. Customers authenticate, browse products and offers, maintain a persistent cart, check out, and track or reorder purchases; administrators manage orders and menu data and review analytics and inventory. The graph separates the client, HTTP API, domain services, and persistence. Some route wiring and unsampled page implementations are not shown, so those links are omitted or marked unverified.
Main entry points: App.tsx Route Shell · api.ts API Client · prisma.ts SQLite via Prisma · Home.tsx Home Dashboard
Components 27
Customer and Admin Client
- Route Shell
client/src/App.tsx - Home Dashboard
client/src/pages/Home.tsx - Explore Menu
client/src/pages/ExploreMenu.tsx - Auth State
client/src/store/authStore.ts - Cart State
client/src/store/cartStore.ts - Checkout
client/src/pages/Checkout.tsx - Order History
client/src/pages/Orders.tsx - Profile
client/src/pages/Profile.tsx - Admin Portal
client/src/components/admin/AdminLayout.tsx - Admin Operations
client/src/pages/admin - Inventory UI
client/src/pages/admin/AdminInventory.tsx - API Client
client/src/services/api.ts - Admin API Client
client/src/services/adminApi.ts
HTTP API
- Auth Controller
server/src/controllers/authController.ts - Cart Controller
server/src/controllers/cartController.ts - Order Controller
server/src/controllers/orderController.ts - Product Controller
server/src/controllers/productController.ts - Admin Controller
server/src/controllers/adminController.ts - Cookie Authentication
server/src/middleware/auth.ts
Domain Services
- Authentication
server/src/services/authService.ts - Cart Management
server/src/services/cartService.ts - Order Processing
server/src/services/orderService.ts - Menu and Offers
server/src/services/productService.ts - Admin BI and Management
server/src/services/adminDashboardService.ts
Persistence
- SQLite via Prisma
server/src/utils/prisma.ts
Other components
- Customer
- Café Admin
Connections 32
- Customer → Route Shell: uses portal
README.md - Route Shell → Home Dashboard: routes to
client/src/App.tsx - Route Shell → Explore Menu: routes to
client/src/App.tsx - Route Shell → Checkout: routes to
client/src/App.tsx - Route Shell → Order History: routes to
client/src/App.tsx - Route Shell → Profile: routes to
client/src/App.tsx - Route Shell → Auth State: checks session
client/src/App.tsx - Home Dashboard → API Client: loads featured and offers
client/src/pages/Home.tsx - Home Dashboard → Cart State: adds products
client/src/pages/Home.tsx - Auth State → API Client: calls auth API
client/src/store/authStore.ts - Cart State → API Client: calls cart API
client/src/store/cartStore.ts - Checkout → API Client: creates order
client/src/pages/Checkout.tsx - Café Admin → Admin Portal: uses portal
README.md - Route Shell → Admin Portal: routes to
client/src/App.tsx - Admin Portal → Admin Operations: hosts views
client/src/App.tsx - Inventory UI → Admin API Client: loads inventory
client/src/pages/admin/AdminInventory.tsx - Admin Operations → Admin API Client: requests admin data
client/src/pages/admin/AdminInventory.tsx - API Client → Auth Controller: sends HTTP requests
- API Client → Cart Controller: sends HTTP requests
- API Client → Order Controller: sends HTTP requests
- API Client → Product Controller: sends HTTP requests
- Admin API Client → Admin Controller: sends HTTP requests
- Auth Controller → Authentication: delegates auth
server/src/controllers/authController.ts - Cart Controller → Cart Management: delegates cart
server/src/controllers/cartController.ts - Order Controller → Order Processing: delegates orders
server/src/controllers/orderController.ts - Product Controller → Menu and Offers: delegates products
server/src/controllers/productController.ts - Admin Controller → Admin BI and Management: delegates admin work
server/src/controllers/adminController.ts - Auth Controller → Cookie Authentication: uses request identity
server/src/controllers/authController.ts - Authentication → SQLite via Prisma: reads and writes
server/src/services/authService.ts - Cart Management → SQLite via Prisma: reads and writes
server/src/services/cartService.ts - Order Processing → SQLite via Prisma: reads and writes
server/src/services/orderService.ts - Admin BI and Management → SQLite via Prisma: queries and updates
server/src/services/adminDashboardService.ts