From b5e1802672ecb2581ff88e6cee9c301457cd0b1e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 4 Jul 2026 11:27:55 +0000 Subject: [PATCH 1/2] docs: add Cursor Cloud environment setup notes in AGENTS.md Co-authored-by: Sanja Malovic --- AGENTS.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..ff2136f1 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ +# AGENTS.md + +## Cursor Cloud specific instructions + +Telemetry Tracker is a pnpm monorepo with three runtime services. Standard dev/lint/test/build commands live in `README.md`, `CONTRIBUTING.md`, and root `package.json` scripts — use those. The notes below only cover cloud-VM specifics and non-obvious gotchas. + +### Services + +| Service | Start command | Port | +|---------|---------------|------| +| PostgreSQL 16 | `sudo pg_ctlcluster 16 main start` | 5432 | +| API (Fastify) | `pnpm dev:api` | 3001 | +| Dashboard (Next.js) | `pnpm dev:dashboard` | 3000 | + +The dashboard reads all telemetry through the API (`API_URL`, default `http://localhost:3001`); the API needs Postgres (`DATABASE_URL`). + +### Startup gotchas + +- **Postgres runs as a native local install, not Docker.** Ignore the `docker compose up` step in the README on this VM; instead start the cluster with `sudo pg_ctlcluster 16 main start`. It is not auto-started on boot. The database is `telemetry` with user/password `postgres`/`postgres`. +- **`.env` files are required and gitignored.** If missing, recreate them: `cp apps/api/.env.example apps/api/.env` and `cp apps/dashboard/.env.example apps/dashboard/.env`. The defaults already point at the local Postgres. +- **Migrations: prefer `pnpm --filter api exec prisma migrate deploy`** (non-interactive). `pnpm db:migrate` runs `prisma migrate dev`, which can hang or prompt in a non-interactive shell. + +### Testing gotcha + +- DB integration tests need `DATABASE_URL` exported as an environment variable — `NODE_ENV=test` does **not** load `apps/api/.env`. Run: + ```bash + export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/telemetry + RUN_DB_INTEGRATION_TESTS=true pnpm test + ``` + Without these, the api Prisma integration tests fail with `Environment variable not found: DATABASE_URL`. `pnpm lint` and `pnpm build` need no special env. From e50ff92db99cbc2af16d43d337e8b816549d14a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sanja=20Malovi=C4=87?= Date: Mon, 6 Jul 2026 15:41:59 +0200 Subject: [PATCH 2/2] Revert "Merge pull request #153 from Telemetry-Tracker/cursor/setup-dev-environment-1d6f" This reverts commit f37bffe52fbe6397f746f82239cd6cd69aa251e9, reversing changes made to 155767170a3b6558d5abd83a46ffdfaa2c75ae58. --- AGENTS.md | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index ff2136f1..00000000 --- a/AGENTS.md +++ /dev/null @@ -1,30 +0,0 @@ -# AGENTS.md - -## Cursor Cloud specific instructions - -Telemetry Tracker is a pnpm monorepo with three runtime services. Standard dev/lint/test/build commands live in `README.md`, `CONTRIBUTING.md`, and root `package.json` scripts — use those. The notes below only cover cloud-VM specifics and non-obvious gotchas. - -### Services - -| Service | Start command | Port | -|---------|---------------|------| -| PostgreSQL 16 | `sudo pg_ctlcluster 16 main start` | 5432 | -| API (Fastify) | `pnpm dev:api` | 3001 | -| Dashboard (Next.js) | `pnpm dev:dashboard` | 3000 | - -The dashboard reads all telemetry through the API (`API_URL`, default `http://localhost:3001`); the API needs Postgres (`DATABASE_URL`). - -### Startup gotchas - -- **Postgres runs as a native local install, not Docker.** Ignore the `docker compose up` step in the README on this VM; instead start the cluster with `sudo pg_ctlcluster 16 main start`. It is not auto-started on boot. The database is `telemetry` with user/password `postgres`/`postgres`. -- **`.env` files are required and gitignored.** If missing, recreate them: `cp apps/api/.env.example apps/api/.env` and `cp apps/dashboard/.env.example apps/dashboard/.env`. The defaults already point at the local Postgres. -- **Migrations: prefer `pnpm --filter api exec prisma migrate deploy`** (non-interactive). `pnpm db:migrate` runs `prisma migrate dev`, which can hang or prompt in a non-interactive shell. - -### Testing gotcha - -- DB integration tests need `DATABASE_URL` exported as an environment variable — `NODE_ENV=test` does **not** load `apps/api/.env`. Run: - ```bash - export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/telemetry - RUN_DB_INTEGRATION_TESTS=true pnpm test - ``` - Without these, the api Prisma integration tests fail with `Environment variable not found: DATABASE_URL`. `pnpm lint` and `pnpm build` need no special env.