microstore is a modular e-commerce backend portfolio project built with Go using a microservices architecture. It demonstrates clean architecture principles, inter-service communication via REST, and containerized deployments using Docker and Docker Compose.
- Auth Service: User registration, login, JWT auth, basic admin logic
- Product Service: CRUD, stock tracking, search, and caching
- Order Service: Order creation and retrieval with validation
- API Gateway: Centralized routing with CORS, authentication, and admin middleware
- PostgreSQL (with optional in-memory mode) for persistence
- Redis Caching for faster product access
- ZincSearch-based product search by title/description
- Rate Limiting by IP to control request flow
- Shared Library for reusable helpers, middleware, DB, cache, and utils
- Postman Collection included for easy API testing
- Dockerized with docker-compose for local orchestration
- Language: Go 1.24
- Architecture: Clean Architecture with microservices
- Communication: REST APIs over HTTP
- Containerizaion: Docker + Docker Compose
- Primary Database: PostgreSQL with seperate schemas per service
- Caching Layer: Redis for product cashing and rate limiting
- Seach Engine: Zincsearch for product full-text search
- Build System: Makefile with common commands
- API Tesing: Postman collection included
- Testing: In-memory repositories for unit-testing
The project requires Go ,Docker and Make to get started.
clone the repo
git clone https://github.com/cushydigit/microstore.git
cd microstore
run all services
make up
stop services
make down
The gateway service serves as the single entry point, handling:
- Request routing to appropriate business sevices
- JWT authentication validation
- CORS configuration
- IP-based rate limiting via Redis
Each business service owns its domain and data:
auth-service: User management and JWT token generationproduct-service: Product lifecycle with advanced search and cachingorder-service: Order processing with product validation
The shared module provides common functionality:
- Type definitions for inter-service communication
- Database connection management
- Redis client abstraction
- Zincsearch client abstraction
- Middleware for authenticaion and validation
microstore/
├── auth-service # Handles user registration, login, authentication, and rate limitiing
├── product-service # Manages products, supports search and caching
├── order-service # Manages customer orders and order workflows
├── gateway # API Gateway routing external HTTP traffic to services
├── shared # Common utilities, middleware, DB, Redis, search clients
├── db # SQL migrations for initializing databases
├── docker-compose.yml # Orchestrates all services with PostgreSQL & Redis
├── Makefile # Common build and run commands
You can use the Postman collection to test all available endpoints:
Download Postman Collection
This project is for educational and portfolio purposes. Feel free to use it as a reference or learning resource.
