Thank you for contributing to DEEIX Chat.
- Search existing issues and pull requests before opening a new one.
- Keep changes focused. Avoid unrelated refactors in feature or bug-fix pull requests.
- For security issues, follow SECURITY.md instead of opening a public issue.
Install all workspace dependencies:
pnpm installRun the shared quality and test pipelines:
pnpm check
pnpm test
pnpm buildUse pnpm dev, pnpm dev:web, or pnpm dev:api for local development.
Use the example configuration files for local development. Do not commit local secrets or production credentials.
- Explain the problem and the approach.
- Include tests for behavior changes when practical.
- Update documentation when user-facing behavior, deployment steps, API contracts, or configuration changes.
- Commit generated artifacts only when the project requires them. API contract changes must include the generated Swagger files and
packages/api-contract/src/types.generated.ts. - Do not commit caches, build output,
.pycfiles,.envfiles, or local storage data.
Use the type: subject format for every commit message subject.
Use only English letters, numbers, spaces, periods, hyphens, and underscores in the subject.
Allowed types:
buildchorecidocsfeatfixperfrefactorrevertstyletest
Examples:
feat: add model routing priorityfix: handle expired refresh tokensrefactor: simplify channel lookup
Commit message subjects that do not match this format will fail CI.
frontend/owns the user interface, client-side state, message rendering, and admin/user workflows.backend/owns business APIs, authentication, authorization, model routing, file processing, billing, audit logs, and persistence.docker/contains optional local services for document extraction, OCR, and related runtime dependencies.- The frontend should not duplicate backend authorization, billing, provider routing, or file-processing business rules.
- Keep cross-cutting concerns such as security, tracing, storage, and provider clients behind backend infrastructure boundaries.
- Backend startup flows through
cmd -> internal/cli -> internal/app. - Backend requests flow through
transport/http -> application -> repository interfaces -> infra implementations. - Domain packages own core business types and constants. Shared packages provide reusable response, request metadata, and security helpers.
- Database tables are grouped by domain, including identity, conversations, files/RAG, model routing, tools, billing, settings, audit logs, and system events.
- Financial records, audit logs, system events, file objects, and vector data should remain separate sources of truth.
- Standard HTTP responses use
errorMsg + data; do not introduce alternate response envelopes. - User data access must be scoped by authenticated user context unless an admin-only path explicitly requires broader access.
- Request IDs, structured logs, audit records, and generated Swagger files are part of the operational contract.
- Backend HTTP DTOs and Swagger annotations are the single source of truth for transport contracts.
backend/docs/docs.go,backend/docs/swagger.json,backend/docs/swagger.yaml, andpackages/api-contract/src/types.generated.tsare generated together. Never edit them manually.- After changing a route, HTTP DTO, JSON tag, validation tag, response document, or Swagger annotation, run
pnpm api:generatefrom the repository root.cd backend && make swaggerinvokes the same pipeline. - Run
pnpm api:checkbefore submitting. It regenerates into a temporary directory and rejects Swagger or TypeScript drift without modifying the worktree. - Requiredness, optionality, and nullability must be correct in backend DTOs. Use JSON and validation tags deliberately; use pointer fields when omission must be distinguished from an explicit zero,
false, or empty value. - Frontend transport types must import from
@deeix/api-contract. Do not copy generated request or response fields into local interfaces and do not repair generated contracts withRequired<>. - Frontend API adapters may use
Omit, intersections, or narrow unions only for a real UI/domain invariant. Keep form state and view models separate from wire contracts. - New HTTP endpoints must expose Swagger contracts before the frontend consumes them. Do not introduce a second handwritten transport schema as a shortcut.
Read the backend documentation index before making backend changes:
Core expectations:
- keep HTTP handlers thin
- map transport DTOs to application inputs at the HTTP boundary; do not pass Gin DTOs into domain or infrastructure packages
- keep business orchestration in the application layer
- keep infrastructure implementations behind repository or adapter boundaries
- use structured errors and existing response helpers
- add focused tests for shared behavior and security-sensitive changes
Read the frontend documentation before making frontend changes:
Core expectations:
- keep route files thin and place feature logic under
features/* - use existing UI components and local design patterns
- keep API access inside
shared/apior feature-level API modules - derive wire types from
@deeix/api-contractand keep UI state types inside the owning feature - do not hard-code provider-private model behavior in the frontend
- keep authentication tokens aligned with the existing session model
- run
pnpm --filter @deeix/web lint, and runpnpm buildfor routing, dependency, or Next.js changes
Follow the existing code style and local patterns. Prefer small, direct changes over broad compatibility layers.
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.