mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
Chore/add setup and contributing docs (#90)
* chore: add dev setup documentation * Add agents.md files * simplify contributing documentation
This commit is contained in:
parent
e83f3a36d2
commit
59894d7dec
20 changed files with 510 additions and 329 deletions
|
|
@ -5,14 +5,14 @@ LOG_LEVEL="DEBUG"
|
|||
# Change these values if you deploy the backend and frontend
|
||||
# on any hosting provider with some DNS. Please ensure to
|
||||
# provide the URL with scheme like http or https
|
||||
# BACKEND_API_ENDPOINT: "http://localhost:8000"
|
||||
# UI_APP_URL: "http://localhost:3010"
|
||||
BACKEND_API_ENDPOINT="http://localhost:8000"
|
||||
UI_APP_URL="http://localhost:3000"
|
||||
|
||||
# Database Configuration
|
||||
DATABASE_URL="postgresql+asyncpg://postgres:postgres@localhost:5432/postgres"
|
||||
REDIS_URL="redis://:redissecret@localhost:6379"
|
||||
|
||||
# AWS S3 Configuration (required for SaaS mode)
|
||||
# AWS S3 Configuration
|
||||
ENABLE_AWS_S3="false"
|
||||
# AWS_ACCESS_KEY_ID=""
|
||||
# AWS_SECRET_ACCESS_KEY=""
|
||||
|
|
|
|||
50
api/AGENTS.md
Normal file
50
api/AGENTS.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# API - Backend Service
|
||||
|
||||
FastAPI backend for the Dograh voice AI platform.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
api/
|
||||
├── app.py # Application entry point, FastAPI setup
|
||||
├── routes/ # API endpoint handlers
|
||||
├── services/ # Business logic and integrations
|
||||
├── db/ # Database models and data access
|
||||
├── schemas/ # Pydantic request/response schemas
|
||||
├── tasks/ # Background jobs (ARQ)
|
||||
├── utils/ # Utility functions
|
||||
├── 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` |
|
||||
|
||||
## 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
|
||||
|
||||
## Database Migrations
|
||||
|
||||
```bash
|
||||
./scripts/makemigrate.sh "description" # Create migration
|
||||
./scripts/migrate.sh # Run migrations
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
uvicorn api.app:app --reload --port 8000
|
||||
```
|
||||
1
api/CLAUDE.md
Normal file
1
api/CLAUDE.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
@AGENTS.md
|
||||
|
|
@ -600,7 +600,7 @@ async def get_workflow_run(
|
|||
"call_duration_seconds": int(
|
||||
round(run.cost_info.get("call_duration_seconds"))
|
||||
)
|
||||
if run.cost_info
|
||||
if run.cost_info and run.cost_info.get("call_duration_seconds") is not None
|
||||
else None,
|
||||
}
|
||||
if run.cost_info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue