## Features - Daily/Weekly/Monthly leaderboard management - Ranking score calculation (effectiveScore = totalTeamPlanting - maxDirectTeamPlanting) - Virtual ranking system for display purposes - Real-time ranking updates via scheduled tasks - Redis caching for hot data - Kafka messaging for event-driven updates ## Architecture - Domain-Driven Design (DDD) with Hexagonal Architecture - NestJS 10.x + TypeScript 5.x - PostgreSQL 15 + Prisma ORM - Redis (ioredis) for caching - Kafka (kafkajs) for messaging - JWT + Passport for authentication - Swagger for API documentation ## Domain Layer - Aggregates: LeaderboardRanking, LeaderboardConfig - Entities: VirtualAccount - Value Objects: LeaderboardType, LeaderboardPeriod, RankingScore, RankPosition, UserSnapshot - Domain Events: LeaderboardRefreshedEvent, ConfigUpdatedEvent, RankingChangedEvent - Domain Services: LeaderboardCalculationService, VirtualRankingGeneratorService, RankingMergerService ## Infrastructure Layer - Prisma repositories implementation - Redis cache service - Kafka event publisher/consumer - External service clients (ReferralService, IdentityService) ## Testing - Unit tests: 72 tests passed (88% coverage on core domain) - Integration tests: 7 tests passed - E2E tests: 11 tests passed - Docker containerized tests: 79 tests passed ## Documentation - docs/ARCHITECTURE.md - Architecture design - docs/API.md - API specification - docs/DEVELOPMENT.md - Development guide - docs/TESTING.md - Testing guide - docs/DEPLOYMENT.md - Deployment guide 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| docs | ||
| prisma | ||
| src | ||
| test | ||
| .dockerignore | ||
| .env.development | ||
| .env.example | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierrc | ||
| DEVELOPMENT_GUIDE.md | ||
| Dockerfile | ||
| Makefile | ||
| docker-compose.test.yml | ||
| docker-compose.yml | ||
| nest-cli.json | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.build.json | ||
| tsconfig.json | ||