DevOps Project β Online Food Delivery System
The Online Food Delivery System (OFDS) is a microservices-based application demonstrating DevOps best practices. It showcases:
- Inter-service communication
- API Gateway routing
- Observability with tracing, logging, metrics, and profiling
Built using Java Spring Boot, Spring Cloud Gateway, Docker, and Docker Compose.
-
API Gateway (Spring Cloud Gateway)
- Entry point for all requests
- Routes traffic to backend services
- Supports load balancing and centralized routing
-
Order Service
- Manages customer orders
- Stores customer name, dish, status, and restaurant ID
- Retrieves restaurant details from the Restaurant Service
-
Restaurant Service
- Manages restaurant data: name, location, cuisine type
- Returns details for a given restaurant ID
-
Delivery Service
- Manages deliveries with order ID, driver name, and status
- Retrieves order details from the Order Service
-
PostgreSQL
- Dedicated database per service
- Uses Docker volumes for persistence
-
Client sends request to API Gateway
-
Gateway routes based on URI:
/api/orders/**β Order Service/api/restaurants/**β Restaurant Service/api/deliveries/**β Delivery Service
-
Order Service may query Restaurant Service
-
Delivery Service may query Order Service
-
All inter-service calls go through the Gateway
# Create Order
curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{"customerName": "John", "dishName": "Pizza", "status": "Pending", "restaurantId": 1}'
# List Orders
curl http://localhost:8080/api/orders
# Get Order by ID
curl http://localhost:8080/api/orders/1
# Update Order Status
curl -X PUT http://localhost:8080/api/orders/1/status \
-H "Content-Type: application/json" \
-d 'Delivered'# Create Restaurant
curl -X POST http://localhost:8080/api/restaurants \
-H "Content-Type: application/json" \
-d '{"name": "Pizza Palace", "location": "Cape Town", "cuisineType": "Italian"}'
# List Restaurants
curl http://localhost:8080/api/restaurants
# Get Restaurant by ID
curl http://localhost:8080/api/restaurants/1# Create Delivery
curl -X POST http://localhost:8080/api/deliveries \
-H "Content-Type: application/json" \
-d '{"orderId": 1, "driverName": "Jane", "status": "In Transit"}'
# List Deliveries
curl http://localhost:8080/api/deliveries
# Get Delivery by ID
curl http://localhost:8080/api/deliveries/1Start all services:
docker-compose up --buildStop all services:
docker-compose down -vservices/
βββ gateway/
βββ order-service/
βββ restaurant-service/
βββ delivery-service/
Architecture Overview:
| From | To | Description |
|---|---|---|
| Order Service | Restaurant Service | Fetches restaurant info when returning an order |
| Delivery Service | Order Service | Fetches order info when returning a delivery |
| All | API Gateway | Routes requests internally and externally for consistency |
Example:
http://gateway:8080/api/restaurants/{restaurantId}
http://gateway:8080/api/orders/{orderId}Run a complete observability stack to monitor logs, metrics, traces, and profiling:
./scripts/simulate.py| Service | Description |
|---|---|
| Grafana | Visualization layer for metrics, logs, traces, and profiling. http://localhost:3000 |
| Prometheus | Scrapes and stores time-series metrics from services |
| Loki | Centralized log aggregation |
| Promtail | Ships container logs to Loki |
| Tempo | Collects and stores distributed traces |
| Pyroscope | Continuous performance profiling (CPU, memory) |
- Real-time metrics (e.g., request count, order status)
- Structured logging with search
- Distributed traces via Tempo
- CPU/memory flamegraphs with Pyroscope
- Go to Grafana > Explore
- Select Tempo as data source
- Filter by service name (e.g.,
api-gateway) and span name (GET delivery-service) - View traces and spans
Under Dashboards > Demo Dashboard, youβll find:
- HTTP request breakdown
- Orders created over time
- Deliveries created and completed


