Fab Lab Inventory System
The Fab Lab Inventory System is a comprehensive, full-stack web application built to solve inventory management challenges in makerspaces, fabrication labs, and educational workshops.

Project Overview
Fab Lab Inventory System: Comprehensive Documentation
Introduction: Project Overview
Fabrication labs, maker spaces, and educational workshops commonly face challenges in tracking tools, components, and supplies. Many rely on fragmented systems such as spreadsheets or handwritten logs, leading to inefficiencies in inventory management, tool accountability, and procurement processes.
To address this, the Fab Lab Inventory System was developed as a full-stack, open-source solution tailored specifically for these environments. This system streamlines inventory tracking, tool management, and collaborative ordering within a unified platform.
Project Scope and Core Features
The Fab Lab Inventory System is a web application that provides the following functionalities:
Visual Lab Layout
A hierarchical representation of physical lab spaces (houses, zones, shelves) for intuitive navigation.Tool Tracking
Check-in/check-out functionality with user accountability, due dates, and condition reporting.Stock Management
Automated low-stock detection, configurable thresholds, and alerts for replenishment.Collaborative Ordering
Multi-user order creation, approval workflows, and commenting with user mentions.User Management
Role-based access control for regular users, managers, and administrators.Analytics Dashboard
Usage statistics, inventory reporting, and actionable insights.
Technology Stack
Frontend
Framework: Next.js 16 (App Router) for server-side rendering and performance optimization.
Language: TypeScript for enhanced type safety and developer efficiency.
Styling: Tailwind CSS for utility-first, responsive design.
UI Components: Shadcn/ui for accessible, customizable interfaces.
State Management: React Query for server-state handling.
Backend
API: Next.js API Routes for unified full-stack development.
Database: MongoDB with Mongoose ODM for flexible document storage.
Authentication: NextAuth.js with Google OAuth integration.
File Storage: Cloudinary for secure image uploads and management.
Email Service: Nodemailer with Gmail OAuth for transactional emails.
Development Tools
Code Quality: ESLint and Prettier for linting and formatting.
Git Hooks: Husky for automated pre-commit checks.
Validation: Zod for schema-based API validation.
Key Features in Detail
Interactive Map View
The system models physical lab layouts through a hierarchical structure:House → Zone → Shelf → Items
This visual navigation mirrors real-world lab organization and improves item discoverability.Tool Checkout with Accountability
Tracks current custodian, due dates, and condition notes upon return.
Maintains a complete history of tool usage for auditing and maintenance planning.
Low Stock Management
Users can manually flag items as low stock.
Automated daily checks compare current stock against predefined minimum levels.
Integrated alerts allow one-click addition to procurement orders.
Administrators receive email digests summarizing stock status.
Collaborative Order Workflow
Supports multi-user contributions to orders with inline commenting and @mentions.
Implements an order lifecycle: Draft → Submitted → Approved → Ordered → Received.
Exports order data in CSV format for integration with purchasing systems.
Role-Based Access Control
Regular Users: Browse inventory, check out tools, and report low stock.
Managers: Create and manage orders, update item categories.
Administrators: Full system access, including user management and configuration.
Technical Challenges and Solutions
Challenge 1: Real-Time Updates Without WebSockets
Problem: Achieving real-time updates (e.g., tool checkout status) without implementing a WebSocket server.
Solution:
Utilized React Query for background data refetching.
Implemented optimistic UI updates for immediate user feedback.
Applied adaptive polling based on user activity to balance performance and freshness.
Challenge 2: Complex Data Relationships
Problem: Inventory data involves interrelated entities (items, shelves, users, orders, transactions).
Solution:
Leveraged MongoDB’s document model for nested and referenced data.
Designed aggregation pipelines for reporting and analytics.
Implemented referential integrity checks and appropriate indexing strategies.
Challenge 3: Secure File Uploads
Problem: Enabling image uploads for inventory items while mitigating security risks.
Solution:
Integrated Cloudinary with signed uploads for authenticity verification.
Applied server-side validation for file type, size, and content.
Utilized Cloudinary’s built-in virus scanning for additional protection.
Challenge 4: Programmatic Email with Gmail
Problem: Gmail security policies restrict automated email sending.
Solution:
Configured Nodemailer with OAuth2 authentication.
Implemented token refresh mechanisms to maintain email service availability.
Developed templated emails with fallback content and queued delivery for reliability.
Conclusion
The Fab Lab Inventory System provides a purpose-built, scalable solution for managing resources in fabrication labs and maker spaces. By addressing common operational challenges with modern full-stack tools and structured workflows, it enhances efficiency, accountability, and collaboration within these creative environments.
Gallery

items page

map page

layout page

new order page