Local Development

Local Development

This guide sets up the WeWorks monorepo on your machine for development.

Prerequisites

  • Node.js 18+ (20 recommended)
  • Yarn 4.2.2 via Corepack
  • PostgreSQL 15 (local install or Docker)
  • Git

Enable Yarn:

corepack enable
corepack prepare yarn@4.2.2 --activate

1. Clone and install

git clone https://github.com/aetadmin/weworks.git
cd weworks
yarn install

2. Start PostgreSQL

Using Docker (easiest):

docker compose up -d weworks_postgres

Or use a local PostgreSQL instance and create a database named weworks.

3. Configure environment

API — copy and edit:

cp apps/api/.env.example apps/api/.env

For local Docker Postgres:

DATABASE_URL=postgresql://weworks:WeWorks3133@localhost:5432/weworks?schema=public
SECRET=dev-secret
JWT_SECRET=dev-jwt-secret
PORT=5003
FRONTEND_URL=http://localhost:3001

Client — copy and edit:

cp apps/client/.env.example apps/client/.env

For local dev:

API_URL=http://localhost:5003
NEXT_PUBLIC_API_URL=http://localhost:5003
NEXT_PUBLIC_AUTH_URL=http://localhost:3001

4. Database migrate and seed

cd apps/api
yarn prisma migrate deploy
yarn prisma db seed
cd ../..

5. Run all apps

From the repo root:

yarn dev

Turbo starts all apps in parallel:

AppURL
Landinghttp://localhost:3000
Clienthttp://localhost:3001
Docshttp://localhost:3002
APIhttp://localhost:5003

Run a subset:

yarn dev --filter=client --filter=api

6. Log in

Open http://localhost:3001 and sign in with:

admin@admin.com / 1234

Common tasks

Build for production

yarn build

Lint

yarn lint

Reset database

cd apps/api
yarn prisma migrate reset

API-only changes

The API uses ts-node-dev with hot reload — save files in apps/api/src to restart automatically.

Client API proxy

The client proxies /api/v1/* to API_URL. Ensure the API is running on port 5003 before using authenticated features.

Project conventions

  • Monorepo: workspaces in apps/* and packages/*
  • i18n: translation files at apps/client/locales/{locale}/weworks.json
  • UI: shadcn components under apps/client/@/shadcn/
  • Roles: enforced in API (ticket-group.ts) and reflected in client sidebar/nav

Further reading