How anant3008/serviceeats works
ServiceEats is a customer-facing food delivery platform: users browse restaurants, manage a cart, place and pay for orders, then follow delivery and notifications. The Next.js frontend sends requests through an API gateway to independently scoped backend services. Checkout creates an order and publishes an event; payment success then drives the documented asynchronous order, delivery, and notification workflow. MongoDB provides service-owned persistence. The README documents the overall routing and event flow; sampled code confirms checkout publishing and payment webhook behavior, but not every gateway or Kafka consumer connection.
Main entry points: index.js API gateway · order-service/src Cart and orders · payment-service/src Payments · app Next.js app
Components 19
Customer app
- Next.js app
frontend/app - Location and weather
frontend/app/api/geo/route.js - Trending food message
frontend/app/api/trending-message/route.js
Core services
- API gateway
services/gateway/src/index.js - User and profile
services/user-service/src - Restaurant catalog
services/restaurant-service/src
Order fulfillment
- Cart and orders
services/order-service/src - Payments
services/payment-service/src - Delivery
services/delivery-service/src - Notifications
services/notification-service/src
Data and events
- Kafka events
- User MongoDB
services/user-service/src/config/db.js - Restaurant MongoDB
services/restaurant-service/src/config/db.js - Order MongoDB
services/order-service/src/config/db.js - Payment MongoDB
services/payment-service/src/config/db.js - Delivery MongoDB
services/delivery-service/src/config/db.js - Notification MongoDB
services/notification-service/src/config/db.js
Other components
- Customer
- Stripe
Connections 26
- Customer → Next.js app: uses
- Next.js app → API gateway: requests
- Next.js app → Location and weather: fetches location
- Next.js app → Trending food message: requests message
- Location and weather → Customer: returns location
- Trending food message → Customer: returns message
- API gateway → User and profile: routes requests
- API gateway → Restaurant catalog: routes requests
- API gateway → Cart and orders: routes requests
- API gateway → Payments: routes requests
- API gateway → Delivery: routes requests
- API gateway → Notifications: routes requests
- User and profile → User MongoDB: reads and writes
- Restaurant catalog → Restaurant MongoDB: reads and writes
- Cart and orders → Order MongoDB: reads and writes
- Payments → Payment MongoDB: reads and writes
- Delivery → Delivery MongoDB: persists delivery
- Notifications → Notification MongoDB: reads and writes
- Cart and orders → Kafka events: publishes order
- Payments → Stripe: creates payment
- Stripe → Payments: sends webhook
- Payments → Kafka events: publishes payment result
- Kafka events → Cart and orders: dispatches events
- Kafka events → Delivery: dispatches events
- Kafka events → Notifications: dispatches events
- Cart and orders → Restaurant catalog: updates rating