Native Development Guide
This guide covers how to run AgentOps backend services natively on your local machine without Docker. Native development provides the fastest iteration cycles and is ideal for active development work.Overview
Running natively means:- Faster startup times - No container overhead
- Direct file system access - Immediate code changes
- Native debugging - Use your preferred IDE debugger
- Resource efficiency - Lower memory and CPU usage
Prerequisites
System Requirements
- Python 3.12+ with pip or uv
- Node.js 18+ with npm, yarn, or bun
- Git for version control
- Just (optional) for convenience commands
External Services
You’ll need these external services configured:- Supabase - Database and authentication
- ClickHouse - Analytics database
- Stripe (optional) - Payment processing
Quick Start
1. Clone and Setup
2. Install Dependencies
Root Dependencies
API Dependencies
Dashboard Dependencies
3. Configure Environment Variables
Update your environment files with your service credentials. See External Services Setup below.4. Start Services
5. Verify Setup
- API Health: http://localhost:8000/health
- API Documentation: http://localhost:8000/redoc
- Dashboard: http://localhost:3000
- Landing Page: http://localhost:3001
External Services Setup
Supabase Configuration
- Create a new project at supabase.com
- Get your project credentials from Settings → API
- Set up the database schema:
- Update
api/.env
anddashboard/.env.local
:
ClickHouse Configuration
- Sign up for ClickHouse Cloud or self-host
- Create a database and get connection details
- Apply the schema:
- Update
api/.env
:
API Server Setup
Environment Configuration
Key variables inapi/.env
:
Running the API Server
Using Just (Recommended)
Manual Command
Alternative Methods
API Development Features
- Auto-reload on file changes
- Interactive API docs at http://localhost:8000/docs
- ReDoc documentation at http://localhost:8000/redoc
- Health check at http://localhost:8000/health
Dashboard Setup
Environment Configuration
Key variables indashboard/.env.local
:
Running the Dashboard
Using Just (Recommended)
Manual Commands
Dashboard Development Features
- Hot reload on file changes
- Fast Refresh for React components
- Development tools integration
- Source maps for debugging
Development Workflow
Daily Development Routine
-
Start services:
- Make changes to your code
- Test changes - services auto-reload
-
Run tests before committing:
Code Quality Workflow
Database Development
Testing
API Testing
Dashboard Testing
Integration Testing
Debugging
API Debugging
- Set breakpoints in your IDE
- Run with debugger:
- Attach your IDE debugger to port 5678
Dashboard Debugging
- Use browser dev tools (F12)
- Next.js debugging:
- Attach debugger at chrome://inspect
Log Debugging
Performance Optimization
API Performance
- Use native Python for fastest development
- Enable hot reload with uvicorn
- Profile with py-spy:
Dashboard Performance
- Use bun for faster package management
- Enable Fast Refresh (enabled by default)
- Analyze bundle size:
Troubleshooting
Common Issues
Python import errors:- Verify credentials in
.env
files - Check network connectivity
- Ensure external services are running
Performance Issues
Slow API startup:Development Environment Reset
IDE Configuration
VS Code
Recommended extensions:- Python
- Pylance
- ES7+ React/Redux/React-Native snippets
- Tailwind CSS IntelliSense
- Prettier - Code formatter
.vscode/settings.json
):
PyCharm
- Set Python interpreter to
./api/.venv/bin/python
- Enable Ruff for Python linting
- Configure Node.js interpreter for dashboard
- Set up run configurations for API and dashboard
Advanced Configuration
Custom Environment Variables
Add custom variables to your.env
files:
Development Proxy
Set up a proxy for API calls in development:Hot Reload Configuration
Fine-tune hot reload behavior:Next Steps
Once your native development environment is running:- Explore the codebase - Start with
api/agentops/main.py
anddashboard/pages/index.tsx
- Make your first changes - Try modifying a simple component or API endpoint
- Set up testing - Write tests for your changes
- Configure your IDE - Set up debugging and linting
- Join the community - Connect with other developers