Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Codefied-CodePix/Karokar-backend/llms.txt

Use this file to discover all available pages before exploring further.

KaroKar Backend is a production-ready REST API built with NestJS and TypeScript that powers a B2B2C mobility marketplace. The platform connects three participant types — Vendors who list and rent vehicles, Corporate Organizations that manage fleets for their workforce, and Corporate Employees who book and use those vehicles day-to-day. Platform Administrators oversee the entire ecosystem, handling vendor and corporate onboarding, approvals, and moderation. Rather than a loosely coupled set of microservices, the backend is deliberately structured as a domain-driven modular monolith: all eight business domains ship as a single deployable unit while maintaining strict boundaries through domain events and permission-based authorization.

Participant Model

The three core participant types and their relationships:
ParticipantRole
VendorOwns and manages vehicles; listed on the platform after approval
Corporate OrganizationSubscribes to fleet services; manages employee access and assignments
Corporate EmployeeBooks available vehicles within their organization’s allocation
Platform Administrators sit above all three types, controlling approval workflows through the Administration domain.

Bounded Contexts

The application is organized into eight bounded contexts, each a self-contained NestJS module that owns its own entities, services, repositories, and business rules. Cross-domain communication happens exclusively through domain events — no domain imports services or repositories from another.

Identity

Users, roles, authentication, authorization, and organization membership. The foundation every other domain depends on via events and permission tokens.

Fleet

Vehicles, vehicle documents, availability windows, status transitions, maintenance records, and suspension workflows.

Booking

Booking requests, the full booking lifecycle state machine, and reservation period management.

Assignment

Corporate employee-to-vehicle allocation and the handover lifecycle for long-term assignments.

Verification

A generic verification framework for any entity on the platform, with hooks for future NADRA and government integrations.

Notification

Event-driven notification dispatch across email, SMS, and push channels — entirely driven by domain events from other contexts.

Audit

Immutable compliance records and change history generated automatically by subscribing to domain events. Business domains never call audit services directly.

Administration

Vendor approval, corporate approval, and platform-wide moderation workflows.

Tech Stack

LayerTechnology
Runtime frameworkNestJS 11 (TypeScript 5)
DatabasePostgreSQL 16 via TypeORM 0.3
AuthenticationJWT (@nestjs/jwt, passport-jwt)
Domain events@nestjs/event-emitter 3 (wildcard, in-process)
Validationclass-validator + class-transformer
Config@nestjs/config with .env file
Primary keysUUID v4 throughout
Every entity carries an organizationId for multi-tenant isolation, and authorization is always permission-based (e.g. booking.create) — never a raw role-name check.

Where to Go Next

Quickstart

Clone the repo, configure your environment, run migrations, and make your first API call in under five minutes.

Architecture

Understand the ADR behind the modular monolith decision, module file structure, and the non-negotiable architectural rules.

Build docs developers (and LLMs) love