Skip to main content
This guide walks you through running the full Zuko stack locally. Follow each step in order.

Clone the repository


Install dependencies

From the repo root, install all workspace dependencies:

Configure environment variables

Copy the example env files for each service:
Then edit each file with your actual values. The required variables for each service are listed below.

Root .env

Create a .env file at the repo root for shared variables that apply across all services:
NX automatically loads the root .env for all workspace commands. Set shared variables here once instead of repeating them in each service’s .env.

Backend apps/backend/.env

Web apps/web/.env

AI Agents apps/ai-agents/.env

AGENT_TOKEN must be the same value in both apps/backend/.env and apps/ai-agents/.env. It authenticates the agents service when calling backend endpoints.

Set up the database

Create the database:
Generate the Prisma client:
Run database migrations:
Seed test data (optional): Creates a test user (e2e@example.com / TestPassword123!) and sample CRM data:
Browse the database (optional):

Set up GitHub OAuth

  1. Go to github.com/settings/developers
  2. Click New OAuth App
  3. Fill in:
    • Application name: Zuko (local)
    • Homepage URL: http://localhost:3000
    • Authorization callback URL: http://localhost:3001/auth/callback/github
  4. Copy the Client ID and generate a Client Secret
  5. Paste them into apps/backend/.env as GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET

Start the app

Recommended — start backend + frontend together:
This starts both the NestJS backend and the Next.js frontend with hot reload.

Start the AI agents service

In a separate terminal:
This starts the LangGraph agent runtime at http://localhost:8080 with LangGraph Studio for debugging.
The AI agents service is only needed if you want to use the agentic chat features. The core CRM (contacts, companies, deals) works without it.

Verify your setup

Open http://localhost:3000 — you should see the Zuko login page. Click Sign in with GitHub and authorize the OAuth app. You’ll land on the CRM dashboard. Email/password auth is enabled by default in the config above. Log in with e2e@example.com / TestPassword123! after seeding, or use Sign in with GitHub.

All commands reference


Troubleshooting

Ensure PostgreSQL is running:
Test the connection:
Check DATABASE_URL format: postgres://user:password@host:port/dbname
Clear the cached client and regenerate: bash rm -rf node_modules/.prisma/ bun nx run @zuko/models:prisma:generate
  • Ensure TRUSTED_ORIGINS in apps/backend/.env includes both http://localhost:3000 and http://localhost:3001 - Clear browser cookies and retry - Confirm the GitHub OAuth callback URL is exactly http://localhost:3001/auth/callback/github
  • Confirm NEXT_PUBLIC_BACKEND_URL=http://localhost:3001 in apps/web/.env - Make sure the backend started without errors before opening the frontend - Check the backend terminal for startup errors
bash rm bun.lockb bun install --force
Find and kill the process on the conflicting port: bash lsof -ti:3001 | xargs kill -9
  • Ensure OPENAI_API_KEY is set in apps/ai-agents/.env
  • Ensure AGENT_TOKEN matches the value in apps/backend/.env
  • The first start may be slow (downloading LangGraph CLI dependencies)
  • If port 8080 is in use, kill it: lsof -ti:8080 | xargs kill -9

Next steps

  • Explore the Concepts section to understand the architecture
  • Read the Guides to learn how to use agentic chat with CRM data
  • Add the Zuko MCP server to your AI coding agent for context-aware setup help