evolution-api/AGENTS.md
Davidson Gomes 7088ad05d2 feat: add project guidelines and configuration files for development standards
- Introduce AGENTS.md for repository guidelines and project structure
- Add core development principles in .cursor/rules/core-development.mdc
- Establish project-specific context in .cursor/rules/project-context.mdc
- Implement Cursor IDE configuration in .cursor/rules/cursor.json
- Create specialized rules for controllers, services, DTOs, guards, routes, and integrations
- Update .gitignore to exclude unnecessary files
- Enhance CLAUDE.md with project overview and common development commands
2025-09-17 15:43:32 -03:00

42 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Repository Guidelines
## Project Structure & Module Organization
- `src/` TypeScript source. Key areas: `api/controllers`, `api/routes`, `api/services`, `api/integrations/{channel,chatbot,event,storage}`, `config`, `utils`, `exceptions`.
- `prisma/` Prisma schema and migrations. Provider folders: `postgresql-migrations/`, `mysql-migrations/`. Use `DATABASE_PROVIDER` to target the provider.
- `dist/` Build output; do not edit.
- `public/` Static assets.
- `Docker*`, `docker-compose*.yaml` Local stack and deployment helpers.
## Build, Test, and Development Commands
- `npm run build` Type-check (tsc) and bundle with `tsup` to `dist/`.
- `npm run start` Run dev server via `tsx src/main.ts`.
- `npm run dev:server` Watch mode for local development.
- `npm run start:prod` Run compiled app from `dist/`.
- `npm run lint` / `npm run lint:check` Auto-fix and check linting.
- Database (choose provider): `export DATABASE_PROVIDER=postgresql` (or `mysql`), then:
- `npm run db:generate` Generate Prisma client.
- `npm run db:migrate:dev` Apply dev migrations and sync provider folder.
- `npm run db:deploy` Apply migrations in non-dev environments.
- `npm run db:studio` Open Prisma Studio.
- Docker: `docker-compose up -d` to start local services.
## Coding Style & Naming Conventions
- TypeScript, 2-space indent, single quotes, trailing commas, 120-char max (Prettier).
- Enforced by ESLint + Prettier; import order via `simple-import-sort`.
- File names follow `feature.kind.ts` (e.g., `chat.router.ts`, `whatsapp.baileys.service.ts`).
- Classes: PascalCase; functions/variables: camelCase; constants: UPPER_SNAKE_CASE.
## Testing Guidelines
- No formal suite yet. Place tests under `test/` as `*.test.ts`.
- Run `npm test` (watches `test/all.test.ts` if present). Prefer fast, isolated unit tests.
## Commit & Pull Request Guidelines
- Conventional Commits enforced by commitlint. Use `npm run commit` (Commitizen).
- Examples: `feat(api): add message status`, `fix(route): handle 404 on send`.
- PRs: include clear description, linked issues, migration impact (provider), local run steps, and screenshots/logs where relevant.
## Security & Configuration
- Copy `.env.example` to `.env`; never commit secrets.
- Set `DATABASE_PROVIDER` before DB commands; see `SECURITY.md` for reporting vulnerabilities.