-
Notifications
You must be signed in to change notification settings - Fork 4
User management Service
Francois edited this page Mar 8, 2026
·
1 revision
Brief overview of the Users service
Layered architecture:
Request -> Routes -> Controllers -> Services -> Data (Prisma)
- Routes: endpoint declaration + schema binding (Zod)
- Controllers: HTTP orchestration (request/response, events)
- Services: business rules, validation, conflict checks
- Data layer: Prisma persistence + upload file write
- Gateway validates JWT and injects
x-user-id/x-user-name. - Users service reads those headers in preHandler.
- Profile lifecycle events are pushed to Redis stream
user.events(USER_CREATED,USER_UPDATED,USER_DELETED).
fastifyfastify-type-provider-zodzod@prisma/client@fastify/multipartfile-typeioredis
Public base path through gateway: /api/users
Resources : profiles, users
cf Doc
Current test coverage exists at 3 levels: controllers (with injection of http request), unit tests for service and data layers.
Using shared core avoids type/schema drift between services and keeps error handling consistent.
- DTO and schema contracts: profile/friend payloads and response schemas, reused by frontend
-
Error model:
AppError+ERR_DEFS - Common constants: log actions/resources, event names
- Gateway Service - API Gateway & JWT validation
- Auth Service - Authentication & 2FA/TOTP
- AI Service - AI opponent
- API Documentation - OpenAPI/Swagger
- DB Schema - Databases
- Fastify - Web framework
- Prisma - ORM
- WebSockets - Real-time communication
- Restful API - API standards
- React - UI library
- CSS - Styling
- Tailwind - CSS framework
- Accessibility - WCAG compliance
- TypeScript - Language
- Zod - Schema validation
- Nginx - Reverse proxy
- Logging and Error management - Observability
- OAuth 2.0 - Authentication flows
- Two-factor authentication - 2FA/TOTP
- Avalanche - Blockchain network
- Hardhat - Development framework
- Solidity - Smart contracts language
- Open Zeppelin - Security standards
- ESLint - Linting
- Vitest - Testing
- GitHub Actions - CI/CD
- Husky, Commit lints and git hooks - Git hooks
- ELK - Logging stack
๐ Page model