Local Development
Set up the AACsearch monorepo for local development — prerequisites, environment variables, Docker services, and running the apps.
AACsearch is a pnpm + Turborepo monorepo. This page covers the full local setup from a fresh clone to a running SaaS dashboard and docs site.
Prerequisites
| Tool | Version | Install |
|---|---|---|
| Node.js | 20+ | nodejs.org |
| pnpm | 10.28+ | npm i -g pnpm |
| Docker | Latest | docker.com |
Clone and install
git clone <repo-url> AACSearch
cd AACSearch
pnpm installpnpm will bootstrap all workspace packages. First install may take 2–3 minutes.
Start Docker services
The monorepo requires Postgres (database) and MinIO (S3-compatible object storage):
docker compose up -dThis starts:
- Postgres on port
5432— application database - MinIO on ports
9000(API) and9001(console) — file storage
Verify services are healthy:
docker compose psAACSearch
You also need a running search engine instance. The simplest approach for local dev:
docker run -d \
-p 8108:8108 \
-v /tmp/aacsearch-data:/data \
aacsearch/search-engine:latest \
--data-dir /data \
--api-key=your-local-admin-key \
--listen-port 8108Set AACSEARCH_API_KEY and AACSEARCH_HOST in your environment file (see below).
Environment variables
Copy the example file:
cp .env.local.example .env.localKey variables to configure:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/AACSearch"
# Auth
BETTER_AUTH_SECRET="your-local-secret-at-least-32-chars"
BETTER_AUTH_URL="http://localhost:3000"
# AACSearch
AACSEARCH_HOST="localhost"
AACSEARCH_PORT="8108"
AACSEARCH_PROTOCOL="http"
AACSEARCH_API_KEY="your-local-admin-key"
# Storage (MinIO)
STORAGE_ENDPOINT="http://localhost:9000"
STORAGE_BUCKET="AACSearch"
STORAGE_ACCESS_KEY="minioadmin"
STORAGE_SECRET_KEY="minioadmin"
# App URLs
NEXT_PUBLIC_SAAS_URL="http://localhost:3000"
NEXT_PUBLIC_MARKETING_URL="http://localhost:3001"Note: Prisma reads from .env, not .env.local. Copy .env.local to .env for Prisma CLI commands:
cp .env.local .envDatabase setup
Generate the Prisma client and apply migrations:
pnpm --filter @repo/database generate
pnpm --filter @repo/database push # dev: apply schema directlyPrisma Studio (optional visual DB browser):
pnpm --filter @repo/database studioOpens on port 5555.
Run the apps
Run all apps simultaneously (recommended for development):
pnpm devOr run individual apps:
pnpm dev --filter=saas # SaaS dashboard → http://localhost:3000
pnpm dev --filter=marketing # Marketing site → http://localhost:3001
pnpm dev --filter=docs # Docs site → http://localhost:3002Turborepo runs all tasks with concurrency 15 and caches build outputs.
Verify setup
- Open
http://localhost:3000— you should see the AACsearch login page - Create an account via the signup form
- Create an organization
- Navigate to the search section
- Create a search index — this creates the search index
If AACSearch is not reachable, the index creation will fail with a search_connection_error and
you will see it in the dashboard error state.
Type-check and lint
pnpm type-check # TypeScript type checking (all packages)
pnpm lint # Oxlint (NOT ESLint)
pnpm lint:fix # Auto-fix lint issues
pnpm format # Oxfmt (NOT Prettier)
pnpm format:check # Check formatting onlyUseful commands
# Build widget bundle (needed for widget dev)
pnpm --filter @repo/widget build
# Reset database (DESTRUCTIVE — drops all data)
docker compose down -v && docker compose up -d
pnpm --filter @repo/database push
# Clear Turborepo cache
pnpm clean
# Build everything
pnpm buildTroubleshooting
Cannot find module '@repo/...' — run pnpm install from the repo root.
Prisma DATABASE_URL empty — Prisma reads .env, not .env.local. Run cp .env.local .env.
Prisma Client not generated — run pnpm --filter @repo/database generate.
BigInt serialization error — a procedure is missing .transform(v => v.toString()) on BigInt output fields.
Build OOM on macOS — set NODE_OPTIONS='--max-old-space-size=12288' pnpm build.