src/ contains the TypeScript core service. HTTP routes live in src/api/, background execution in src/workers/ and src/processors/, channel integrations in src/plugins/, and shared infrastructure in src/config/, src/database/, and src/utils/.
Tests are split between tests/unit and tests/integration, with helpers in tests/testutil and setup in tests/setup.ts. The Next.js admin UI lives in dashboard/. Docs and assets are in api-docs/, architecture/, and assets/.
Install dependencies with npm install and npm install --prefix dashboard.
npm run devstarts the core API withtsxandnodemon.npm run worker:dev,npm run processor:dev,npm run delayed-processor:dev, andnpm run recovery:devstart background services.npm run buildcompilessrc/todist/and rewrites path aliases.npm run startruns the compiled API fromdist/api/server.js.npm run test,npm run test:unit,npm run test:integration, andnpm run test:coveragerun tests.npm run lint:corechecks the core codebase;npm run lint:dashboardchecks the dashboard.npm run dev --prefix dashboardstarts the dashboard on port3002.
Use TypeScript with strict typing and existing @src/* path aliases. Match current style: 2-space indentation, camelCase for variables and functions, PascalCase for types, classes, and React components, and filenames such as notification.controller.test.ts.
Plan changes before writing code. Follow low-level design principles: single responsibility, clear interfaces, useful dependency inversion, and explicit error handling. Do not duplicate logic; extract shared behavior into focused utilities, services, or test helpers.
Vitest is the test runner. Integration tests also use supertest, mongodb-memory-server, and Redis mocks. Name test files with .test.ts, for example tests/unit/plugins/loader.test.ts.
Every new feature or code path must include matching tests in tests/. Add unit suites for isolated logic and integration suites for API, persistence, plugin, processor, or worker behavior.
Use short Conventional Commit style messages such as feat: add email retry policy, fix: handle missing template, or docs: update setup notes. Keep commits focused.
PRs should include a summary, linked issue when applicable, test evidence, and screenshots or GIFs for dashboard/ UI changes. Husky pre-push runs both lint commands.
Do not commit secrets. Use .env.example as the template for .env, and update it when adding configuration. For local full-stack work, prefer docker-compose.dev.yaml; for core-only work, start infrastructure with docker compose -f docker-compose.infra.yaml up -d.