How jasperbriedel/minute-coffee works
Minute Coffee is a teaching-oriented coffee shop CRUD application with a server-rendered Express/EJS site and a separate React client for the JSON API. The main customer workflow is browsing/searching products, viewing details, submitting an order, and receiving confirmation; staff authenticate to manage orders and inspect sales, while product and employee administration support operations. The graph preserves both interfaces and the documented MVC/session/database capabilities. Evidence is limited to the README and indexed excerpts; unsampled route and view wiring is not asserted.
Main entry points: main.jsx Client routes · api.mjs HTTP API client · server.mjs Express server · APIController.mjs API routes
Components 33
Server-rendered site
- Express server
backend/server.mjs - Session authentication
backend/controllers/AuthenticationController.mjs - Product pages and admin
backend/controllers/ProductController.mjs - Order handling
backend/controllers/OrderController.mjs - Employee administration
backend/controllers/EmployeeController.mjs - Rendered views
backend/views - Order XML template
backend/views/xml/orders.xml.ejs
JSON API
- API routes
backend/controllers/api/APIController.mjs - Key authentication
backend/controllers/api/APIAuthenticationController.mjs - Product API
backend/controllers/api/APIProductsController.mjs - Order API and export
backend/controllers/api/APIOrderController.mjs - Employee API
backend/controllers/api/APIEmployeeController.mjs
React client
- Client routes
frontend/src/main.jsx - Client authentication
frontend/src/authentication/useAuthenticate.jsx - Staff login
frontend/src/authentication/LoginView.jsx - Product browsing
frontend/src/products/ProductListView.jsx - Product details
frontend/src/products/ProductDetailsView.jsx - Order checkout
frontend/src/products/ProductCheckoutView.jsx - Order confirmation
frontend/src/orders/OrderConfirmationView.jsx - Order management
frontend/src/orders/OrderManagementView.jsx - Sales reporting
frontend/src/products/ProductSalesView.jsx - XML download
frontend/src/common/XMLDownloadButton.jsx - HTTP API client
frontend/src/api.mjs
Domain and persistence
- Product records
backend/models/ProductModel.mjs - Order records
backend/models/OrderModel.mjs - Order line items
backend/models/OrderProductModel.mjs - Employee records
backend/models/EmployeeModel.mjs - Sales records
backend/models/SaleModel.mjs - Product sales
backend/models/SaleProductModel.mjs - Product attribution
backend/models/ProductEmployeeModel.mjs - MySQL access
backend/models/DatabaseModel.mjs
Other components
- Shopper or staff
- MySQL database
Connections 48
- Shopper or staff → Express server: uses pages
readme.md - Express server → Session authentication: mounts routes
backend/server.mjs - Express server → Product pages and admin: mounts routes
backend/server.mjs - Express server → Order handling: mounts routes
backend/server.mjs - Express server → Employee administration: mounts routes
backend/server.mjs - Express server → API routes: mounts API
backend/server.mjs - Session authentication → Employee records: authenticates with
backend/controllers/AuthenticationController.mjs - Product pages and admin → Product records: reads and updates
backend/controllers/ProductController.mjs - Product pages and admin → Rendered views: renders pages
backend/controllers/ProductController.mjs - Product pages and admin → Session authentication: checks roles
backend/controllers/ProductController.mjs - Order handling → Order records: creates orders
backend/controllers/OrderController.mjs - Order handling → Product records: adjusts stock
backend/controllers/OrderController.mjs - Order handling → Order line items: uses line items
backend/controllers/OrderController.mjs - Order handling → Session authentication: checks roles
backend/controllers/OrderController.mjs - Employee administration → Employee records: manages employees
backend/controllers/EmployeeController.mjs - API routes → Product API: routes products
backend/controllers/api/APIController.mjs - API routes → Order API and export: routes orders
backend/controllers/api/APIController.mjs - API routes → Key authentication: routes authentication
backend/controllers/api/APIController.mjs - API routes → Employee API: routes employees
backend/controllers/api/APIController.mjs - Key authentication → Employee records: looks up keys
backend/controllers/api/APIAuthenticationController.mjs - Product API → Product records: reads and writes
backend/controllers/api/APIProductsController.mjs - Product API → Product sales: queries sales
backend/controllers/api/APIProductsController.mjs - Order API and export → Order records: creates and reads
backend/controllers/api/APIOrderController.mjs - Order API and export → Order line items: exports completed orders
backend/controllers/api/APIOrderController.mjs - Order API and export → MySQL access: formats export date
backend/controllers/api/APIOrderController.mjs - Order API and export → Order XML template: renders XML
backend/controllers/api/APIOrderController.mjs - Client routes → Product browsing: routes to
frontend/src/main.jsx - Client routes → Product details: routes to
frontend/src/main.jsx - Client routes → Order checkout: routes to
frontend/src/main.jsx - Client routes → Order confirmation: routes to
frontend/src/main.jsx - Client routes → Order management: routes to
frontend/src/main.jsx - Client routes → Sales reporting: routes to
frontend/src/main.jsx - Client routes → Staff login: routes to
frontend/src/main.jsx - Client routes → Client authentication: provides authentication
frontend/src/main.jsx - Staff login → Client authentication: uses authentication
frontend/src/authentication/LoginView.jsx - Client authentication → HTTP API client: sends requests
frontend/src/authentication/useAuthenticate.jsx - Product browsing → HTTP API client: fetches products
frontend/src/products/ProductListView.jsx - Product details → HTTP API client: fetches product
frontend/src/products/ProductDetailsView.jsx - Order checkout → HTTP API client: submits order
frontend/src/products/ProductCheckoutView.jsx - Order confirmation → HTTP API client: fetches order
frontend/src/orders/OrderConfirmationView.jsx - Order management → XML download: offers export
frontend/src/orders/OrderManagementView.jsx - Order management → Client authentication: checks staff
frontend/src/main.jsx - Sales reporting → HTTP API client: fetches sales
frontend/src/products/ProductSalesView.jsx - HTTP API client → API routes: calls JSON API
- Product records → MySQL access: queries through
backend/models/ProductModel.mjs - Order records → MySQL access: queries through
backend/models/OrderModel.mjs - Order line items → MySQL access: queries through
backend/models/OrderProductModel.mjs - Employee records → MySQL access: queries through
backend/models/EmployeeModel.mjs