A modern, full-stack ERP/MES system designed specifically for food manufacturing operations. MonoPilot provides comprehensive management of production planning, execution, quality control, and traceability with built-in compliance for food safety regulations.
MonoPilot is a monorepo-based enterprise resource planning system that combines ERP and Manufacturing Execution System (MES) capabilities. Built with modern web technologies, it offers real-time production tracking, complete batch traceability, and automated quality assurance workflows for food manufacturing facilities.
- Complete Production Lifecycle: From work order creation to finished goods shipment
- Full Traceability: Forward and backward genealogy tracking for recall management
- Bill of Materials (BOM): Version control, cloning, comparison, and conditional items
- Production Routing: Operation sequences with machine assignment and yield tracking
- Multi-warehouse Management: Location tracking, transfer orders, and inventory control
- Quality Assurance: Built-in QA workflows and compliance documentation
- Scanner Integration: Barcode/QR code support for material consumption and output registration
- Role-Based Access Control: 10 predefined roles with granular permissions
- Allergen Management: 14 EU allergens plus custom allergen tracking with inheritance
- Real-time Dashboard: Live KPIs, active work orders, and production alerts
- Node.js >= 20.0.0
- pnpm >= 8.0.0
- Supabase account (or self-hosted instance)
- Redis instance (optional, for caching)
-
Clone the repository
git clone https://github.com/your-org/monopilot.git cd monopilot -
Install dependencies
pnpm install:all
-
Configure environment variables
cd apps/frontend cp .env.example .env.localUpdate
.env.localwith your credentials:NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYREDIS_URL(optional)
-
Run database migrations
pnpm supabase db push
-
Start development server
pnpm dev
Open http://localhost:3000 in your browser.
- Framework: Next.js 15.5 (App Router)
- UI Library: React 19
- Styling: Tailwind CSS 3.4 + shadcn/ui components
- Forms: React Hook Form + Zod validation
- State Management: React Server Components + Server Actions
- Runtime: Node.js 20+
- API: 109 REST endpoints (Next.js Route Handlers)
- Database: PostgreSQL (via Supabase)
- Authentication: Supabase Auth
- Caching: Upstash Redis
- Monorepo: pnpm workspaces
- Type Safety: TypeScript 5.9
- Testing: Vitest (unit) + Playwright (E2E)
- Deployment: Docker + Nginx
MonoPilot/
├── apps/
│ └── frontend/ # Next.js application
│ ├── app/
│ │ ├── (authenticated)/ # Protected routes
│ │ │ ├── settings/ # Epic 1: Organization config
│ │ │ ├── technical/ # Epic 2: Products, BOMs, Routing
│ │ │ ├── planning/ # Epic 3: POs, TOs, WOs
│ │ │ ├── production/ # Epic 4: Production execution
│ │ │ ├── warehouse/ # Epic 5: Inventory management
│ │ │ ├── quality/ # Epic 6: QA workflows
│ │ │ └── shipping/ # Epic 7: Order fulfillment
│ │ ├── api/ # API routes (109 endpoints)
│ │ └── auth/ # Authentication pages
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui primitives
│ │ └── [module]/ # Module-specific components
│ ├── lib/
│ │ ├── services/ # Business logic
│ │ ├── validation/ # Zod schemas
│ │ └── utils/ # Helper functions
│ └── __tests__/ # Test suites
├── packages/
│ └── shared/ # Shared types & schemas
│ ├── types/ # TypeScript definitions
│ └── schemas/ # Validation schemas
├── infra/
│ ├── docker/ # Docker configurations
│ └── nginx/ # Nginx configs
├── scripts/ # Automation scripts
└── docs/ # Documentation
| Module | Epic | Status | Description |
|---|---|---|---|
| Settings | Epic 1 | Complete | Organization setup, users, roles, locations, machines, allergens |
| Technical | Epic 2 | Complete | Product management, BOMs, routings, traceability |
| Planning | Epic 3 | Complete | Supplier management, purchase orders, transfer orders, work orders |
| Production | Epic 4 | 60% Complete | Production dashboard, WO execution, material consumption, output registration |
| Warehouse | Epic 5 | Planned | Inventory management, stock movements, lot tracking |
| Quality | Epic 6 | Planned | QA checks, non-conformances, CAPA |
| Shipping | Epic 7 | Planned | Sales orders, picking, packing, shipping |
| NPD | Epic 8 | Planned | New product development, formula R&D |
# Development mode with hot reload
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Type checking
pnpm type-check
# Linting
pnpm lint# Pull remote schema
pnpm supabase db pull
# Push local migrations
pnpm supabase db push
# Generate TypeScript types
pnpm supabase gen types typescript --local
# Seed admin user
pnpm seed:adminRequired variables in apps/frontend/.env.local:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Redis (optional)
REDIS_URL=your_redis_url
# Email (optional, for notifications)
SENDGRID_API_KEY=your_sendgrid_key# Run all unit tests
pnpm test:unit
# Watch mode
pnpm test:watch
# Coverage report
pnpm test:coverage# Run E2E tests
pnpm test:e2e
# Headed mode (see browser)
pnpm test:e2e:headed
# UI mode (interactive)
pnpm test:e2e:ui
# Debug mode
pnpm test:e2e:debug- Architecture Overview
- API Documentation
- Database Schema
- Frontend Patterns
- Module Guides
- Security & Authentication
# Build image
docker build -t monopilot:latest .
# Run container
docker run -p 3000:3000 --env-file .env.local monopilot:latest# Start all services
docker-compose up -d
# Stop services
docker-compose downWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m "feat: add new feature" - Push to the branch:
git push origin feature/your-feature - Submit a pull request
We follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesrefactor:Code refactoringtest:Test additions/updateschore:Maintenance tasks
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Wiki
- Email: support@monopilot.io
Built with modern web technologies and best practices:
- Next.js App Router for server-side rendering
- Supabase for real-time database and authentication
- shadcn/ui for accessible component primitives
- React Server Components for optimal performance
Version: 1.0.0 Last Updated: 2025-12-10 Maintained by: MonoPilot Development Team