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 the server-side engine for KaroKar, a B2B2C mobility marketplace. Built as a domain-driven modular monolith with NestJS and PostgreSQL, it exposes REST APIs for vehicle fleet management, booking lifecycle orchestration, employee assignments, multi-tenant identity, and compliance auditing — all secured with permission-based JWT authentication.

Quickstart

Set up the backend locally and make your first API call in minutes.

Architecture

Understand the modular monolith structure and 8 bounded contexts.

API Reference

Explore every endpoint, request schema, and response shape.

Core Concepts

Learn multi-tenancy, event-driven design, and authorization patterns.

What KaroKar Does

KaroKar connects three types of participants on a single platform:
  • Vendors — organizations that own and rent out vehicle fleets
  • Corporate Organizations — companies that book vehicles for their employees
  • Employees — end users who receive and use the assigned vehicles
The backend manages the full lifecycle of this marketplace: from vendor onboarding and fleet registration, through booking negotiation and approval, to employee assignment and operational completion.

Key Features

Booking State Machine

A strict 9-state lifecycle (DRAFT → COMPLETED/TERMINATED) with validated transitions and domain events at every step.

Fleet & Availability Engine

Time-based vehicle availability with conflict detection — supports reservations, maintenance windows, and suspensions.

Permission-Based Authorization

RBAC with fine-grained resource.action permissions scoped to organizational context.

Event-Driven Architecture

Domains communicate exclusively via domain events — zero direct cross-domain service calls.

Multi-Tenant Isolation

Every entity carries an organizationId. All queries are tenant-scoped by design.

Verification Framework

Generic verification for organizations, users, and vehicles with expiry tracking and document references.

Getting Started

1

Clone and install

Clone the repository and install dependencies with your preferred Node package manager.
2

Configure environment

Copy .env.example to .env and set your PostgreSQL connection string and JWT secret.
3

Run migrations

Apply the database schema using the TypeORM migration CLI.
4

Start the server

Launch the NestJS dev server and authenticate to get a JWT for your first API call.
See the Quickstart guide for the full step-by-step walkthrough with commands and code examples.

Build docs developers (and LLMs) love