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 --activate1. Clone and install
git clone https://github.com/aetadmin/weworks.git
cd weworks
yarn install2. Start PostgreSQL
Using Docker (easiest):
docker compose up -d weworks_postgresOr 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/.envFor 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:3001Client — copy and edit:
cp apps/client/.env.example apps/client/.envFor local dev:
API_URL=http://localhost:5003
NEXT_PUBLIC_API_URL=http://localhost:5003
NEXT_PUBLIC_AUTH_URL=http://localhost:30014. 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 devTurbo starts all apps in parallel:
| App | URL |
|---|---|
| Landing | http://localhost:3000 |
| Client | http://localhost:3001 |
| Docs | http://localhost:3002 |
| API | http://localhost:5003 |
Run a subset:
yarn dev --filter=client --filter=api6. Log in
Open http://localhost:3001 and sign in with:
admin@admin.com / 1234Common tasks
Build for production
yarn buildLint
yarn lintReset database
cd apps/api
yarn prisma migrate resetAPI-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/*andpackages/* - 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
- Architecture
- User Roles
- Translations
- Root
INSTALL.mdfor production server setup on small AWS instances