A modern, full-stack inventory management system built with React, TypeScript, tRPC, and PostgreSQL. Features comprehensive asset tracking, consumables management, transaction history, QR code scanning, and AI-powered chat assistance.
- Asset Management: Track items with serial numbers, locations, images, tags, and cost
- Consumables Tracking: Monitor available and total quantities of consumable items
- Transaction System: Record loans, returns, and other item movements with full audit trail
- QR Code Support: Generate and scan QR codes for quick item identification
- Location Hierarchy: Organize items using nested location structures
- Tag System: Categorize items with color-coded tags and tag groups
- User Management: Role-based access control with user groups and ban system
- Shopping Cart: Add multiple items for batch operations
- Check-in System: Streamlined process for returning items
- Dashboard: Visual analytics with charts and statistics
- AI Chat Assistant: Integrated chat interface powered by LangChain and Ollama
- Dark Mode: Automatic theme switching based on system preferences
- G-code Printing: Upload, hash, archive, and dispatch G-code jobs to configured Prusa/Bambu printers by IP
- Print Validation & Audit: Enforces G-code extension/size checks and stores per-user print job statuses
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- TailwindCSS - Styling
- Radix UI - Accessible component primitives
- React Router - Client-side routing
- TanStack Query - Data fetching and caching
- tRPC - End-to-end typesafe APIs
- React Hook Form - Form management
- Recharts - Data visualization
- Zod - Schema validation
- Hono - Web framework
- tRPC - Type-safe API layer
- Prisma - ORM and database toolkit
- PostgreSQL - Database
- Better Auth - Authentication system
- LangChain - AI/LLM integration
- Ollama - Local LLM support
- Bun - Runtime and package manager
- Vitest - Testing framework
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- Docker - Containerisation
- Bun (v1.0 or later)
- Docker and Docker Compose (for database)
- Node.js (v18 or later) - if not using Bun
git clone <repository-url>
cd inventory-systembun installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5432/mydb?schema=public"
# Frontend URL (for CORS)
FRONTEND_URL="http://localhost:5173"
# Server Port
PORT=3000
# MCP Password (for Model Context Protocol endpoint)
MCP_PASSWORD="your-secure-password-here"
# Better Auth (add your auth configuration)
# See Better Auth documentation for required variables
# Optional: Bambu dispatch bridge webhook (required for BAMBU printer type dispatch)
BAMBU_BRIDGE_URL="http://localhost:8081/bambu/dispatch"bun run dbThis will start a PostgreSQL database using Docker Compose.
bunx prisma migrate devbunx prisma generatebun run generatebun run devThis will start both the frontend (Vite) and backend (Hono) servers concurrently.
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Health check: http://localhost:3000/health
bun run dev- Start development servers (frontend + backend)bun run build- Build for productionbun run start- Start production preview serverbun run db- Start PostgreSQL database with Dockerbun run backend- Start only the backend serverbun run generate- Generate sample databun run test- Run testsbun run test:watch- Run tests in watch modebun run lint- Lint codebun run format- Format code with Prettier
inventory-system/
├── prisma/
│ ├── schema.prisma # Database schema
│ └── migrations/ # Database migrations
├── server/
│ ├── index.ts # Hono server entry point
│ ├── api/ # tRPC routers
│ ├── auth/ # Authentication configuration
│ └── trpc/ # tRPC setup
├── src/
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ ├── server/ # tRPC server-side code
│ ├── client/ # tRPC client setup
│ ├── auth/ # Auth components and providers
│ ├── contexts/ # React contexts
│ ├── hooks/ # Custom React hooks
│ └── lib/ # Utility functions
├── public/ # Static assets
└── docker-compose.yml # Docker configuration
The system uses the following main models:
- Item: Core inventory items with serial numbers, locations, tags, and cost
- Consumable: Tracks available/total quantities for consumable items
- Location: Hierarchical location structure
- Tag: Categorization system with colors and groups
- User: User accounts with groups, roles, and ban management
- ItemRecord: Transaction history for all item movements
- Group: User groups with parent-child relationships
- Chat: AI conversation storage
The system uses Better Auth for authentication. Configure your auth providers in the server configuration.
The API is built with tRPC, providing end-to-end type safety. All API routes are available under /api/trpc/*.
The system exposes a Model Context Protocol (MCP) endpoint at /mcp for AI integration. Access requires basic authentication (username: bot, password: set via MCP_PASSWORD).
docker-compose up --buildThe application will be available at:
- Frontend: http://localhost:4173
- Backend: http://localhost:3000
The project uses:
- ESLint for linting (configured in
eslint.config.js) - Prettier for formatting
- Husky for git hooks (pre-commit runs lint, format, and tests)
Tests are written with Vitest and React Testing Library:
bun run test # Run tests once
bun run test:watch # Run tests in watch mode- Create a feature branch
- Make your changes
- Ensure tests pass (
bun run test) - Ensure code is formatted (
bun run format) - Ensure linting passes (
bun run lint) - Submit a pull request
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.
For issues and questions, please open an issue on the repository.