How enpassant-chess-forum-abesec/en-passant-backend works
En-Passant is an Express backend for club membership, recruitment, payments and chess community services. A typical member is provisioned from Clerk, updates a profile and chess accounts, applies to recruitment, pays or submits payment evidence, then completes department tasks; admins manage the lifecycle. Background jobs sync chess ratings and send email, with rankings exposed through Redis. The tree documents additional event, contact, settings, submission, storage and webhook capabilities. Sampled controller and worker source supports the shown calls; unsampled route wiring and some service internals are represented only at their owning module level.
Main entry points: app.js Express API · sync.engine.js Rating sync · payment.controller.js Payment API · user.controller.js Profile API
Components 34
Identity & profiles
- Profile API
src/features/users/user.controller.js - User repository
src/features/users/user.repository.js - User records
src/features/users/user.model.js - Clerk webhook
src/features/webhooks/webhook.controller.js
Recruitment lifecycle
- Application API
src/features/recruitment/recruitment.controller.js - Application lifecycle
src/features/recruitment/recruitment.service.js - Applications
src/features/recruitment/recruitment.model.js - Payment API
src/features/payments/payment.controller.js - Payment records
src/features/payments/payment.repository.js - Payments
src/features/payments/payment.model.js - Razorpay gateway
src/features/payments/gateways/razorpay.gateway.js - Task API
src/features/tasks/task.controller.js - Task repository
src/features/tasks/task.repository.js - Task definitions
src/features/tasks/task.model.js - Submission API
src/features/submissions/submission.controller.js
Club services
- Leaderboard
src/features/leaderboard/leaderboard.service.js
Background services
- Sync queue
src/features/sync/sync.queue.js - Sync worker
src/features/sync/sync.worker.js - Rating sync
src/features/sync/sync.engine.js - Chess.com adapter
src/features/sync/adapters/chesscom.adapter.js - Lichess adapter
src/features/sync/adapters/lichess.adapter.js
Runtime infrastructure
- Express API
src/app.js - Server startup
src/server.js - Authentication
src/middleware/auth.middleware.js - MongoDB
src/config/db.js - Redis
src/redis/redis.client.js
Other components
- Member
- Admin
- Clerk
- Razorpay
- Chess.com
- Lichess
- Cloudinary
- Resend
Connections 36
- Member → Express API: uses
- Admin → Express API: manages
- Express API → Authentication: authenticates
- Express API → Profile API: routes
- Express API → Application API: routes
- Express API → Payment API: routes
- Express API → Task API: routes
- Server startup → Express API: starts
- Profile API → User repository: calls
- User repository → User records: reads/writes
- Profile API → Leaderboard: reads ranks
- Profile API → Sync queue: enqueues
- Clerk → Clerk webhook: sends events
- Clerk webhook → User records: provisions
- Clerk webhook → Sync queue: queues welcome
- Sync queue → Sync worker: dispatches
- Sync worker → Rating sync: calls
- Rating sync → User records: loads/saves
- Rating sync → Chess.com adapter: fetches ratings
- Rating sync → Lichess adapter: fetches ratings
- Chess.com adapter → Chess.com: queries
- Lichess adapter → Lichess: queries
- Rating sync → Leaderboard: updates
- Leaderboard → Redis: stores rankings
- Application API → Application lifecycle: calls
- Application lifecycle → Applications: manages applications
- Payment API → Application lifecycle: checks/transitions
- Payment API → Razorpay gateway: creates orders
- Payment API → Payment records: records payment
- Payment records → Payments: reads/writes
- Razorpay → Payment API: payment webhook
- Task API → Task repository: queries tasks
- Task repository → Task definitions: reads definitions
- Submission API → Application lifecycle: checks application
- Submission API → Task repository: checks task
- Submission API → Cloudinary: uploads files