39 lines
1 KiB
Markdown
39 lines
1 KiB
Markdown
# remodel-api
|
|
|
|
FastAPI + Arq async service for the REmodel calculation engine.
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
poetry install
|
|
# Redis must be running (see docker-compose.yml at repo root)
|
|
docker compose up -d redis
|
|
```
|
|
|
|
## Common commands
|
|
|
|
```bash
|
|
# Start API server
|
|
poetry run uvicorn remodel_api.main:app --reload --port 8000
|
|
|
|
# Start Arq worker
|
|
poetry run arq remodel_api.workers.main.WorkerSettings
|
|
|
|
# Run tests
|
|
poetry run pytest
|
|
|
|
# Lint + typecheck
|
|
poetry run ruff check . && poetry run mypy src/
|
|
```
|
|
|
|
## API
|
|
|
|
| Method | Path | Description |
|
|
|--------|-------------------------------|------------------------|
|
|
| GET | /healthz | Health check |
|
|
| POST | /api/scenarios | Create + enqueue |
|
|
| GET | /api/scenarios | List all |
|
|
| GET | /api/scenarios/{id} | Get one |
|
|
| GET | /api/scenarios/{id}/events | SSE progress stream |
|
|
|
|
Interactive docs: http://localhost:8000/docs
|