simplify contributing documentation

This commit is contained in:
Abhishek Kumar 2025-12-27 09:24:05 +05:30
parent e559c86ff3
commit 5578fc3d69
3 changed files with 35 additions and 331 deletions

View file

@ -1,6 +1,6 @@
# Contributing to Dograh AI
Welcome to Dograh AI! 🎉 Thank you for your interest in contributing to the future of open-source voice AI.
Welcome to Dograh AI! ❤️ Thank you for your interest in contributing to the future of open-source voice AI. ❤️
Dograh AI is a comprehensive voice agent platform that helps developers build, test, and deploy conversational AI systems with minimal setup. This guide will help you understand the project structure, set up your development environment, and start contributing effectively.
@ -9,330 +9,42 @@ Dograh AI is a comprehensive voice agent platform that helps developers build, t
## 🏗️ Project Overview
### What is Dograh AI?
Dograh AI is a full-stack platform for building voice agents with a drag-and-drop workflow builder. It combines multiple technologies to provide a seamless experience from development to production deployment.
### Monorepo Architecture
This project uses a monorepo structure with the following main components:
```
dograh/
├── api/ # FastAPI backend service
│ ├── routes/ # API endpoints
│ ├── services/ # Business logic & integrations
│ ├── db/ # Database models & migrations
│ └── requirements.txt # Python dependencies
├── ui/ # Next.js frontend application
│ ├── src/ # React components & pages
│ ├── package.json # Node.js dependencies
│ └── tailwind.config.js # Styling configuration
├── pipecat/ # Voice processing engine (git submodule)
├── scripts/ # Development & deployment scripts
├── docs/ # Documentation
├── docker-compose.yaml # Multi-service orchestration
└── Dockerfile # Container configurations
```
### Technology Stack
**Backend (Python)**
- **Framework**: FastAPI
- **Database**: PostgreSQL with Alembic migrations
- **Cache**: Redis for session management and caching
- **Storage**: S3-compatible storage for audio files and assets (MinIO in OSS mode, AWS S3 in SaaS mode)
- **Voice Engine**: Pipecat integration for real-time voice processing
- **Background Tasks**: ARQ for asynchronous job processing
**Frontend (TypeScript)**
- **Framework**: Next.js 15 with React 19
- **UI Components**: Shadcn/ui with Radix UI primitives
- **Styling**: Tailwind CSS with animations
- **State Management**: Zustand for client-side state
**Infrastructure**
- **Containerization**: Docker with multi-service composition
- **Tunneling**: Cloudflared tunnel for telephony webhook access during development
- **Monitoring**: Sentry for error tracking, Langfuse for LLM observability
### Deployment Modes
Dograh AI supports two deployment modes:
**OSS (Open Source) Mode**
- Self-hosted deployment with local services
- Uses local MinIO for file storage
- Local authentication system
- Full control over data and infrastructure
- Ideal for development and private deployments
**SaaS (Software as a Service) Mode**
- Cloud-hosted with managed services
- AWS S3 for file storage
- Integrated authentication providers
- Managed infrastructure and scaling
- Production-ready for commercial use
## 🙌 How You Can Contribute
- 🐛 **Report bugs** via GitHub Issues
- 💡 **Suggest features**
- 🔧 **Submit pull requests**
- 📖 **Improve documentation**
- 🐛 **Report bugs** via [GitHub Issues](https://github.com/dograh-hq/dograh/issues)
- 💡 **Suggest features** via [Ideas](https://github.com/orgs/dograh-hq/discussions/categories/ideas)
- 🔧 **Submit pull requests**
- 📖 **Improve documentation** The documentation is hosted via mintlify and the code is in `docs/` folder
- 💬 **Join the Slack community**
👉 A great place to start is with issues tagged **`good first issue`**.
## 🧰 Issue Types
On our [GitHub Issues page](../../issues), you'll find these templates:
- 🐛 **Bug Report** - Create a report to help us improve
- 📚 **Documentation Change Request** - Suggest improvements, corrections, or additions to the documentation
- 💡 **Feature Request** - Suggest any ideas you have using our discussion forums
- 🔒 **Report a Security Vulnerability** - Privately report security vulnerabilities to maintainers
- 📝 **Blank issue** - Create a new issue from scratch
👉 A great place to start is with issues tagged **`good first issue`**.
## 🛠 Development Guidelines
- Keep PRs focused and scoped
- Follow Python best practices (PEP8)
- **Study existing code structure** before implementing new features - understand patterns, naming conventions, and architectural decisions
- **Follow established patterns** for similar functionality already in the codebase
- Please **link the issue** in your PR description using: `fixes #<issue_number>` - this auto-closes the issue when merged
> And if you like the project, but just don't have time to contribute code, that's fine. There are other easy ways to support the project:
>
> - Star the project;
> - Tweet about it;
> - Refer to this project in your project's readme;
> - Submit and vote on [Ideas](https://github.com/orgs/dograh-hq/discussions/categories/ideas);
> - Create and comment on [Issues](https://github.com/dograh-hq/dograh/issues);
> - Mention the project at local meetups and tell your friends/colleagues.
## 🚀 Development Setup
Choose your preferred development approach:
### Option 1: Docker Development (Recommended for Quick Start)
The fastest way to get started is using Docker, which provides all services pre-configured:
```bash
# Clone the repository
git clone https://github.com/dograh-hq/dograh.git
cd dograh
# Start all services with Docker
docker compose up --pull always
```
**Services will be available at:**
- **UI Dashboard**: http://localhost:3010
- **API Backend**: http://localhost:8000
### Option 2: Local Development Setup
For active development with hot reloading and debugging capabilities:
#### Prerequisites
- **Python 3.9+** with conda or virtualenv
- **Node.js 18+** and npm
- **PostgreSQL 17** (or use Docker for databases only)
- **Redis 7** (or use Docker for databases only)
- **Git** with submodule support
#### Backend Development
1. **Environment Setup**
```bash
# Create and activate virtual environment
conda create -n dograh python=3.9
conda activate dograh
# OR using venv: python -m venv venv && source venv/bin/activate
```
2. **Database Services** (if not using local installations)
```bash
# Start only database services
docker compose up postgres redis minio -d
```
3. **Project Dependencies**
```bash
# Initialize Pipecat submodule and install dependencies
./scripts/setup_pipecat.sh
```
This script handles:
- Git submodule initialization for Pipecat voice engine
- Pipecat installation with all required extras (Cartesia, Deepgram, OpenAI, etc.)
- Backend API dependencies installation
4. **Environment Configuration**
```bash
# Copy and configure environment variables
cp api/.env.example api/.env
# Edit api/.env with your local database URLs and API keys
```
5. **Launch Backend Services**
```bash
# Start all backend services with database migrations
./scripts/start_services.sh
```
This starts:
- FastAPI application (port 8000)
- ARQ background workers
- Campaign orchestrator
- ARI telephony manager
- Automatic database migrations
#### Frontend Development
1. **Install Dependencies**
```bash
cd ui
npm install
```
2. **Code Quality Setup**
```bash
# Fix any linting issues
npm run fix-lint
```
3. **Start Development Server**
```bash
# Start with hot reloading
npm run dev
```
Frontend will be available at `http://localhost:3000`
### Quick Command Reference
```bash
# Full local development setup
conda activate dograh # Activate Python environment
./scripts/setup_pipecat.sh # Setup voice engine + dependencies
./scripts/start_services.sh # Launch backend services
cd ui && npm install && npm run dev # Start frontend (new terminal)
# Docker-only development
docker compose up --pull always # Everything in containers
```
#### Composite Scripts (Recommended)
These scripts handle multiple tasks automatically:
```bash
./scripts/pre_commit.sh # Format Python + fix frontend linting + restage files
./scripts/start_services.sh # Run migrations + start all backend services
./scripts/setup_pipecat.sh # Initialize submodules + install dependencies
```
#### Individual Commands
For specific tasks when you need more control:
```bash
./scripts/migrate.sh # Run database migrations only
./scripts/format.sh # Format Python code only
./pipecat/scripts/fix-ruff.sh # Format Pipecat source code only
cd ui && npm run fix-lint # Fix frontend linting issues
cd ui && npm run lint # Check frontend code quality (no fixes)
```
> 💡 **Tip**: Use composite scripts for most development workflows. Individual commands are useful for debugging or working on specific components.
### Environment Configuration
Key environment variables (see `api/.env.example` for full list):
- **Database**: `DATABASE_URL` - PostgreSQL connection string
- **Cache**: `REDIS_URL` - Redis connection for sessions/tasks
- **Storage**: MinIO configuration for audio file storage
- **AI Services**: API keys for OpenAI, Deepgram, ElevenLabs, etc.
- **Telephony**: Twilio or other provider credentials (configured via UI)
## 🔄 Contributing Workflow
### Getting Started with Your First Contribution
1. **Fork & Clone**
```bash
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/dograh.git
cd dograh
# Add upstream remote
git remote add upstream https://github.com/dograh-hq/dograh.git
```
2. **Create Feature Branch**
```bash
# Create a descriptive branch name
git checkout -b feature/add-voice-detection
git checkout -b fix/authentication-bug
git checkout -b docs/improve-setup-guide
```
3. **Set Up Development Environment**
- Follow the [Development Setup](#-development-setup) guide above
- Test that everything works before making changes
4. **Make Your Changes**
- Write clean, documented code following existing patterns
- Add tests for new functionality
- Update documentation as needed
5. **Test Your Changes**
```bash
# Backend testing
cd api && python -m pytest
# Frontend linting and building
cd ui && npm run lint && npm run build
```
6. **Commit & Push**
```bash
git add .
git commit -m "feat: add voice activity detection to improve turn-taking"
git push origin feature/add-voice-detection
```
7. **Open Pull Request**
- Use a descriptive title and link to any related issues
- Include: fixes #<issue_number> to auto-close issues
- Provide context about what your changes do and why
### Code Standards
**Python (Backend)**
- Follow PEP 8 style guidelines
- Use type hints for function parameters and return values
- Write docstrings for public functions and classes
- Run `./scripts/pre_commit.sh` before committing (handles both Python formatting and frontend linting)
**TypeScript (Frontend)**
- Follow existing ESLint configuration
- Use TypeScript strictly (no `any` types)
- Follow existing component patterns and naming conventions
- Run `npm run fix-lint` before committing
**General Guidelines**
- Keep PRs focused and scoped to one feature/fix
- Write clear commit messages following [Conventional Commits](https://www.conventionalcommits.org/) (e.g., `feat:`, `fix:`, `docs:`)
- Update documentation for user-facing changes
- Add tests for new functionality
Please refer to our [Development Setup documentation](https://docs.dograh.com/contribution/setup).
### Getting Help
**Before You Start**
- Check existing [GitHub Issues](../../issues) for similar work
- Join our [Slack community](https://join.slack.com/t/dograh-community/shared_invite/zt-3czr47sw5-MSg1J0kJ7IMPOCHF~03auQ) to discuss your plans
- Look for issues tagged `good first issue` for beginner-friendly tasks
**During Development**
- Ask questions in our Slack community
- Reference related issues and PRs in your discussions
- Share early drafts for feedback on complex features
@ -342,19 +54,10 @@ Key environment variables (see `api/.env.example` for full list):
Our Slack community is the heart of Dograh AI development:
- **Get Help**: Setup assistance and debugging support
- **Collaborate**: Discuss features and architectural decisions
- **Collaborate**: Discuss features and architectural decisions
- **Connect**: Meet other contributors and maintainers
- **Stay Updated**: Learn about contribution opportunities and releases
👉 **Join us**: [Dograh Community Slack](https://join.slack.com/t/dograh-community/shared_invite/zt-3czr47sw5-MSg1J0kJ7IMPOCHF~03auQ)
### Other Ways to Contribute
Beyond code, you can help by:
- **Reporting bugs** with detailed reproduction steps
- **Suggesting features** that solve real problems
- **Improving documentation** and examples
- **Testing releases** and providing feedback
- **Helping other community members** in Slack
Thank you for helping us keep voice AI open and accessible! 🎉

View file

@ -6,6 +6,9 @@
<a href="https://docs.dograh.com">
<img src="https://img.shields.io/badge/docs-https://docs.dograh.com-blue.svg" alt="Docs: https://docs.dograh.com">
</a>
<a href="https://deepwiki.com/dograh-hq/dograh">
<img src="https://deepwiki.com/badge.svg" alt="Deepwiki: https://deepwiki.com/dograh-hq/dograh">
</a>
<a href="LICENSE">
<img src="https://img.shields.io/badge/license-BSD%202--Clause-blue.svg" alt="License: BSD 2-Clause">
</a>
@ -35,8 +38,6 @@
## 🚀 Get Started
The only command you need to run:
##### Download and setup Dograh on your Local Machine
> **Note**
@ -78,7 +79,7 @@ curl -o docker-compose.yaml https://raw.githubusercontent.com/dograh-hq/dograh/m
### Voice Capabilities
- Telephony: Built-in Twilio integration (easily add others)
- Telephony: Built-in telephony integration like Twilio, Vonage, Vobiz, Cloudonix (easily add others)
- Languages: English support (expandable to other languages)
- Custom Models: Bring your own TTS/STT models
- Real-time Processing: Low-latency voice interactions
@ -104,7 +105,7 @@ Architecture diagram _(coming soon)_
### Local Development
Refer [prerequisites](https://docs.dograh.com/getting-started/prerequisites) and [first steps](#-get-started)
Refer [Local Setup](https://docs.dograh.com/contribution/setup)
### Self-Hosted Deployment

View file

@ -1,5 +1,5 @@
---
title: Setting Up
title: Setup
description: You can use this document to setup the dev environment for yourself.
---
<Note>
@ -36,36 +36,36 @@ nvm use 24
```
cd ui && npm install && cd ..
```
7. Start local docker services after making sure you dont have any other instance of postgres or redis running by checking `docker ps`
7. Start local docker services
<Note>Please ensure you dont have any other instance of conflicting services running by checking `docker ps`</Note>
```
docker compose -f docker-compose-local.yaml up -d
```
Verify that the processes have started by running `docker ps`
```
(dograh) abhishek$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35b0121f6bd1 minio/minio "/usr/bin/docker-ent…" 6 seconds ago Up 5 seconds (health: starting) 127.0.0.1:9000-9001->9000-9001/tcp dograh-minio-1
82650ee515ec redis:7 "docker-entrypoint.s…" About a minute ago Up 5 seconds (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp dograh-redis-1
9636f5d85232 postgres:17 "docker-entrypoint.s…" About a minute ago Up 5 seconds (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp dograh-postgres-1
abhishek$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9066b7244b2f postgres:17 "docker-entrypoint.s…" 18 seconds ago Up 18 seconds (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp dograh-postgres-1
6c7cb8afdf18 redis:7 "docker-entrypoint.s…" 18 seconds ago Up 18 seconds (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp dograh-redis-1
a57e3e92b02c minio/minio "/usr/bin/docker-ent…" 18 seconds ago Up 18 seconds (healthy) 127.0.0.1:9000-9001->9000-9001/tcp dograh-minio-1
```
8. Setup environment variables
``
cp api/.env.example api/.env && cp ui/.env.example ui/.env
``
9. Setup pipecat
9. Setup pipecat git submodule
```
bash scripts/setup_pipecat.sh
```
10. Start backend services
<Note>If you wish to start the services in debug mode, we ship a launch.json file which you can use in VSCode.</Note>
```
bash scripts/start_services.sh --dev
```
Verify that your backend server is running
```
(venv) (dograh) abhishek$ curl -X GET localhost:8000/api/v1/health
(venv)abhishek$ curl -X GET localhost:8000/api/v1/health
{"message":"OK"}
(venv) (dograh) abhishek$
(venv)abhishek$
```
You would be able to see the logs in logs/ directory.
```