Skip to content

surukanti/swifteats-kafka-platform

Repository files navigation

SwiftEats Kafka Platform

Production-grade event-driven food delivery platform built with Go microservices and Apache Kafka


🚀 Quick Start (5 Minutes)

# 1. Start infrastructure
cd docker && docker-compose up -d && sleep 60

# 2. Initialize database  
docker exec -i swifteats-postgres psql -U swifteats < init-scripts/postgres/01-init.sql

# 3. Create Kafka topics
cd .. && ./scripts/create-topics.sh

# 4. Start microservices
./scripts/start-go-services.sh

# 5. Test all features
./scripts/test-all-features.sh

✅ Platform is now running!


📚 Complete Documentation

🎯 Start Here

👉 FEATURES_GUIDE.md - Quick Reference for All Features

  • API examples and usage
  • Fraud detection rules
  • Event streaming guide
  • Testing and troubleshooting

👉 ARCHITECTURE.md - Architecture & Flow Diagrams

  • System architecture diagrams
  • Service architecture breakdown
  • Data flow diagrams
  • Kafka topics & event flow
  • Database schema & Redis structure

📖 Additional Documentation

Setup & Operations:

Observability:

Reference:


🏗️ What's Included

4 Go Microservices

Service Port Purpose
Order Service 8081 Order lifecycle, saga orchestration
Payment Service 8082 Payment processing, refunds
Driver Service 8083 GPS tracking, driver assignment
Fraud Detection 8085 Real-time fraud analysis

Enterprise Patterns

✅ Saga Pattern - Distributed transactions
✅ Outbox Pattern - Guaranteed event delivery
✅ CDC - Change Data Capture
✅ CQRS - Command Query Separation
✅ Event Sourcing - Immutable events
✅ DDD - Domain-Driven Design

Infrastructure

  • Apache Kafka (3-node cluster, 19 topics)
  • PostgreSQL 16 (CDC enabled)
  • Redis 7 (caching)
  • Elasticsearch + Kibana (logging)
  • Prometheus + Grafana (monitoring)
  • Schema Registry (Avro schemas)

🎯 Key Features

Order Management: 9-state lifecycle, automatic pricing, cancellations
Payment Processing: Multiple methods, idempotency, refunds
Driver Tracking: Real-time GPS, WebSocket streaming, nearest matching
Fraud Detection: 3 detection rules, risk scoring, customer profiling


🧪 Testing

# Automated feature tests
./scripts/test-all-features.sh

# Integration tests
./scripts/integration-test.sh

# Manual API test
curl -X POST http://localhost:8081/api/orders \
  -H "Content-Type: application/json" \
  -d '{ "customerId": "...", "items": [...] }'

📊 Monitoring

Service Logs:

tail -f /tmp/order-service.log | jq .

🛠️ Tech Stack

Go 1.21+ • Kafka 3.6 • PostgreSQL 16 • Redis 7 • Elasticsearch 8.12


📖 Learn More

This project demonstrates real-world patterns used by:

  • Uber Eats (order orchestration)
  • DoorDash (driver matching)
  • Netflix (event-driven architecture)
  • Amazon (saga pattern)

Perfect for learning:

  • Distributed systems
  • Event-driven architecture
  • Microservices communication
  • Real-time data processing
  • Production deployment patterns

Status: Production Ready ✅
Last Updated: December 27, 2025

📘 For complete details, see COMPLETE_FEATURE_GUIDE.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages