Local Development
Prerequisites
Section titled “Prerequisites”| Tool | Version | Install |
|---|---|---|
| Node.js | >= 20.0.0 | brew install node or download from nodejs.org |
| pnpm | >= 10 | npm install -g pnpm@10 |
| Docker | Engine 20+ | Docker Desktop or brew install docker |
| Git | Any recent | brew install git or download from git-scm.com |
-
Fork and clone the repository
Fork ashwineaso/theterms on GitHub, then clone your fork:
Terminal window git clone https://github.com/<your-username>/theterms.gitcd theterms -
Install dependencies
TheTerms uses pnpm workspaces. Install all dependencies across the monorepo:
Terminal window pnpm install -
Configure environment variables
Terminal window cp apps/web/.env.example apps/web/.env.localEdit
apps/web/.env.local. The database and Redis defaults work with the Docker Compose dev setup. You must generate aNEXTAUTH_SECRET:Terminal window openssl rand -base64 32Paste the output as the
NEXTAUTH_SECRETvalue. -
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 -
Generate Prisma client and apply the schema
Terminal window pnpm db:generate # Generates the TypeScript Prisma clientpnpm db:push # Applies the schema to the database (dev only) -
Start the development server
Terminal window pnpm devOpen http://localhost:3000. Create an account to start using the app.
Running Tests
Section titled “Running Tests”pnpm test # Run all unit and integration testspnpm test:coverage # With coverage reportTests require a live PostgreSQL connection. The DATABASE_URL in .env.local must point to a running database.
Troubleshooting
Section titled “Troubleshooting”command not found: pnpm
Section titled “command not found: pnpm”Install pnpm globally: npm install -g pnpm@10
db:push fails with connection error
Section titled “db:push fails with connection error”Ensure Docker containers are running: docker compose -f docker-compose.dev.yml ps
Port 3000 already in use
Section titled “Port 3000 already in use”Kill the process using port 3000: lsof -i :3000 | grep LISTEN then kill <PID>