Skip to content

eschencode/PrintFarmCompanion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–¨οΈ Print Farm Companion

A modern, full-stack web application for managing a 3D print farm. Track printers, spools, print jobs, and analyze production statistics β€” all from a beautiful dark-themed dashboard.

SvelteKit Cloudflare Workers TypeScript D1 Database


dashboardView

✨ Features

πŸ“Š Dashboard

  • 3x3 Grid Layout β€” Visual overview of all printers at a glance
  • Real-time Status Indicators:
    • πŸ”΅ Blue (pulsing) β€” Actively printing
    • 🟣 Purple (pulsing) β€” Print time complete, ready for inspection
    • 🟒 Green β€” Idle with enough filament for compatible modules
    • 🟑 Yellow β€” Idle but low/no filament for compatible modules
  • Progress Bars β€” Live print progress on each printer card
  • Quick Actions β€” Click any printer to load spools, start prints, or mark jobs complete

🎯 Smart Print Management

  • Module-Based Printing β€” Define reusable print modules with expected weight, time, and spool compatibility
  • Spool Preset System β€” Create presets for your filament types (brand, material, color, cost)
  • Intelligent Matching β€” Only shows modules compatible with the currently loaded spool
  • Optimal Combination Calculator β€” Suggests the best module combination to minimize filament waste

πŸ“ˆ Statistics & Analytics

  • Print History Charts β€” Track prints over the last 30/90 days
  • Material Usage Tracking β€” Monitor filament consumption
  • Success/Failure Rates β€” Pie charts showing print reliability
  • Failure Reason Breakdown β€” Identify common issues
  • Printer Utilization β€” See total hours per printer
  • Cost Tracking β€” Track material costs per module, color, and product set

βš™οΈ Settings

  • Print Module Management β€” Add/edit/delete print modules with images
  • Spool Preset Configuration β€” Manage your filament inventory
  • Local File Handler β€” Automatically open .3mf files when starting prints (macOS)

πŸš€ Tech Stack

Layer Technology
Frontend SvelteKit 2.0, Svelte 5, TailwindCSS
Backend SvelteKit Server Routes, Cloudflare Workers
Database Cloudflare D1 (SQLite)
Charts Apache ECharts
Hosting Cloudflare Pages
Local Tools Node.js/Bun (File Handler)

πŸ“¦ Installation

Prerequisites

1. Clone the Repository

git clone https://github.com/eschencode/PrintFarmCompanion.git
cd PrintFarmCompanion

2. Install Dependencies

bun install

3. Set Up the Database

# Create D1 database
wrangler d1 create printfarm-db

# Update wrangler.jsonc with your database ID

# Run migrations
wrangler d1 execute printfarm-db --local --file=schema.sql
wrangler d1 execute printfarm-db --local --file=seed.sql

4. Run Development Server

bun run dev

Open http://localhost:5173 in your browser.


🌐 Deployment

Deploy to Cloudflare Pages

bun run build
wrangler pages deploy .svelte-kit/cloudflare

Environment Setup

Make sure your D1 database binding is configured in wrangler.jsonc:

{
  "d1_databases": [
    {
      "binding": "DB",
      "database_name": "printfarm-db",
      "database_id": "your-database-id"
    }
  ]
}

πŸ–₯️ Local File Handler (Optional)

Automatically open 3D model files when you start a print job.

cd local-file-handler
bun install
bun run start

See local-file-handler/README.md for full setup instructions.


πŸ“ Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ server.ts          # Database functions
β”‚   β”‚   β”œβ”€β”€ stores/            # Svelte stores
β”‚   β”‚   └── assets/            # Images, icons
β”‚   └── routes/
β”‚       β”œβ”€β”€ +page.svelte       # Dashboard
β”‚       β”œβ”€β”€ +page.server.ts    # Dashboard API
β”‚       β”œβ”€β”€ settings/          # Settings page
β”‚       └── stats/             # Statistics page
β”œβ”€β”€ static/
β”‚   └── images/                # Module images
β”œβ”€β”€ migrations/                # SQL migrations
β”œβ”€β”€ local-file-handler/        # File opener service
β”œβ”€β”€ schema.sql                 # Database schema
β”œβ”€β”€ seed.sql                   # Initial data
└── wrangler.jsonc             # Cloudflare config

🎨 Status Indicator Legend

Color Status Meaning
πŸ”΅ Blue (pulsing) Printing Active print in progress
🟣 Purple (pulsing) Complete Print time elapsed, ready for inspection
🟒 Green Ready Idle with sufficient filament
🟑 Yellow Low Material Idle, no compatible modules can be printed
⚫ Gray Offline Printer unavailable

πŸ› οΈ Development

# Start dev server
bun run dev

# Type check
bun run check

# Lint
bun run lint

# Build for production
bun run build

# Preview production build
bun run preview

πŸ“ License

MIT License β€” feel free to use this project for your own print farm!


πŸ™ Acknowledgments


Happy Printing! πŸ–¨οΈβœ¨

About

A modern, full-stack web application for managing a 3D print farm. Track printers, spools, print jobs, and analyze production statistics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors