
Tech Stack
Description
Masar API is a backend engineering project that serves as a solid foundational boilerplate for a fleet management system using Nest.js and PostgreSQL.
The primary focus of this initial build was mastering core backend architecture, specifically setting up a modular monolith, secure authentication (Argon2 & JWT), and handling concurrency safely.
Currently, this codebase is acting as the stable core for a V2 upgrade, where the team is working on implementing a more advanced schema, real-time tracking via WebSockets, and geospatial queries using PostGIS.
- Architected a modular NestJS monolith, setting up a strong foundation for scalable feature development.
- Built a secure login system using Argon2 hashing and implemented robust session management with JWT access and refresh tokens.
- Utilized TypeORM database transactions to ensure data consistency across operations.
- Prevented race conditions during concurrent ride acceptance by successfully implementing Optimistic Locking.
Page Info
API Documentation & Structure
Interactive OpenAPI (Swagger) documentation reflecting a highly modular and scalable NestJS architecture.

Secure Authentication Flow
Implementation of JWT-based sessions and secure password hashing using Argon2.

Concurrency Control Logic
Implementing database transactions and optimistic locking to securely handle concurrent ride acceptances.

Race Condition Simulator
A custom Node.js script utilizing Promise.allSettled to simulate parallel requests, practically proving the prevention of race conditions.
