Overview
A production-ready coupon management and validation REST API in Go, built for e-commerce platforms that need flexible, high-performance discount logic.
Tech Stack
GoMongoDBDockerOpenAPI 3.0LRU Cache
Key Features
- Multiple coupon types — one-time, multi-use, and time-based — with percentage and fixed-amount discounts
- Context-aware validation that analyzes the cart and supports product- and category-level targeting
- In-memory LRU cache with TTL for sub-millisecond coupon lookups
- Concurrency-safe by design using mutex locking and atomic operations
- Full OpenAPI 3.0 spec with a browsable Swagger UI
- Containerized with Docker Compose for a one-command local stack (API + MongoDB)
Performance Metrics
response time
sub-millisecond (cached)
throughput
1000+ requests/second