FlowyML Local Stack Setup Guide
This guide explains how to set up and run the complete FlowyML development stack locally using Docker.
π Prerequisites
Before you begin, ensure you have the following installed:
- Docker (v24.0+): Install Docker
- Docker Compose (v2.20+): Usually included with Docker Desktop
- Make (optional): For convenience commands
Verify your installation:
docker --version # Docker version 24.0.0 or higher
docker compose version # Docker Compose version v2.20.0 or higher
π Quick Start
1. Clone the Repository
2. Configure Environment (Optional)
Copy the example environment file and customize if needed:
3. Start the Stack
Using Make (recommended):
Or using Docker Compose directly:
4. Verify Services
Check that all services are running:
You should see all containers in "healthy" or "running" state:
| Service | Port | Status |
|---|---|---|
| postgres | 5432 | healthy |
| backend | 8080 | healthy |
| frontend | 80 | running |
| prometheus | 9090 | running |
| grafana | 3001 | running |
π Accessing the Services
Once the stack is running, you can access:
| Service | URL | Credentials |
|---|---|---|
| Frontend UI | http://localhost:80 | - |
| Backend API | http://localhost:8080 | - |
| API Docs | http://localhost:8080/docs | - |
| Health Check | http://localhost:8080/api/health | - |
| Metrics | http://localhost:8080/metrics | - |
| Prometheus | http://localhost:9090 | - |
| Grafana | http://localhost:3001 | admin / admin |
Verify Backend Health
π§ Common Operations
View Logs
# All services
docker compose logs -f
# Specific service
docker compose logs -f backend
docker compose logs -f frontend
Rebuild Images
After code changes:
Restart Services
Stop the Stack
Clean Everything (including volumes)
β οΈ This will delete all data!
π Configuration
Environment Variables
Key environment variables can be set in .env:
# Database
POSTGRES_PASSWORD=your_secure_password
# Backend
FLOWYML_AUTH_SECRET=your_auth_secret
FLOWYML_ENV=development
# Ports (if defaults conflict with other services)
FLOWYML_PORT=8080
FLOWYML_UI_PORT=80
GRAFANA_PORT=3001
Port Conflicts
If you have port conflicts, modify the ports in .env:
# Example: Change frontend to port 3000
FLOWYML_UI_PORT=3000
# Example: Change backend to port 8000
FLOWYML_PORT=8000
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Docker Network β
β (flowyml-network) β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Frontend β β Backend β β PostgreSQL β β
β β (nginx) βββββΆβ (FastAPI) βββββΆβ Database β β
β β :80 β β :8080 β β :5432 β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββ ββββββββββββββββ β
β β Grafana ββββββ Prometheus β β
β β :3001 β β :9090 β β
β ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Troubleshooting
Container Won't Start
- Check logs:
docker compose logs backend - Verify PostgreSQL is healthy:
docker compose ps postgres - Ensure ports are free:
lsof -i :8080
Database Connection Issues
# Check PostgreSQL logs
docker compose logs postgres
# Connect to database manually
docker compose exec postgres psql -U flowyml -d flowyml
Frontend Can't Connect to Backend
- Ensure backend is healthy:
curl http://localhost:8080/api/health - Check CORS settings in backend
- Verify
VITE_API_URLenvironment variable
Build Failures
# Clean Docker cache
docker system prune -f
docker builder prune -f
# Rebuild without cache
docker compose build --no-cache
Out of Disk Space
# Remove unused images and containers
docker system prune -a
# Remove volumes (WARNING: deletes data)
docker volume prune
π Monitoring
Grafana Dashboards
- Open http://localhost:3001
- Login with
admin/admin - Navigate to Dashboards β FlowyML
Prometheus Queries
Access http://localhost:9090 and try these queries:
# Request rate
rate(http_requests_total[5m])
# Error rate
rate(http_requests_total{status=~"5.."}[5m])
# Latency
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
π Development Workflow
Hot Reload for Backend
For development with hot reload, run backend locally instead of in Docker:
# Start only infrastructure
docker compose up -d postgres prometheus grafana
# Run backend locally with Poetry
poetry install
poetry run uvicorn flowyml.ui.backend.main:app --reload --port 8080
Frontend Development
π Additional Resources
Need help? Open an issue on GitHub.