Service topology
The QeetMart platform follows a gateway-based microservices pattern:Service catalog
- API Gateway
- Auth Service
- User Service
- Product Service
- Inventory Service
Runtime: Node.js + TypeScript + ExpressPort:
4000Health endpoint: /healthData store: None (stateless)Responsibilities:- Single entry point for all client requests
- JWT token validation
- Request routing to downstream services
- Rate limiting and CORS handling
- Correlation ID propagation
micros/api-gatewayTechnology stack diversity
QeetMart intentionally uses multiple technology stacks across services:Why multiple languages?
Why multiple languages?
The platform demonstrates a polyglot microservices architecture where each service can use the most appropriate technology for its domain:
- Node.js/TypeScript for the API Gateway: Fast I/O, excellent HTTP proxy libraries, minimal logic
- Java/Spring Boot for business services: Robust ecosystem, type safety, enterprise patterns
- Go for inventory service: High concurrency, excellent for real-time operations, lightweight
Service communication
Synchronous HTTP/REST
All services communicate using synchronous HTTP/REST APIs with JSON payloads. The API Gateway acts as a reverse proxy, forwarding requests to the appropriate downstream service.micros/api-gateway/src/config/services.ts:55
Request correlation
The gateway propagates correlation IDs to all downstream services for distributed tracing:micros/api-gateway/src/routes/gateway.routes.ts:77
Data architecture
Each microservice owns its database. There is no shared database across services. This ensures loose coupling and independent deployability.
auth-service→auth_db(PostgreSQL)user-service→user_db(PostgreSQL)product-service→product_db(PostgreSQL)inventory-service→inventory(PostgreSQL + Redis)
Service isolation and failure handling
Timeouts
All service calls have configured timeouts to prevent cascading failures:micros/api-gateway/src/config/services.ts:13
Error handling
The gateway returns standardized error responses when downstream services are unavailable:micros/api-gateway/src/routes/gateway.routes.ts:57
Development and deployment
Local development
Run the full stack locally using Docker Compose:Service health checks
Each service exposes a health endpoint. The gateway provides an aggregated health check:Design principles
Key architectural rules:
- Gateway is the only public entry point for client applications
- Services do not call other services directly
- Each service has its own database
- API changes must be reflected in
contracts/openapi - Breaking changes require explicit versioning strategy
Service boundaries
Services are organized by business domain:- Auth: Identity and access management
- User: User profile and preferences
- Product: Catalog and product information
- Inventory: Stock management and reservations
Scalability considerations
Each service can be scaled independently based on its load characteristics:- API Gateway: Stateless, scales horizontally
- Auth Service: Database-bound, consider connection pooling
- Inventory Service: High concurrency, Redis caching reduces DB load
- Product Service: Read-heavy, candidate for caching layer
Next steps
API Gateway
Learn about routing, authentication, and request handling
Authentication
Understand JWT flow and token validation
Data Persistence
Explore database models and relationships