Quick reference guide for running the Auto Code web interface.
- Python 3.10+ with virtual environment
- Node.js 18+ with npm
- Backend dependencies installed
- Frontend dependencies installed
cd apps/web-backend
.venv/Scripts/python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reloadServer will be available at: http://localhost:8000
Features enabled:
- Auto-reload on code changes (
--reload) - API documentation at http://localhost:8000/docs (if DEBUG=true)
- Health check at http://localhost:8000/health
- WebSocket at ws://localhost:8000/ws/agent-events
Edit apps/web-backend/.env:
DEBUG=true # Enable debug mode (auto-reload, API docs)
HOST=0.0.0.0 # Listen on all interfaces
PORT=8000 # Backend port
CORS_ORIGINS=http://localhost:3000,http://localhost:3001,http://localhost:5173
SECRET_KEY=dev-secret-key-for-testing-onlyTo view logs in real-time:
tail -f backend.logcd apps/web-frontend
npm run devServer will be available at: http://localhost:3000 (or http://localhost:3001 if 3000 is in use)
Features enabled:
- Hot module replacement (HMR)
- Fast refresh for React components
- Proxy to backend API (configured in vite.config.ts)
- WebSocket connection to backend
Edit apps/web-frontend/.env:
VITE_API_URL=http://localhost:8000 # Backend API URL
VITE_WS_URL=ws://localhost:8000 # WebSocket URL
VITE_DEBUG=true # Enable debug loggingLogs are displayed in the terminal where you ran npm run dev.
curl http://localhost:8000/healthExpected response:
{"status":"healthy","service":"auto-claude-web-api","version":"1.0.0","debug_mode":true}curl http://localhost:8000/api/tasksUsing Python:
import asyncio
import websockets
import json
async def test():
async with websockets.connect('ws://localhost:8000/ws/agent-events') as ws:
await ws.send(json.dumps({'action': 'subscribe', 'spec_id': '022'}))
response = await ws.recv()
print(response)
asyncio.run(test())Open browser to http://localhost:3001 (or check terminal output for actual port).
- Press
Ctrl+Cin the terminal running uvicorn - Or if running in background:
kill $(cat backend.pid)
- Press
Ctrl+Cin the terminal running npm
Problem: Port 8000 already in use Solution:
# Find process using port 8000
netstat -ano | findstr :8000
# Kill the process (replace PID with actual process ID)
taskkill /PID <PID> /FProblem: Module not found errors Solution:
cd apps/web-backend
.venv/Scripts/python -m pip install -r requirements.txtProblem: Port 3000 already in use Solution: Vite will automatically try port 3001. Update backend CORS if needed:
# In apps/web-backend/.env
CORS_ORIGINS=http://localhost:3000,http://localhost:3001,http://localhost:5173Problem: Module not found errors Solution:
cd apps/web-frontend
npm installProblem: Frontend can't access backend API
Solution: Ensure backend .env includes frontend port in CORS_ORIGINS:
CORS_ORIGINS=http://localhost:3000,http://localhost:3001,http://localhost:5173Then restart backend server.
Problem: WebSocket won't connect Solution:
- Check backend is running:
curl http://localhost:8000/health - Verify WebSocket URL in frontend
.env:VITE_WS_URL=ws://localhost:8000 - Check browser console for connection errors
- Ensure no firewall blocking WebSocket connections
-
Start backend (Terminal 1):
cd apps/web-backend .venv/Scripts/python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload -
Start frontend (Terminal 2):
cd apps/web-frontend npm run dev -
Open browser to http://localhost:3001
-
Make changes - both servers will auto-reload:
- Backend: Changes to
.pyfiles trigger uvicorn reload - Frontend: Changes to
.tsx/.tsfiles trigger Vite HMR
- Backend: Changes to
-
Test API in browser or with curl
-
View logs in respective terminals
For production deployment, see:
apps/web-backend/DEPLOYMENT.md(to be created in subtask-3-3)apps/web-frontend/DEPLOYMENT.md(to be created in subtask-3-3)
| Task | Command |
|---|---|
| Start backend | cd apps/web-backend && .venv/Scripts/python -m uvicorn main:app --reload |
| Start frontend | cd apps/web-frontend && npm run dev |
| Test backend health | curl http://localhost:8000/health |
| Test tasks API | curl http://localhost:8000/api/tasks |
| View backend logs | cd apps/web-backend && tail -f backend.log |
| Install backend deps | cd apps/web-backend && .venv/Scripts/python -m pip install -r requirements.txt |
| Install frontend deps | cd apps/web-frontend && npm install |
| Build frontend | cd apps/web-frontend && npm run build |
| Type check frontend | cd apps/web-frontend && npx tsc --noEmit |
Last Updated: 2026-01-27 Subtask: 3-1 (Configure CORS and test API integration)