Skip to content

Local Development Guide

This guide provides the necessary information to set up and run the Majestic Transport monorepo locally for development and testing.

Prerequisites

Before you begin, ensure you have the following installed on your machine:

  • Node.js (LTS version recommended)
  • pnpm (The preferred package manager for the monorepo)
  • Docker (For running the database locally)

Getting Started

Follow these steps to set up your local development environment:

  1. Clone the Repository:

    bash
    git clone <repository-url>
    cd majestic-transport
  2. Install Dependencies:

    bash
    pnpm install
  3. Set Up Environment Variables: Each application has its own .env.example file. Copy these files to .env and configure them for your local environment.

  4. Start the Local Database:

    bash
    docker-compose up -d
  5. Initialize the Database: Run the migrations for the API to set up the database schema.

    bash
    pnpm --filter @majestic-transport/api db:migrate

Common Commands

The monorepo uses Turborepo to manage tasks efficiently. You can run commands from the root or within specific application directories.

CommandDescription
pnpm devStarts all applications in development mode simultaneously.
pnpm buildBuilds all applications and packages for production.
pnpm lintRuns linting across the entire monorepo.
pnpm testExecutes the test suite for all applications and packages.

Application-Specific Commands

You can use the --filter flag with pnpm to run commands for specific applications or packages:

  • Start only the API: pnpm --filter @majestic-transport/api dev
  • Start only the Admin Panel: pnpm --filter @majestic-transport/admin dev
  • Start only the Driver App: pnpm --filter @majestic-transport/driver start

Contributing Guidelines

Always follow the established architectural patterns and coding standards when contributing to the Majestic Transport monorepo. Refer to the System Overview and the documentation for each application and package for specific guidance.