How imrajeevnayan/food-fiesta works
Food Fiesta is a Spring Boot food-ordering and delivery platform. Customers browse restaurants and menus, place orders, and follow delivery; administrators manage platform data. The documented order path persists a placed order, publishes a Kafka event, assigns a nearby available driver, then updates order state and broadcasts it. Other major capabilities include geospatial restaurant discovery, live driver tracking, ETA calculation, and session/OAuth2 security. Paths and links for some subsystems are based on the README and repository tree; source excerpts were limited to a frontend alert, so uncertain controller-to-service wiring is omitted.
Main entry points: repositories JPA repositories · OrderRoutingConsumer.java Driver assignment consumer · DeliveryEstimateService.java ETA calculation · OrderServices.java Order services
Components 26
Storefront and API
- Spring Boot app
src/main/java/com/example/demo/FoodFrenzyApplication.java - Thymeleaf storefront
src/main/resources/templates - Order endpoints
src/main/java/com/example/demo/controllers/OrderController.java - Restaurant and product endpoints
src/main/java/com/example/demo/controllers/RestaurantController.java - Product endpoints
src/main/java/com/example/demo/controllers/ProductController.java - Cart endpoints
src/main/java/com/example/demo/controllers/CartController.java - Accounts and OAuth
src/main/java/com/example/demo/controllers/UserController.java - Authentication config
src/main/java/com/example/demo/config/SecurityConfig.java - Driver location endpoints
src/main/java/com/example/demo/controllers/DriverLocationController.java - Delivery estimate endpoint
src/main/java/com/example/demo/controllers/DeliveryEstimateController.java
Ordering and delivery
- Order services
src/main/java/com/example/demo/services/OrderServices.java - Order state machine
src/main/java/com/example/demo/services/OrderStateService.java - Order event producer
src/main/java/com/example/demo/services/OrderEventProducer.java - Driver assignment consumer
src/main/java/com/example/demo/services/OrderRoutingConsumer.java - Driver location service
src/main/java/com/example/demo/services/DriverLocationService.java - ETA calculation
src/main/java/com/example/demo/services/DeliveryEstimateService.java
Persistence and geo
- JPA repositories
src/main/java/com/example/demo/repositories - Driver geo repository
src/main/java/com/example/demo/repositories/DriverGeoRepository.java - PostgreSQL + PostGIS
- Redis Geo
Messaging and routing
- Road routing client
src/main/java/com/example/demo/services/MapRoutingClient.java - Kafka
- OSRM-compatible routing
- Spring AI / OpenAI
Other components
- Customer or admin
- Browser or mobile client
Connections 32
- Customer or admin → Thymeleaf storefront: browses
- Browser or mobile client → Spring Boot app: HTTP / STOMP
- Spring Boot app → Thymeleaf storefront: serves
- Customer or admin → Order endpoints: checks out
- Order endpoints → Order services: handles orders
- Order services → JPA repositories: persists order
- JPA repositories → PostgreSQL + PostGIS: reads / writes
- Order services → Order event producer: publishes event
- Order event producer → Kafka: sends event
- Kafka → Driver assignment consumer: delivers event
- Driver assignment consumer → Driver geo repository: finds nearby driver
- Driver geo repository → Redis Geo: searches geo
- Driver assignment consumer → JPA repositories: assigns driver
- Driver assignment consumer → Order state machine: confirms order
- Order state machine → JPA repositories: updates state
- Order state machine → Browser or mobile client: broadcasts status
- Customer or admin → Restaurant and product endpoints: searches nearby
- Restaurant and product endpoints → JPA repositories: queries restaurants
- Customer or admin → Driver location endpoints: shares location
- Driver location endpoints → Driver location service: updates position
- Driver location service → Driver geo repository: caches position
- Driver location service → Browser or mobile client: broadcasts location
- Customer or admin → Delivery estimate endpoint: requests estimate
- Delivery estimate endpoint → ETA calculation: calculates ETA
- ETA calculation → JPA repositories: reads order data
- ETA calculation → Road routing client: gets road route
- Road routing client → OSRM-compatible routing: requests route
- ETA calculation → Spring AI / OpenAI: refines estimate
- Customer or admin → Accounts and OAuth: signs in
- Accounts and OAuth → Authentication config: authenticates
- Customer or admin → Cart endpoints: manages cart
- Customer or admin → Product endpoints: browses menu