Quickstart¶
Prerequisites¶
- Node.js 20+
- PostgreSQL 16+ (or use Docker)
- npm
Install and configure¶
npm install
cd packages/api
cp .env.example .env
Edit packages/api/.env with your database connection string (PORT defaults to 3001).
Run database migrations¶
npm run db:migrate
Don't use prisma migrate dev / prisma migrate diff against a shared dev database
authstack's dev Postgres instance also holds other services' tables. Migrations in this repo are
hand-written SQL files under packages/api/prisma/migrations/ — running a schema-diffing Prisma
command against a shared database can propose dropping tables that belong to something else
entirely.
Start everything¶
npm run dev
This starts, from the repo root:
| Service | URL |
|---|---|
| API server | http://localhost:3001 |
| Admin Portal | http://localhost:5173 |
| Organization Portal | http://localhost:5174 |
Each can also be run individually: npm run dev:api, npm run dev:admin-ui, npm run dev:org-ui.
Docker¶
docker-compose up -d
Useful commands¶
npm run build # build all packages
npm run test # run the test suite
npm run db:studio # open Prisma Studio
MCP server and agent¶
packages/mcp exposes the API as a read-only MCP server for
Claude Code / Claude Desktop, and packages/agent is a conversational CLI built on top of it. Both
are optional and not part of npm run dev — see the root README.md for setup.