-
Notifications
You must be signed in to change notification settings - Fork 1
fix: resolve Prisma schema relations, DI issues, and add dev environment setup #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Cursor Cloud specific instructions | ||
|
|
||
| ### Services Overview | ||
|
|
||
| | Service | How to run | Port | | ||
| |---------|-----------|------| | ||
| | Backend (NestJS) | `cd backend && npm run start:dev` | 4000 | | ||
| | Bot SDK | `cd bot-sdk && npm run build` | N/A (library) | | ||
|
|
||
| ### Backend Dev Server | ||
|
|
||
| - **Start**: `cd backend && npm run start:dev` (uses nodemon + ts-node) | ||
| - **Health check**: `GET http://localhost:4000/api/v1/health` | ||
| - **API prefix**: `/api/v1` | ||
| - **WebSocket**: `ws://localhost:4000` (Socket.IO) | ||
|
|
||
| ### Prerequisites (must be running before backend starts) | ||
|
|
||
| - **PostgreSQL** on `localhost:5432` — database `flowspace`, user `flowspace`/`flowspace` | ||
| - **Redis** on `localhost:6379` — used for Socket.IO horizontal scaling; backend gracefully falls back to in-memory adapter if unavailable | ||
|
|
||
| Start services: | ||
|
|
||
| ```bash | ||
| sudo pg_ctlcluster 16 main start | ||
| sudo redis-server --daemonize yes | ||
| ``` | ||
|
|
||
| ### Key Gotchas | ||
|
|
||
| 1. **Prisma schema requires manual relation fixes**: The `Bot` and `BotMessage` models reference `Workspace`, `Channel`, and `ChatMessage` but the reverse relation fields (`bots Bot[]`, `botMessages BotMessage[]`) must be present on those models. Run `npx prisma generate` after any schema changes. | ||
|
|
||
| 2. **`projectTemplates.json` required at startup**: The backend TemplateService throws at boot if `backend/config/projectTemplates.json` doesn't exist. A minimal seed file is committed. | ||
|
|
||
| 3. **Module DI for `JwtAuthGuard`**: Any NestJS module using `@UseGuards(JwtAuthGuard)` must import `AuthModule` (which exports `AuthService`). | ||
|
|
||
| 4. **`.env` location**: The backend reads environment from `backend/.env` (via `@nestjs/config`). The committed `env.development` uses Docker service hostnames; for local dev, create `.env` with `localhost` addresses (DATABASE_URL, REDIS_URL, etc.). | ||
|
|
||
| 5. **TypeScript checking**: `npm run build` runs `prisma generate && nest build`. For type-only checking use `npx tsc --noEmit` from the backend directory. | ||
|
|
||
| 6. **No ESLint configured**: The project does not have an ESLint config. TypeScript compilation (`tsc --noEmit`) is the primary static analysis. | ||
|
|
||
| 7. **MinIO/S3 and LiveKit are optional**: File vault and video meeting features require these services but the backend starts fine without them. | ||
|
|
||
| ### Test Account (local dev) | ||
|
|
||
| ```text | ||
| Email: dev@flowspace.app | ||
| Password: TestPass123! | ||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded credentials committed to source controlMedium Severity Plaintext credentials (database password Additional Locations (1)Reviewed by Cursor Bugbot for commit 8b5229e. Configure here. |
||
|
|
||
| Or register via `POST /api/v1/auth/register` with `{ email, password, name }`. | ||
|
|
||
| ### Flutter Client | ||
|
|
||
| The Flutter client (`client_flutter/`) targets desktop (Windows primary) and mobile. It requires the Flutter SDK and cannot be run in headless Cloud Agent environments. Focus backend development on the NestJS API server. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "version": "1.0.0", | ||
| "templates": [ | ||
| { | ||
| "id": "kanban", | ||
| "name": "Kanban Board", | ||
| "description": "Simple task management with columns: To Do, In Progress, Done", | ||
| "backgroundModule": "kanban", | ||
| "tools": ["tasks", "labels", "assignments"], | ||
| "defaultBoards": ["kanban"], | ||
| "defaultSettings": { | ||
| "columns": ["To Do", "In Progress", "Done"] | ||
| } | ||
| }, | ||
| { | ||
| "id": "storyboard", | ||
| "name": "Storyboard", | ||
| "description": "Visual storyboard for creative projects", | ||
| "backgroundModule": "storyboard", | ||
| "tools": ["scenes", "characters", "notes"], | ||
| "defaultBoards": ["storyboard"], | ||
| "defaultSettings": { | ||
| "layout": "grid" | ||
| } | ||
| }, | ||
| { | ||
| "id": "sprint", | ||
| "name": "Sprint Planning", | ||
| "description": "Agile sprint planning with backlog and sprint boards", | ||
| "backgroundModule": "agile", | ||
| "tools": ["tasks", "sprints", "velocity"], | ||
| "defaultBoards": ["backlog", "kanban"], | ||
| "defaultSettings": { | ||
| "sprintLength": 14, | ||
| "columns": ["Backlog", "To Do", "In Progress", "Review", "Done"] | ||
| } | ||
| } | ||
| ] | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.


Uh oh!
There was an error while loading. Please reload this page.