mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-12 07:45:14 -05:00
SECRT-1933 This adds a complete devcontainer configuration for the AutoGPT Platform, optimized for PR reviews in GitHub Codespaces. Features: - Docker-in-Docker for full compose support - Pre-installed Python 3.13, Node 21, pnpm, Poetry - Auto-start of all platform services (Supabase, Redis, RabbitMQ, etc.) - Pre-seeded test data with ready-to-use accounts - VS Code extensions for Python, TypeScript, Prisma, Playwright - Debug launch configs for backend and frontend - Optimized for prebuilds (~60s spinup vs 5-10 min) Test account: test123@gmail.com / testpassword123 Files: - .devcontainer/devcontainer.json - Main configuration - .devcontainer/docker-compose.devcontainer.yml - Compose overlay - .devcontainer/scripts/ - Lifecycle scripts (oncreate, postcreate, poststart) - .devcontainer/vscode-templates/ - Optional VS Code debug configs - .devcontainer/README.md - Documentation
GitHub Codespaces for AutoGPT Platform
This dev container provides a complete development environment for the AutoGPT Platform, optimized for PR reviews.
🚀 Quick Start
-
Open in Codespaces:
-
Wait for setup (~60 seconds with prebuild, ~5-10 min without)
-
Start developing!
- Frontend auto-opens at
http://localhost:3000 - Login with:
test123@gmail.com/testpassword123
- Frontend auto-opens at
📍 Available Services
| Service | URL | Notes |
|---|---|---|
| Frontend | http://localhost:3000 | Next.js app |
| REST API | http://localhost:8006 | FastAPI backend |
| WebSocket | ws://localhost:8001 | Real-time updates |
| Supabase | http://localhost:8000 | Auth & API gateway |
| Supabase Studio | http://localhost:5555 | Database admin |
| RabbitMQ | http://localhost:15672 | Queue management |
🔑 Test Accounts
| Password | Role | |
|---|---|---|
| test123@gmail.com | testpassword123 | Featured Creator |
The test account has:
- Pre-created agents and workflows
- Published store listings
- Active agent executions
- Reviews and ratings
🛠️ Development Commands
# Navigate to platform directory (terminal starts here by default)
cd autogpt_platform
# Start all services
docker compose up -d
# Or just core services (DB, Redis, RabbitMQ)
make start-core
# Run backend in dev mode (hot reload)
make run-backend
# Run frontend in dev mode (hot reload)
make run-frontend
# Run both backend and frontend
# (Use VS Code's "Full Stack" launch config for debugging)
# Format code
make format
# Run tests
make test-data # Regenerate test data
poetry run test # Backend tests (from backend/)
pnpm test:e2e # E2E tests (from frontend/)
🐛 Debugging
VS Code Launch Configs
Note: Launch and task configs are in
.devcontainer/vscode-templates/. To use them locally, copy to.vscode/:cp .devcontainer/vscode-templates/*.json .vscode/In Codespaces, core settings are auto-applied via devcontainer.json.
Press F5 or use the Run and Debug panel:
- Backend: Debug FastAPI - Debug the REST API server
- Backend: Debug Executor - Debug the agent executor
- Frontend: Debug Next.js - Debug with browser DevTools
- Full Stack: Backend + Frontend - Debug both simultaneously
- Tests: Run E2E Tests - Run Playwright tests
VS Code Tasks
Press Ctrl+Shift+P → "Tasks: Run Task":
- Start/Stop All Services
- Run Migrations
- Seed Test Data
- View Docker Logs
- Reset Database
📁 Project Structure
autogpt_platform/ # This folder
├── .devcontainer/ # Codespaces/devcontainer config
├── .vscode/ # VS Code settings
├── backend/ # Python FastAPI backend
│ ├── backend/ # Application code
│ ├── test/ # Test files + data seeders
│ └── migrations/ # Prisma migrations
├── frontend/ # Next.js frontend
│ ├── src/ # Application code
│ └── e2e/ # Playwright E2E tests
├── db/ # Supabase configuration
├── docker-compose.yml # Service orchestration
└── Makefile # Common commands
🔧 Troubleshooting
Services not starting?
# Check service status
docker compose ps
# View logs
docker compose logs -f
# Restart everything
docker compose down && docker compose up -d
Database issues?
# Reset database (destroys all data)
make reset-db
# Re-run migrations
make migrate
# Re-seed test data
make test-data
Port already in use?
# Check what's using the port
lsof -i :3000
# Kill process (if safe)
kill -9 <PID>
Can't login?
- Ensure all services are running:
docker compose ps - Check auth service:
docker compose logs auth - Try seeding data again:
make test-data
📝 Making Changes
Backend Changes
- Edit files in
backend/backend/ - If using
make run-backend, changes auto-reload - Run
poetry run formatbefore committing
Frontend Changes
- Edit files in
frontend/src/ - If using
make run-frontend, changes auto-reload - Run
pnpm formatbefore committing
Database Schema Changes
- Edit
backend/schema.prisma - Run
poetry run prisma migrate dev --name your_migration - Run
poetry run prisma generate
🔒 Environment Variables
Default environment variables are configured for local development. For production secrets, use GitHub Codespaces Secrets:
- Go to GitHub Settings → Codespaces → Secrets
- Add secrets with names matching
.envvariables - They'll be automatically available in your codespace