Skip to content

LUPLUV/filaman

Repository files navigation

🧵 Filaman – IoT Filament Management System

Filaman is a full-stack IoT solution designed for FabLabs and 3D printing enthusiasts to track 3D printing filament usage in real-time. By combining a Next.js web application with ESP32-based hardware, it automates the tedious process of weighing and logging spools.

🚀 The Stack

  • Framework: Next.js (App Router, Server Actions)
  • Runtime: Bun (Fastest JavaScript all-in-one toolkit)
  • Database: PostgreSQL with Drizzle ORM
  • Auth: Custom secure Cookie / Session-based Auth (bcrypt)
  • Styling: Tailwind CSS v4

✨ Features

  • Automated Tracking: Place a spool on the custom-built scale, scan the NFC tag, and the weight is automatically updated via REST API.
  • Real-time Inventory: Keep track of remaining filament across multiple materials and colors.
  • Hardware Integration: Custom ESP32 firmware that communicates with the Next.js backend.
  • Admin Management: Built-in dashboard to manage users and roles efficiently.
  • Mobile-First Design: Optimized for quick checks and updates on the workshop floor.

🛠️ Hardware Integration

The system uses an ESP32 connected to:

  1. An NFC Reader to identify unique filament spools via their UID.
  2. A Load Cell (HX711) to calculate the remaining weight with precision.
  3. A REST API bridge to push data directly into the PostgreSQL database.

📦 Getting Started

Prerequisites

  • Bun installed
  • PostgreSQL instance (e.g., Supabase or local)

Setup

  1. Clone the repository:

    git clone https://github.com/LUPLUV/filaman.git
    cd filaman
  2. Install dependencies:

    bun install
  3. Environment Variables: Create a .env.local file and add your credentials:

    DATABASE_URL=your_postgres_url
    SESSION_PASSWORD=a_secure_random_string_with_at_least_32_characters
  4. Database Migration:

    bunx drizzle-kit push
  5. Run the development server:

    bun dev

📝 License

MIT

About

Simple 3D Printing Filament Spool tracking app with automatic weighting and scanning.

Resources

Stars

Watchers

Forks

Contributors