Skip to content

Local Development

ToolVersionInstall
Node.js>= 20.0.0brew install node or download from nodejs.org
pnpm>= 10npm install -g pnpm@10
DockerEngine 20+Docker Desktop or brew install docker
GitAny recentbrew install git or download from git-scm.com
  1. Fork and clone the repository

    Fork ashwineaso/theterms on GitHub, then clone your fork:

    Terminal window
    git clone https://github.com/<your-username>/theterms.git
    cd theterms
  2. Install dependencies

    TheTerms uses pnpm workspaces. Install all dependencies across the monorepo:

    Terminal window
    pnpm install
  3. Configure environment variables

    Terminal window
    cp apps/web/.env.example apps/web/.env.local

    Edit apps/web/.env.local. The database and Redis defaults work with the Docker Compose dev setup. You must generate a NEXTAUTH_SECRET:

    Terminal window
    openssl rand -base64 32

    Paste the output as the NEXTAUTH_SECRET value.

  4. Start PostgreSQL and Redis

    The development Docker Compose file provides a Postgres 16 and Redis 7 instance:

    Terminal window
    docker compose -f docker-compose.dev.yml up -d
  5. Generate Prisma client and apply the schema

    Terminal window
    pnpm db:generate # Generates the TypeScript Prisma client
    pnpm db:push # Applies the schema to the database (dev only)
  6. Start the development server

    Terminal window
    pnpm dev

    Open http://localhost:3000. Create an account to start using the app.

Terminal window
pnpm test # Run all unit and integration tests
pnpm test:coverage # With coverage report

Tests require a live PostgreSQL connection. The DATABASE_URL in .env.local must point to a running database.

Install pnpm globally: npm install -g pnpm@10

Ensure Docker containers are running: docker compose -f docker-compose.dev.yml ps

Kill the process using port 3000: lsof -i :3000 | grep LISTEN then kill <PID>