Setup and run caveats for Cursor Cloud agents. The startup update script already
runs pnpm install and generates the Prisma client. The notes below cover only
the non-obvious caveats.
@cortex/api(NestJS, port 4000) — core product (MCP entrypoint + auth). Needs Postgres + env vars.@cortex/web(Next.js, port 3000) and@cortex/docs(port 3001) — run cleanly viapnpm --filter @cortex/web dev/--filter @cortex/docs dev. Currently default Turborepo starter pages.- Standard commands (
pnpm lint|check-types|build|test|dev) are incommands.md. All pass.
docker/docker-composeare NOT available; Postgres 16 is installed via apt instead. Data, thecortexrole/db, and the applied schema persist in the VM snapshot.- Start it (not auto-started on boot):
sudo pg_ctlcluster 16 main start. - Connection (matches
../../docker-compose.yml):postgresql://cortex:cortex@localhost:5432/cortex.
- The API reads
process.envdirectly (no dotenv autoload). Export vars before running:set -a; . /workspace/.env; set +a. /workspace/.envexists (gitignored, persists in snapshot) with dev values forDATABASE_URLandJWT_SECRET.JWT_SECRETis required or@cortex/apifails to boot.
prisma migrate deploy/db:migratefail with "datasource.url property is required":../../packages/db/prisma.config.tsusesenv["DATABASE_URL"]which does not resolve fromprocess.envin Prisma 7.- The committed migration SQL has already been applied to the DB. To re-apply on a fresh DB, run the files in
../../packages/db/prisma/migrations/*/migration.sqldirectly withpsql.
The API builds, type-checks, lints, and its 53 jest tests pass, but it cannot be booted by the committed scripts as-is:
../../apps/api/tsconfig.jsonpathsmapdb/clientto a.tssource file;nest build/nest startemit a require to that.ts, sonode dist/...andnest start --watchfail (this is the "dev/build not stable yet" note incommands.md). The runnable compiled entry isapps/api/dist/apps/api/src/main.js, notdist/main.js.- The Prisma 7 client needs a driver adapter (
@prisma/adapter-pg), butPrismaServiceconstructsPrismaClient()with no adapter, so it throws at boot.
Fully running the API therefore requires small code/config fixes (wire @prisma/adapter-pg into PrismaService, correct the db package paths/exports). Until then, prefer the unit tests and the web/docs apps for verification.
pnpm testpasses (@cortex/shared21,@cortex/api53). The "API/DB test scripts intentionally fail" note intesting.mdis outdated for@cortex/api;dbsimply has notestscript.- API tests mock
db/client(../../apps/api/src/__mocks__/db-client.mock.ts), so they need no database.