Get the FastAPI backend running in minutes!
The simplest way to get everything running:
cd webgenie_api
docker-compose up -dThis starts:
- ✅ FastAPI backend (http://localhost:8000)
- ✅ Redis cache (localhost:6379)
- ✅ Celery worker (background jobs)
- ✅ Celery beat (scheduled tasks)
- ✅ Flower monitoring (http://localhost:5555)
Access:
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Flower: http://localhost:5555
- Python 3.11+
- Redis (local or Docker)
# Navigate to backend
cd webgenie_api
# Create virtual environment
python -m venv venv
# Activate it
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Copy environment file
cp .env.example .envTerminal 1: Start Redis
docker run -d -p 6379:6379 redis:7-alpineTerminal 2: FastAPI Server
cd webgenie_api
source venv/bin/activate
uvicorn app.main:app --reload --port 8000Terminal 3: Celery Worker
cd webgenie_api
source venv/bin/activate
celery -A app.core.tasks worker --loglevel=infoTerminal 4 (optional): Celery Beat
cd webgenie_api
source venv/bin/activate
celery -A app.core.tasks beat --loglevel=info# Run tests
pytest
# Run tests with coverage
pytest --cov=appcurl http://localhost:8000/api/v1/algorithmscurl -X POST http://localhost:8000/api/v1/datasets/register \
-H "Content-Type: application/json" \
-d '{
"name": "Test Dataset",
"description": "A test dataset",
"species": "Human",
"tissue": "Liver",
"source": {
"source_type": "local",
"url": "/data/test.csv",
"metadata": {}
},
"schema": {
"gene_column": "Gene",
"cell_column": "Cell",
"expression_column": "Expression"
}
}'curl -X POST http://localhost:8000/api/v1/jobs \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "test-dataset-xyz",
"algorithm": "GRNBOOST2",
"parameters": {
"alpha": 0.5
},
"name": "My First Job"
}'curl http://localhost:8000/api/v1/jobs/job-abc123- Full README: README.md
- Frontend Integration: FRONTEND_INTEGRATION.md
- API Docs: http://localhost:8000/docs (interactive)
- Implementation Details: IMPLEMENTATION_CHECKLIST.md
Edit .env to configure:
# Server
DEBUG=False
LOG_LEVEL=INFO
# Redis
REDIS_URL=redis://localhost:6379/0
# Algorithms
USE_DOCKER=True
MAX_CONCURRENT_JOBS=4Issue: Redis connection refused
# Start Redis
docker run -d -p 6379:6379 redis:7-alpineIssue: Port already in use
# Change port in docker-compose.yml or .env
SERVER_PORT=8001Issue: Module not found
# Reinstall dependencies
pip install -r requirements.txt --force-reinstallView Logs
docker-compose logs -f backendCheck Services
docker-compose psStop All Services
docker-compose down