Self-hosted application for logging and analyzing 3D print jobs from multiple Klipper/Moonraker printers.
- Multi-Printer Support: Monitor and log jobs from multiple Klipper/Moonraker printers simultaneously
- Real-Time Updates: WebSocket connections to Moonraker for live job tracking
- Job History: Complete history of all print jobs with detailed metadata
- Gcode Parsing: Extract slicer settings from OrcaSlicer gcode files
- Analytics Dashboard: Statistics and insights across all printers
- API Key Authentication: Secure access to the REST API
- Database Flexibility: SQLite for simple setups, MySQL for production deployments
- Python 3.10+
- Klipper/Moonraker printer(s)
-
Clone the repository:
git clone https://github.com/stephenfeather/3d-print-logger.git cd 3d-print-logger -
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Copy and configure settings:
cp config.example.yml config.yml # Edit config.yml with your settings -
Initialize the database:
alembic upgrade head
-
Run the application:
uvicorn src.main:app --host 0.0.0.0 --port 8000
See config.example.yml for all available configuration options.
The application supports two database backends:
- SQLite (default): Simple file-based database, ideal for single-machine deployments
- MySQL 8: Production-grade database for larger deployments
Use the REST API to add printers:
curl -X POST http://localhost:8000/api/printers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Printer 1",
"location": "Office",
"moonraker_url": "http://printer1.local:7125"
}'The application includes a Vue.js dashboard accessible at http://localhost:8000/:
| Page | URL | Description |
|---|---|---|
| Dashboard | / |
Overview with recent jobs, printer status, and summary stats |
| Printers | /printers |
Manage printers (add, edit, delete, view status) |
| Jobs | /jobs |
Browse job history with filtering and pagination |
| Analytics | /analytics |
Charts for success rates, filament usage, and trends |
| Settings | /settings |
System info and API key management |
Once running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Install development dependencies:
pip install -r requirements.txt
# or
pip install -e ".[dev]"Run tests:
pytestRun with coverage:
pytest --cov=src --cov-report=htmlBuild and run with Docker Compose:
cp config.example.yml config.yml
mkdir -p data logs
cd docker
docker compose up -dAlternative: Direct Docker commands (if docker compose is unavailable):
# Build the image
docker build -f docker/Dockerfile -t 3d-print-logger .
# Run the container
docker run -d \
--name print-logger \
-p 8000:8000 \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/app/logs \
-v $(pwd)/config.yml:/app/config.yml:ro \
3d-print-loggerFor detailed deployment instructions including MySQL setup, macOS/Colima, and Raspberry Pi deployment, see INSTALL.md.
MIT License - see LICENSE file for details.
Contributions welcome! Please read the contributing guidelines before submitting PRs.
