Skip to content

Repository files navigation

3D Print Logger

Quality Gate Status CodeRabbit Pull Request Reviews

Self-hosted application for logging and analyzing 3D print jobs from multiple Klipper/Moonraker printers.

3D Print Logger Dashboard

Features

  • 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

Requirements

  • Python 3.10+
  • Klipper/Moonraker printer(s)

Installation

  1. Clone the repository:

    git clone https://github.com/stephenfeather/3d-print-logger.git
    cd 3d-print-logger
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # Linux/macOS
    # or
    .venv\Scripts\activate     # Windows
  3. Install dependencies:

    pip install -r requirements.txt
  4. Copy and configure settings:

    cp config.example.yml config.yml
    # Edit config.yml with your settings
  5. Initialize the database:

    alembic upgrade head
  6. Run the application:

    uvicorn src.main:app --host 0.0.0.0 --port 8000

Configuration

See config.example.yml for all available configuration options.

Database

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

Adding Printers

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"
  }'

Web Interface

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

API Documentation

Once running, visit:

Development

Install development dependencies:

pip install -r requirements.txt
# or
pip install -e ".[dev]"

Run tests:

pytest

Run with coverage:

pytest --cov=src --cov-report=html

Docker

Build and run with Docker Compose:

cp config.example.yml config.yml
mkdir -p data logs
cd docker
docker compose up -d

Alternative: 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-logger

For detailed deployment instructions including MySQL setup, macOS/Colima, and Raspberry Pi deployment, see INSTALL.md.

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please read the contributing guidelines before submitting PRs.

About

Application to log 3d prints. Interfaces with moonraker.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages