mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
feat: add Review AGENTS.md Skill
This commit is contained in:
parent
ee216c0e40
commit
d93d7aff4d
8 changed files with 641 additions and 32 deletions
|
|
@ -6,35 +6,40 @@ FastAPI backend for the Dograh voice AI platform.
|
|||
|
||||
```
|
||||
api/
|
||||
├── app.py # Application entry point, FastAPI setup
|
||||
├── routes/ # API endpoint handlers
|
||||
├── services/ # Business logic and integrations
|
||||
├── services/ # Domain logic, runtime systems, and extension seams
|
||||
├── db/ # Database models and data access
|
||||
├── schemas/ # Pydantic request/response schemas
|
||||
├── tasks/ # Background jobs (ARQ)
|
||||
├── utils/ # Utility functions
|
||||
├── tasks/ # Background jobs and post-call work
|
||||
├── mcp_server/ # MCP surface exposed by the backend
|
||||
├── utils/ # Shared utilities
|
||||
├── alembic/ # Database migrations
|
||||
├── constants.py # Environment variables and constants
|
||||
└── tests/ # Test suite
|
||||
```
|
||||
|
||||
## Where to Find Things
|
||||
|
||||
| Looking for... | Go to... |
|
||||
| ---------------------- | ------------------------------------------------------------------------ |
|
||||
| API endpoints | `routes/` - each file is a router module, aggregated in `routes/main.py` |
|
||||
| Business logic | `services/` - organized by domain (telephony, workflow, campaign, etc.) |
|
||||
| Database models | `db/models.py` |
|
||||
| Database queries | `db/*_client.py` files (repository pattern) |
|
||||
| Request/response types | `schemas/` |
|
||||
| Background tasks | `tasks/` - uses ARQ for async job processing |
|
||||
| Environment config | `constants.py` |
|
||||
| Looking for... | Go to... |
|
||||
| ---------------------------- | ----------------------------------------------------------------------------- |
|
||||
| API endpoints | `routes/` - domain routers mounted under `/api/v1` |
|
||||
| Workflow graph and node data | `services/workflow/` |
|
||||
| Live pipeline runtime | `services/pipecat/` |
|
||||
| Telephony providers/call flow| `services/telephony/` |
|
||||
| Third-party integrations | `services/integrations/` |
|
||||
| Campaign and other domains | `services/` |
|
||||
| Database access | `db/` |
|
||||
| Request/response types | `schemas/` |
|
||||
| Background jobs | `tasks/` |
|
||||
| MCP backend surface | `mcp_server/` |
|
||||
| Tests | `tests/` |
|
||||
|
||||
## API Structure
|
||||
|
||||
- All routes are mounted at `/api/v1` prefix
|
||||
- Routes are organized by domain (workflow, telephony, campaign, user, etc.)
|
||||
- `routes/main.py` aggregates all routers
|
||||
- Routes are organized by domain under `routes/`
|
||||
- Workflow execution spans `services/workflow/`, `services/pipecat/`, and `tasks/`
|
||||
- Telephony is a full subsystem under `services/telephony/`, with provider-specific packages under `services/telephony/providers/`
|
||||
- Integrations extend through `services/integrations/`; package-specific rules should live in that subtree's own `AGENTS.md`
|
||||
|
||||
## Database Migrations
|
||||
|
||||
|
|
|
|||
10
api/services/telephony/AGENTS.md
Normal file
10
api/services/telephony/AGENTS.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Telephony
|
||||
|
||||
Shared telephony code lives here. Provider-specific code lives in `providers/`;
|
||||
read `providers/AGENTS.md` before changing a provider package.
|
||||
|
||||
- Keep cross-provider contracts, registry/factory wiring, shared status/transfer handling, and org-scoped config resolution in this folder.
|
||||
- Keep provider-specific transports, serializers, config models, and webhook handlers in `providers/`.
|
||||
- Resolve providers through the shared telephony helpers in this folder; do not instantiate provider classes directly from routes, tasks, or unrelated services.
|
||||
- Keep telephony config lookups tenant-safe and respect any run-scoped telephony configuration carried on a workflow run.
|
||||
- Keep provider-specific HTTP routes in provider packages; shared route glue belongs in `api/routes/`.
|
||||
|
|
@ -119,5 +119,5 @@ Pick the closest shape and copy from it.
|
|||
- **Don't add a hardcoded provider list anywhere.** If you need to iterate, use `registry.all_specs()` / `registry.names()`.
|
||||
- **Don't add a route under `routes/telephony.py` for a single provider.** Provider-specific handlers go in `providers/<name>/routes.py`. Cross-provider handlers (`/inbound/run`, `/twiml`) stay in `routes/telephony.py`.
|
||||
- **Don't import `.routes` from a provider's `__init__.py`.** That's the cycle we deliberately broke — see "Registration is import-driven."
|
||||
- **Don't write a frontend form for a new provider.** The UI consumes `GET /api/v1/organizations/telephony-providers/metadata` and renders generically from `ProviderUIField`. If a `field.type` you need doesn't exist (`text`/`password`/`textarea`/`string-array`/`number`), extend the renderer in `ui/src/app/(authenticated)/telephony-configurations/` once — not per provider.
|
||||
- **Don't write a frontend form for a new provider.** The UI consumes `GET /api/v1/organizations/telephony-providers/metadata` and renders generically from `ProviderUIField`. If a `field.type` you need doesn't exist (`text`/`password`/`textarea`/`string-array`/`number`), extend the shared telephony UI under `ui/src/components/telephony/` once — not per provider.
|
||||
- **Don't run a database migration to add a provider.** The discriminator lives in JSONB credentials and a `VARCHAR(64)` `mode` column; nothing in the DB schema knows the set of provider names.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue