Development Environment Setup
We offer two development environments. Docker is recommended for the most consistent and hassle-free experience.Option 1: Docker Development (Recommended)
Docker provides a consistent, isolated environment with all dependencies pre-configured. No need to install Node.js, Python, or nginx on your local machine.Prerequisites
- Docker Desktop or Docker Engine
- pnpm (for caching optimization)
Setup Steps
-
Configure the application:
-
Initialize Docker environment (first time only):
This will:
- Build Docker images
- Install frontend dependencies (pnpm)
- Install backend dependencies (uv)
- Share pnpm cache with host for faster builds
-
Start development services:
All services will start with hot-reload enabled:
- Frontend changes are automatically reloaded
- Backend changes trigger automatic restart
- LangGraph server supports hot-reload
-
Access the application:
- Web Interface: http://localhost:2026
- API Gateway: http://localhost:2026/api/*
- LangGraph: http://localhost:2026/api/langgraph/*
Docker Commands
Docker Architecture
- ✅ Consistent environment across different machines
- ✅ No need to install Node.js, Python, or nginx locally
- ✅ Isolated dependencies and services
- ✅ Easy cleanup and reset
- ✅ Hot-reload for all services
- ✅ Production-like environment
Option 2: Local Development
If you prefer to run services directly on your machine:Prerequisites
Check that you have all required tools installed:- Node.js 22+
- pnpm
- uv (Python package manager)
- nginx
Setup Steps
- Configure the application (same as Docker setup above)
-
Install dependencies:
-
Run development server (starts all services with nginx):
-
Access the application:
- Web Interface: http://localhost:2026
- All API requests are automatically proxied through nginx
Manual Service Control
If you need to start services individually:-
Start backend services:
-
Start nginx:
-
Access the application:
- Web Interface: http://localhost:2026
Nginx Configuration
The nginx configuration provides:- Unified entry point on port 2026
- Routes
/api/langgraph/*to LangGraph Server (2024) - Routes other
/api/*endpoints to Gateway API (8001) - Routes non-API requests to Frontend (3000)
- Centralized CORS handling
- SSE/streaming support for real-time agent responses
- Optimized timeouts for long-running operations
Project Structure
Architecture
Development Workflow
1. Create a Feature Branch
2. Make Your Changes
With hot-reload enabled in both Docker and local development, your changes will be reflected immediately:- Frontend changes reload automatically
- Backend changes trigger service restarts
- No need to manually restart services during development
3. Test Your Changes
Thoroughly test your changes before committing. See the Testing Guide for details on running tests.4. Commit Your Changes
Follow conventional commit message format:feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
5. Push and Create a Pull Request
- Clear description of the changes
- Reference to any related issues
- Screenshots or demos for UI changes
- Test results and coverage information
Pull Request Guidelines
Before Submitting
- Code follows our style guide
- All tests pass (
make test) - New tests added for new features
- Documentation updated if needed
- Commit messages follow conventional format
- No merge conflicts with main branch
PR Description Template
Review Process
- Automated Checks: CI/CD runs tests and linting
- Code Review: Maintainers review code quality and design
- Testing: Reviewers test functionality
- Approval: At least one maintainer approval required
- Merge: Maintainer merges the PR
PR Regression Checks
Every pull request runs the backend regression workflow, including:tests/test_provisioner_kubeconfig.pytests/test_docker_sandbox_mode_detection.py- All unit tests in the test suite
Development Best Practices
Test-Driven Development (TDD)
Every new feature or bug fix MUST be accompanied by unit tests. No exceptions.- Write tests before implementing features
- Ensure all tests pass before submitting PR
- Aim for high test coverage
- See Testing Guide for details
Code Quality
- Follow the Code Style Guide
- Use type hints in Python code
- Write clear, self-documenting code
- Add comments for complex logic
- Keep functions small and focused
Documentation
CRITICAL: Always update documentation after code changes- Update
README.mdfor user-facing changes - Update
CLAUDE.mdfor development changes - Keep documentation synchronized with code
- Add inline documentation for complex code
Debugging
See the Debugging Guide for techniques and tools to help troubleshoot issues during development.Getting Help
- Check existing Issues
- Read the Documentation
- Ask questions in Discussions
- Review Architecture Documentation
Common Development Tasks
Adding a New API Endpoint
- Add route to appropriate router in
backend/src/gateway/routers/ - Add corresponding tests in
backend/tests/ - Update API documentation
- Test endpoint manually and with automated tests
Adding a New Middleware
- Create middleware in
backend/src/agents/middlewares/ - Add middleware to chain in
backend/src/agents/lead_agent/agent.py - Consider middleware order (see CLAUDE.md for details)
- Add unit tests for middleware logic
- Update CLAUDE.md with middleware description
Adding a New Tool
- Implement tool in appropriate directory:
- Built-in:
backend/src/tools/builtins/ - Community:
backend/src/community/
- Built-in:
- Register tool in
config.yamlundertoolssection - Add tool to appropriate tool group
- Add tests for tool functionality
- Document tool usage
Modifying Configuration Schema
- Update Pydantic models in
backend/src/config/ - Update
config.example.yamlwith new fields - Add migration notes if breaking changes
- Update configuration documentation
- Add tests for config validation