Masar API - Fleet Management

Backend
Web Dev
Masar API - Fleet Management

Tech Stack

Nest.js
PostgreSQL
TypeScript
TypeORM

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.

/projects/masar/swagger-ui.png

Secure Authentication Flow

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

/projects/masar/postman-auth.png

Concurrency Control Logic

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

/projects/masar/locking-code.png

Race Condition Simulator

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

/projects/masar/simulator-output.png

    Mohammad Abdulhakim - Software Engineer | Aspiring AI Engineer