You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A production-grade GraphQL Federation 2 e-commerce platform demonstrating hybrid protocol architecture (GraphQL + REST + gRPC) across three backend languages, fronted by Kong API Gateway and Apollo Router, with a Next.js 15 storefront and full observability.
Architecture
flowchart TB
Browser["Browser :3000"] -->|HTTP| Kong
subgraph Kong["Kong API Gateway :8000"]
direction LR
K1["Auth . Rate Limiting . CORS"]
end
Kong -->|"/graphql"| Router
Kong -->|"/auth/*"| User
subgraph Router["Apollo Router :4000"]
direction LR
R1["Federation 2.9 . Header Propagation . OTLP"]
end
Router --> Product["Product Catalog\nJava :4001"]
Router --> Order["Order Service\nGo :4002"]
Router --> User["User/Auth + Reviews\nTypeScript :4003"]
Router --> Inventory["Inventory\nJava :4004"]
Product <-->|"gRPC\n:50051"| Inventory
Order -->|"REST\nHTTPS"| Stripe["Stripe API"]
subgraph Observability
OTel["OTel Collector"]
Tempo["Grafana Tempo"]
Prometheus
Loki
Alloy["Grafana Alloy"]
Pyroscope
Grafana
end
Product & Order & User & Inventory -->|OTLP| OTel
OTel --> Tempo & Prometheus
Alloy -->|logs| Loki
Product & Order & User & Inventory -.->|profiles| Pyroscope
Grafana --> Tempo & Prometheus & Loki & Pyroscope
Loading
Protocol Boundaries
Connection
Protocol
Client -> Kong
HTTP
Kong -> Apollo Router
HTTP (internal)
Router -> Subgraphs
HTTP (GraphQL over POST)
Product Catalog <-> Inventory
gRPC (protobuf over HTTP/2)
Order Service -> Stripe
HTTPS REST
All services -> OTel Collector
OTLP gRPC
Technology Stack
Component
Technology
Version
Federation Router
Apollo Router
2.1.1
Federation Spec
Apollo Federation
2.9
API Gateway
Kong OSS
3.9
Java Framework
Micronaut
4.7.6
Java
OpenJDK
21 LTS
Go
Go
1.23
Go GraphQL
gqlgen
0.17.63
TypeScript
TypeScript
5.7
Apollo Server
@apollo/server
4.11
Frontend
Next.js
15.1
CSS
TailwindCSS
4.0
Search
Meilisearch
1.12
Object Storage
MinIO
latest
Database
PostgreSQL
17
Cache
Redis
7.4
Tracing
Grafana Tempo
2.7
Metrics
Prometheus
3.2
Dashboards
Grafana
11.5
Logs
Loki
3.4
Log Collector
Grafana Alloy
1.5
Profiling
Grafana Pyroscope
1.10
Telemetry
OTel Collector
0.115.1
Quick Start
# Clone and configure
git clone https://github.com/techishthoughts-org/graphql-federation.git
cd graphql-federation
cp .env.example .env # Edit with your values# Start infrastructure + all services
make up
# Include observability stack (Tempo, Grafana, Prometheus, Loki, Pyroscope)
make up-full
# Verify all services are healthy
make health
Services
Service
Language
Port
Entities
Product Catalog
Java 21 / Micronaut
4001
Product, Category
Inventory
Java 21 / Micronaut
4004, gRPC 50051
Inventory (extends Product)
Order Service
Go 1.23 / gqlgen
4002
Order, OrderItem (refs User, Product)
User/Auth + Reviews
TypeScript / Apollo Server
4003
User, Review (extends Product)
Frontend
Next.js 15 / React 19
3000
—
Federation Schema
Entity ownership and cross-service references:
Product@key(fields: "id") — owned by Product Catalog, extended by Inventory (adds inventory), User Service (adds reviews, averageRating), Order Service (referenced in OrderItem)
User@key(fields: "id") — owned by User/Auth, extended by Order Service (adds orders)
Order@key(fields: "id") — owned by Order Service
Review@key(fields: "id") — owned by User/Auth
Category@key(fields: "id") — owned by Product Catalog
Key Commands
make up # Start infrastructure + services
make up-full # Include observability stack
make down # Stop all containers
make build # Build all Docker images
make compose-supergraph # Recompose federated schema with Rover
make logs SVC=user # Tail logs for a service
make health # Check all service health endpoints
make seed # Load demo data
make clean # Remove all volumes and containers
make validate # Deep local validation across services + docs
make validate-observability # Validate observability config wiring
Development
Each service can run independently outside Docker for faster iteration. See the Development Guide for per-service setup instructions.
# Start just infrastructure
docker compose up -d postgres redis meilisearch minio minio-init mailpit
# Run services locally (separate terminals)cd services/user-ts && npm install && npm run dev
cd services/product-catalog-java && gradle run
cd services/inventory-java && gradle run
cd services/order-go && go run cmd/server/main.go
cd frontend && npm run dev