A modern e-commerce platform built with microservices architecture, featuring gRPC communication, GraphQL API Gateway, and distributed services for scalability and maintainability.
Stickerm follows a microservices architecture pattern with the following key components:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client App │───▶│ API Gateway │───▶│ Microservices │
│ (Frontend) │ │ (GraphQL) │ │ (gRPC) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
| Service | Technology | Port | Description |
|---|---|---|---|
| API Gateway | TypeScript/Node.js | 3000 | GraphQL endpoint, request routing, authentication |
| Product Service | Go | 50051 | Product management, CRUD operations |
| Recommendation Service | Python | TBD | Product recommendations, ML algorithms |
- Framework: Express.js with TypeScript
- GraphQL: Apollo Server with Federation
- Communication: gRPC clients
- Logging: Pino logger
- Development: Nodemon, ts-node
- Language: Go 1.25.1
- Framework: gRPC server
- Protocol: Protocol Buffers (protobuf)
- Architecture: Clean architecture pattern
- Language: Python 3.11+
- Framework: TBD (FastAPI/Flask planned)
- Package Management: uv/pip
The API Gateway exposes a GraphQL endpoint at /api/v1/graphql with the following operations:
type Product {
id: ID!
name: String!
description: String!
price: Float!
imageUrl: String!
}| Query | Arguments | Returns | Description |
|---|---|---|---|
products |
None | [Product] |
Get all products |
product |
id: ID! |
Product |
Get product by ID |
| Mutation | Arguments | Returns | Description |
|---|---|---|---|
createProduct |
name, description, price, imageUrl |
Product |
Create new product |
updateProduct |
id, name?, description?, price?, imageUrl? |
Product |
Update existing product |
deleteProduct |
id: ID! |
Boolean |
Delete product |
service ProductService {
rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse);
rpc GetProducts (GetProductsRequest) returns (GetProductsResponse);
rpc GetProductById (GetProductByIdRequest) returns (GetProductByIdResponse);
rpc UpdateProduct (UpdateProductRequest) returns (UpdateProductResponse);
rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
}| Step | Component | Action | Protocol |
|---|---|---|---|
| 1 | Client | Sends GraphQL query | HTTP/GraphQL |
| 2 | API Gateway | Validates & routes request | - |
| 3 | API Gateway | Calls microservice | gRPC |
| 4 | Microservice | Processes request | - |
| 5 | Microservice | Returns response | gRPC |
| 6 | API Gateway | Formats response | GraphQL |
| 7 | Client | Receives formatted data | HTTP/JSON |
POST /api/v1/graphql
{
query: "{ products { id name price } }"
}
↓
API Gateway (GraphQL Resolver)
↓
gRPC Call: ProductService.GetProducts({})
↓
Product Service (Go)
↓
Returns: GetProductsResponse{products: [...]}
↓
GraphQL Response: { data: { products: [...] } }
- Node.js 18+
- Go 1.25+
- Python 3.11+
- Protocol Buffers compiler (protoc)
-
Clone the repository
git clone <repository-url> cd stickerm
-
API Gateway Setup
cd server/apigateway npm install # or pnpm install
-
Product Service Setup
cd server/productservice go mod tidy -
Recommendation Service Setup
cd server/recommendationservice pip install -e .
-
Start Product Service
cd server/productservice go run main.go # Server starts on localhost:50051
-
Start API Gateway
cd server/apigateway npm run dev # Server starts on http://localhost:3000 # GraphQL endpoint: http://localhost:3000/api/v1/graphql
-
Start Recommendation Service (Coming Soon)
cd server/recommendationservice python main.py
- Build API Gateway
cd server/apigateway npm run build npm start
| Variable | Default | Description |
|---|---|---|
PORT |
3000 | Server port |
NODE_ENV |
development | Environment mode |
API_PREFIX |
/api/v1 | API route prefix |
WHITELIST_IPS |
[] | CORS whitelist IPs |
LOG_LEVEL |
info | Logging level |
// API Gateway gRPC client setup
const client = new ProductService(
"localhost:50051",
credentials.createInsecure()
);stickerm/
├── server/
│ ├── apigateway/ # GraphQL API Gateway (Node.js/TypeScript)
│ │ ├── src/
│ │ │ ├── config/ # Configuration files
│ │ │ ├── controllers/ # Business logic controllers
│ │ │ ├── grpc/ # gRPC client setup
│ │ │ ├── middlewares/ # Express middlewares
│ │ │ ├── models/ # TypeScript interfaces
│ │ │ ├── resolvers/ # GraphQL resolvers
│ │ │ ├── utils/ # Utility functions
│ │ │ ├── schema.graphql # GraphQL schema
│ │ │ └── server.ts # Main server file
│ │ └── package.json
│ │
│ ├── productservice/ # Product microservice (Go)
│ │ ├── controllers/ # Service handlers
│ │ ├── genproto/ # Generated protobuf files
│ │ ├── main.go # Main server file
│ │ └── go.mod
│ │
│ ├── recommendationservice/ # Recommendation service (Python)
│ │ ├── main.py
│ │ └── pyproject.toml
│ │
│ └── protos/ # Protocol Buffer definitions
│ └── stickerm.proto
│
└── README.md
cd server/apigateway
npm test
npm run test:watchNavigate to http://localhost:3000/api/v1/graphql to access the GraphQL playground for testing queries and mutations.
query GetProducts {
products {
id
name
description
price
imageUrl
}
}mutation CreateProduct {
createProduct(
name: "Awesome Sticker"
description: "A really cool sticker"
price: 9.99
imageUrl: "https://example.com/sticker.png"
) {
id
name
price
}
}- API Gateway:
GET /api/v1/healthz - Product Service: Built-in gRPC health checking
- API Gateway: Pino logger with structured JSON logging
- Product Service: Go standard library logging
- Recommendation Service: Python logging (TBD)
Each service will include Dockerfile for containerization.
Kubernetes manifests for orchestration and scaling.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the ISC License.
- Add authentication & authorization
- Implement caching layer (Redis)
- Add database integration
- Complete recommendation service
- Add Docker support
- Implement monitoring (Prometheus/Grafana)
- Add API rate limiting
- Implement event-driven architecture
- Add comprehensive testing suite
For questions and support, please open an issue in the repository.
Author: Eddie Ogola
Version: 1.0.0
Last Updated: 2025