Local Development Setup
This guide walks you through setting up your local development environment for Open Wearables, a health and wearable data aggregation platform.Prerequisites
Before starting, ensure you have the following installed:Docker
Recommended for quickest setup with all services
uv
Python package manager that automatically manages Python versions
pnpm
Fast, disk space efficient Node.js package manager
Node.js 22+
Required for frontend development without Docker
Docker is strongly recommended as it sets up PostgreSQL, Redis, Celery workers, and all services with a single command.
Quick Start with Docker
The fastest way to get started is using Docker Compose with hot-reload enabled:Start all services with hot-reload
- PostgreSQL database
- Redis cache
- FastAPI backend with auto-reload
- React frontend with HMR (Hot Module Replacement)
- Celery worker for background tasks
- Flower for task monitoring
An admin account is automatically created on startup:
- Email:
[email protected] - Password:
your-secure-password
Access Points
Once the services are running, you can access:| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | React UI application |
| Backend API | http://localhost:8000 | FastAPI backend |
| API Documentation | http://localhost:8000/docs | Interactive Swagger UI |
| Celery Flower | http://localhost:5555 | Task queue monitoring |
Makefile Commands
The project includes a Makefile with convenient commands:Container Management
Container Management
| Command | Description |
|---|---|
make build | Build Docker images |
make run | Start in detached mode |
make up | Start in foreground (see logs) |
make watch | Start with hot-reload (recommended for development) |
make stop | Stop containers |
make down | Stop and remove containers |
Database Operations
Database Operations
| Command | Description |
|---|---|
make migrate | Apply database migrations |
make create_migration m="description" | Create new migration |
make seed | Seed sample test data |
Testing & Quality
Testing & Quality
| Command | Description |
|---|---|
make test | Run backend test suite |
Local Development Without Docker
If you prefer to run services locally without Docker:Backend Setup
Install dependencies with uv
pyproject.toml.Configure environment variables
config/.env to match your local setup (database credentials, API keys, etc.).Start the development server
Frontend Setup
Start development server
Environment Variables
Both backend and frontend require environment configuration:Backend Environment
Copybackend/config/.env.example to backend/config/.env and configure:
Frontend Environment
Copyfrontend/.env.example to frontend/.env:
Viewing Logs
Monitor application logs while developing:Development Workflow Resources
For detailed code patterns and architecture guidelines:Backend Patterns
Python/FastAPI patterns, repository layer, service layer, and routes
Frontend Patterns
React/TypeScript patterns, TanStack Router, React Query, and forms
Contributing Guide
Pull request guidelines, code quality, and testing requirements
Adding Providers
Step-by-step guide to integrating new wearable data providers
Troubleshooting
Port already in use
Port already in use
If you see port conflicts, check for running services:Stop conflicting services or change ports in
docker-compose.yml.Database connection errors
Database connection errors
Ensure PostgreSQL is running and accessible:
Frontend not connecting to backend
Frontend not connecting to backend
Verify the
VITE_API_URL in frontend/.env matches your backend URL. Check for CORS issues in browser console.Celery tasks not running
Celery tasks not running
Check that Redis is running and the Celery worker is started:
Next Steps
Now that your environment is set up:- Read the Contributing Guide to understand the development workflow
- Review Code Quality Standards before making changes
- Explore the Backend Patterns and Frontend Patterns
- Try adding a new provider to understand the architecture
