A robust, production-ready backend engine for a real-time Auction SaaS platform. Built with NestJS, following Domain-Driven Design (DDD) and Hexagonal Architecture principles.
- Complex Bidding Rules:
- Minimum increment logic (5% or $5.00)
- Anti-sniping (auto-extending end time)
- Self-bidding prevention
- Auction Lifecycle: Draft -> Published -> Active -> Completed/Expired
- Real-Time Bidding: WebSocket-based push updates via Socket.io
- Background Jobs:
BullMQ+Redisfor reliable job processing- Auto-closing of expired auctions
- Email notification queues (Outbid, Won, Ends soon)
- Custom Auth System:
- JWT Access Tokens
- Email verification (6-digit codes)
- Separation of
Account(auth) andIdentity(profile) - Secure password hashing (Bcrypt)
The docs/ folder contains comprehensive guides:
-
Getting Started:
- WebSocket Quickstart - Setup real-time features
- Frontend Integration - Integrating React/Gateway
- Project Status - Current MVP status
-
Deep Dive:
- Architecture Guide - Hexagonal + DDD explained
- Internal Flows - Sequence diagrams of core flows
- Database Schema - Data models
- Testing Guide - Testing strategy
-
Planning:
- Roadmap - Future features
- Node.js >= 18
- pnpm >= 8
- Docker (for Redis)
pnpm install
cp .env.example .env# Start Redis for WebSockets and BullMQ
docker-compose up -d redis# Development mode
pnpm run start:devAccess API at http://localhost:8000
Access Swagger at http://localhost:8000/docs
# Run unit tests
pnpm test
# Check coverage (98%+)
pnpm run test:covsrc/
├── context/
│ ├── auction/ # Auction Bounded Context
│ │ ├── domain/ # Rules: Bids, Anti-sniping, Min Increment
│ │ ├── application/ # Use Cases: PlaceBid, PublishAuction
│ │ ├── infrastructure/ # WebSockets, Controllers, BullMQ Workers
│ ├── identity/ # Identity Bounded Context
│ │ ├── domain/ # Users, Accounts, Verification
│ │ ├── application/ # Use Cases: Register, Login
│ │ └── infrastructure/ # Auth Guards, JWT strategies
│ └── shared/ # Shared Kernel (EventBus, DDD primitives)
POST /auth/register- Create accountPOST /auth/login- Get JWTPOST /auth/verify- Verify email
POST /auctions- Create draft auctionPOST /auctions/:id/publish- Go livePOST /auctions/:id/bids- Place bid (Real-time broadcast)GET /auctions/:id- Get details
See CONTRIBUTING.md
UNLICENSED