Compare commits

..

2 Commits

Author SHA1 Message Date
Cursor Agent
9694dbd4f9 docs: add .cursor/CLOUD.md with development guide for cloud agents
Co-authored-by: Vikhyath Mondreti <icecrasher321@users.noreply.github.com>
2026-02-09 21:29:29 +00:00
Cursor Agent
8361b74d7e docs: add .cursor/CLOUD.md for cloud agent development guide
Co-authored-by: Vikhyath Mondreti <icecrasher321@users.noreply.github.com>
2026-02-09 21:18:42 +00:00

View File

@@ -1,38 +1,45 @@
# Sim Cloud Agent Guide
# Sim Studio - Cloud Agent Development Guide
## Project Overview
## Overview
Sim is an AI agent workflow builder. Turborepo monorepo with Bun workspaces.
Sim Studio is a monorepo for building and deploying AI agent workflows. See `CLAUDE.md` and `README.md` for architecture, coding standards, and integration guidelines.
### Services
## Services
| Service | Port | Command |
|---------|------|---------|
| Next.js App | 3000 | `bun run dev` (from root) |
| Realtime Socket Server | 3002 | `cd apps/sim && bun run dev:sockets` |
| Both together | 3000+3002 | `bun run dev:full` (from root) |
| Docs site | 3001 | `cd apps/docs && bun run dev` |
| PostgreSQL (pgvector) | 5432 | Docker container `simstudio-db` |
| Service | Command | Port | Notes |
|---------|---------|------|-------|
| Next.js app | `bun run dev` (from root) | 3000 | Main application |
| Socket.IO realtime | `bun run dev:sockets` (from `apps/sim`) | 3002 | Collaborative editing |
| Both together | `bun run dev:full` (from `apps/sim` or root) | 3000, 3002 | Recommended for development |
| Docs | `bun run dev` (from `apps/docs`) | 3001 | Optional documentation site |
| PostgreSQL + pgvector | Docker container | 5432 | Required database |
## Common Commands
## Key Commands
- **Lint**: `bun run lint:check` (read-only) or `bun run lint` (auto-fix)
- **Format**: `bun run format:check` (read-only) or `bun run format` (auto-fix)
- **Test**: `bun run test` (all packages via turborepo)
- **Test single app**: `cd apps/sim && bunx vitest run`
- **Type check**: `bun run type-check`
- **Dev**: `bun run dev:full` (Next.js app + realtime socket server)
- **DB migrations**: `cd packages/db && bunx drizzle-kit migrate --config=./drizzle.config.ts`
- **Lint**: `bun run lint:check` (biome check, no auto-fix) or `bun run lint` (with auto-fix)
- **Format**: `bun run format:check` or `bun run format` (with auto-fix)
- **Test**: `bun run test` (runs vitest via turbo across packages)
- **Type-check**: `bun run type-check` (runs tsc --noEmit via turbo)
- **Dev**: `bun run dev:full` from root or `apps/sim` (starts Next.js + Socket.IO)
## Architecture Notes
## Database
- Package manager is **bun** (not npm/npx). Use `bun` and `bunx`.
- Linter/formatter is **Biome** (not ESLint/Prettier).
- Testing framework is **Vitest** with `@sim/testing` for shared mocks/factories.
- Database uses **Drizzle ORM** with PostgreSQL + pgvector.
- Auth is **Better Auth** (session cookies).
- Pre-commit hook runs `bunx lint-staged` which applies `biome check --write`.
- `.npmrc` has `ignore-scripts=true`.
- Docs app requires `fumadocs-mdx` generation before type-check (`bunx fumadocs-mdx` in `apps/docs/`).
- Coding guidelines are in `CLAUDE.md` (root) and `.cursor/rules/*.mdc`.
- See `.github/CONTRIBUTING.md` for contribution workflow details.
- PostgreSQL with pgvector extension, connection via `DATABASE_URL` in `.env` files
- Migrations: `cd packages/db && bunx drizzle-kit migrate --config=./drizzle.config.ts`
- Schema push (no migration files): `cd packages/db && bunx drizzle-kit push --config=./drizzle.config.ts`
- Two `.env` files are needed: `apps/sim/.env` and `packages/db/.env` (both need `DATABASE_URL`)
## Testing
- Framework: Vitest (config at `apps/sim/vitest.config.ts`)
- Use `@sim/testing` mocks/factories (see `.cursor/rules/sim-testing.mdc`)
- Tests run in parallel with thread pool
- Run specific test: `cd apps/sim && bunx vitest run path/to/test.test.ts`
## Important Notes
- Package manager is **bun** (not npm/pnpm). Use `bun` and `bunx` commands.
- The docs app requires `fumadocs-mdx` generation before type-check: `cd apps/docs && bunx fumadocs-mdx`
- Pre-commit hook runs `bunx lint-staged` which applies biome check with auto-fix
- Social provider warnings (GitHub/Google missing clientId) during startup are expected in local dev
- Redis warnings ("REDIS_URL not configured") are expected - app runs in single-pod mode locally