How nam3007/web-project works
This is a restaurant-management web application with a React frontend and FastAPI backend. Customers browse menus, place and track orders, pay, manage profiles, and make reservations; staff handle orders and reservations, while managers administer restaurant operations. The frontend routes role-specific pages and sends API requests through a shared Axios client; FastAPI mounts domain routers and uses SQLAlchemy persistence. The excerpts show routing, authentication, database setup, and coupon logic. Several domain implementations were not sampled, so those branches are represented at their documented route level without inferred internal call chains.
Main entry points: App.jsx Route application · main.py FastAPI application · axios.js HTTP client · manager Management console
Components 22
React frontend
- Route application
FE/src/App.jsx - Authentication
FE/src/context/AuthContext.jsx - Cart state
FE/src/context/CartContext.jsx - HTTP client
FE/src/api/axios.js - Customer journeys
FE/src/pages/customer - Staff workflows
FE/src/pages/staff - Management console
FE/src/pages/manager - Rating interface
FE/src/components/RatingModal.jsx
API and domain
- FastAPI application
BE/app/main.py - Authentication routes
BE/app/controller/auth.py - Order routes
BE/app/controller/order.py - Payment routes
BE/app/controller/payment.py - Reservation routes
BE/app/controller/reservation.py - Restaurant domain routes
BE/app/controller - Coupon service
BE/app/services/coupon_service.py - Data repositories
BE/app/repository - Restaurant entities
BE/app/models
Persistence
- Database sessions
BE/app/db.py - Restaurant database
Other components
- Customer
- Staff
- Manager
Connections 23
- Customer → Route application: uses
FE/src/App.jsx - Staff → Route application: uses
FE/src/App.jsx - Manager → Route application: uses
FE/src/App.jsx - Route application → Customer journeys: routes to
FE/src/App.jsx - Route application → Staff workflows: routes to
FE/src/App.jsx - Route application → Management console: routes to
FE/src/App.jsx - Route application → Authentication: provides
FE/src/App.jsx - Route application → Cart state: provides
FE/src/App.jsx - Authentication → HTTP client: sends requests
FE/src/context/AuthContext.jsx - Customer journeys → HTTP client: requests data
FE/src/pages/customer/CustomerReservationPage.jsx - Management console → HTTP client: requests data
FE/src/pages/manager/AdminReservationPage.jsx - Staff workflows → HTTP client: requests data
FE/src/pages/staff/StaffReservationPage.jsx - Management console → Rating interface: renders
FE/src/pages/manager/AdminReviewsPage.jsx - FastAPI application → Authentication routes: mounts
BE/app/main.py - FastAPI application → Order routes: mounts
BE/app/main.py - FastAPI application → Payment routes: mounts
BE/app/main.py - FastAPI application → Reservation routes: mounts
BE/app/main.py - FastAPI application → Restaurant domain routes: mounts
BE/app/main.py - FastAPI application → Database sessions: initializes schema
BE/app/main.py - Order routes → Coupon service: uses
BE/app/controller/order.py - Coupon service → Data repositories: queries and updates
BE/app/services/coupon_service.py - Data repositories → Restaurant entities: uses entities
BE/app/repository/reviewRepository.py - Database sessions → Restaurant database: connects
BE/app/db.py