A chat application backend built with microservices architecture. The system uses a monorepo structure with TypeScript, Express.js, and MySQL.
microServices/
├── packages/
│ └── common/ # Shared utilities
│ ├── logger.ts # Pino-based logging
│ ├── env.ts # Environment validation (Zod)
│ ├── errors/ # HTTP error classes
│ └── http/ # Request validation
│
└── services/
└── auth-service/ # Authentication service
├── config/ # Environment configuration
├── db/ # Sequelize ORM setup
├── middleware/ # Error handling
├── routes/ # API endpoints
└── utils/ # Service utilities
Client Request
│
├── Security Headers (Helmet)
├── Cross-Origin Control (CORS)
├── Body Parsing (JSON)
├── Route Handler
└── Error Handler
│
Response
Handles user authentication and registration.
- Port: 6000
- Database: MySQL 8.0
- ORM: Sequelize
- Security: Helmet, CORS
- Error handling: Centralized middleware
- Runtime: Node.js + TypeScript
- Framework: Express.js v5.2.1
- Database: MySQL 8.0 (Docker)
- ORM: Sequelize v6.37.7
- Validation: Zod
- Logging: Pino
- Package Manager: pnpm (workspaces)
- Development: tsx, ESLint, Prettier
pnpm dev- Start all services in development modepnpm build- Build all servicespnpm lint- Run ESLint across all packagespnpm format- Check code formatting with Prettier
Shivam Karna
- GitHub: @ShivamKarna
ISC License
