How rasadov/ecommerceapi works
Project type and purpose
• This is a microservices-based e-commerce platform.
• Language mix: Go-based services (Account, Product, Order, Payment, GraphQL API Gateway) + Python-based Recommender.
• Key capabilities: gRPC communication, Kafka event streaming, unified GraphQL gateway, ElasticSearch, PostgreSQL.
File structure
• Top-level microservice folders:
• account/
• product/
• order/
• payment/
• graphql/ (API gateway)
• recommender/ (Python consumer)
• Shared code under pkg/ (auth, middleware, kafka helpers).
• docker-compose.yaml + docker/ directory orchestrate all containers: services, Postgres, ES, Kafka, Zookeeper.
• Each service has client/, cmd/, config/, internal/, models/, proto/ subfolders → clear gRPC & modular structure.
Extract README insights
• Services overview: Account, Product, Order, Payment, Recommender, GraphQL gateway.
• Data stores: PostgreSQL (account, order, payment, recommender-replica), ElasticSearch (product).
• Kafka streams: Order & Product produce; Recommender consumes.
• GraphQL gateway stitches all gRPC services.
Main components & boundaries
A. Clients (browser/mobile)
B. API Gateway (GraphQL service)
1. Account Service (Go)
2. Product Service (Go)
3. Order Service (Go)
4. Payment Service (Go)
5. Recommender Service (Python)
D. Infrastructure Services:
• PostgreSQL cluster (account DB, order DB, payment DB, recommender-replica)
• ElasticSearch (product index)
• Kafka + Zookeeper
• External payment provider (third-party)
Relationships & data flows
• Clients → (HTTP) → GraphQL API Gateway
• Gateway → (gRPC) → each Go microservice
• Account/Product/Order/Payment services → (DB calls) → respective PostgreSQL or ElasticSearch
• Order & Product services → (Kafka producer) → Kafka topic(s)
• Recommender → (Kafka consumer) → subscribes to Product/Order topics → updates Postgres replica
• Payment service → (Webhook/gRPC) → order service (to update order status)
• All services containerized and networked via Docker Compose
Architectural patterns & design principles
• Microservices decomposition by business domain.
• API Gateway pattern (GraphQL for schema stitching).
• Event-driven architecture via Kafka (asynchronous, decoupled).
• gRPC for inter-service RPC (strongly typed, high-performance).
• Polyglot services (Go + Python).
• 12-factor & containerized deployment.
Technologies & frameworks callouts
• Go modules, gRPC + protobuf, gqlgen (GraphQL), Python gRPC client/server, SQL (Postgres), ElasticSearch, Kafka, Docker / Docker Compose.
• Shared libs: pkg/auth (JWT), pkg/kafka (producer), pkg/middleware.