Identify, monitor, and suggest fixes for Prusa XL print issues. Flask API, PrusaLink/OctoPrint collectors, PostgreSQL, optional Redis/Grafana.
Python 3.10+ | Flask, SQLAlchemy, PostgreSQL, Alembic, Redis (optional), Flask-Limiter, Flask-Caching
| Concept | Description |
|---|---|
| Observability | Collect print state, errors, and telemetry from PrusaLink and OctoPrint |
| Collector | Read-only data collection from Prusa XL via PrusaLink API and OctoPrint |
| Knowledge-base seed | Prusa error codes and troubleshooting patterns stored in PostgreSQL |
| Troubleshoot pipeline | Analyze collected data, match against KB, suggest remediation steps |
- Copy environment:
cp .env.example .envand edit with your Prusa XL host. - Install dependencies:
pip install -r requirements.txt - Ensure PostgreSQL and Redis (optional, for caching) are running.
- Run the API:
FLASK_APP=app:create_app flask runorpython -m flask run(setFLASK_APP=app:create_app).
See docs/prusa_xl_collector_poc.md for collector configuration and data flow.
app/— Flask app, API, CLI (kb seed, troubleshoot)services/— PrusaLink, OctoPrint, collector, knowledge_basealembic/— DB migrationsmonitoring/— Grafana dashboards, alertsscripts/— Smoke test, utilities
pytest tests/ -vCI (.github/workflows/tests.yml) runs the same suite plus the smoke script:
python -m pytest tests/ -v --tb=short
python scripts/smoke_test.py(Run from repo root; tests use in-memory SQLite via tests/conftest.py—no Postgres required in CI.)
Run E2E only: pytest tests/e2e/ -v -m e2e
Smoke test: python scripts/smoke_test.py
- Collector POC — data sources, PrusaLink, network config, OctoPrint integration
- OctoPrint XL quirks — known behaviors (absorbing heat, size warning)
- OpenAPI troubleshoot — API spec
Optional components: Redis (for caching when not in test mode), monitoring/ (Grafana dashboards).
FLASK_APP=app:create_app flask kb seed-error-codesBuilt by a programmer who ships. See portfolio-harness/docs/AUTHOR.md if viewing from sibling workspace.