An AI-powered restaurant operations optimization system that provides actionable insights on food waste, cost optimization, inventory management, and advanced demand forecasting.
🤖 3 Active AI Agents: Cost Analysis, Inventory Management, and Forecast Intelligence
📊 Real-time Analytics: Interactive dashboards with comprehensive data visualization
🔮 Predictive Forecasting: Demand, revenue, seasonal trends, and capacity optimization
📱 Modern UI: React-based responsive interface with professional design
🏗️ Production Ready: Enterprise-grade architecture with comprehensive testing
- Node.js 18+ and npm 8+
- Docker and Docker Compose
- OpenAI API key (for AI agents)
- Pinecone account (optional, for advanced features)
- Clone and setup
npm install- Environment configuration
cp .env.example .env
# Edit .env with your database credentials and API keys- Start services
# Start database and Redis
npm run docker:up
# Run database migrations and seed data
npm run db:migrate
npm run db:seed
# Start development servers (backend + frontend)
npm run devThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Documentation: http://localhost:3001/api-docs
npm run setupCostFX/
├── backend/ # Node.js API server
│ ├── src/
│ │ ├── config/ # Database, Redis configuration
│ │ ├── models/ # Sequelize models
│ │ ├── routes/ # API routes
│ │ ├── controllers/ # Route handlers
│ │ ├── agents/ # AI agent implementations
│ │ ├── services/ # Business logic
│ │ └── middleware/ # Express middleware
│ └── tests/ # Backend tests
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── store/ # Redux store
│ │ └── hooks/ # Custom React hooks
│ └── tests/ # Frontend tests
└── shared/ # Shared types and utilities
The system includes specialized AI agents:
- Inventory Agent - Stock management, waste prediction, ordering optimization
- Cost Agent - Dish profitability analysis, cost-saving opportunities
- Forecast Agent - Demand prediction, prep time calculations
- Recipe Agent - Standardization, scaling, consistency monitoring
- Food Waste Analysis - Track waste patterns and identify reduction opportunities
- Cost Per Dish Calculation - Real-time profitability analysis
- Intelligent Ordering - AI-powered purchase recommendations
- Prep Time Forecasting - Optimize kitchen operations
- Real-time Dashboard - Monitor key metrics and alerts
Root level:
npm run dev- Start both backend and frontendnpm run test- Run all testsnpm run build- Build for productionnpm run setup- Complete setup from scratch
Backend:
npm run dev- Start development server with hot reloadnpm test- Run backend testsnpm run db:migrate- Run database migrationsnpm run db:seed- Seed database with sample data
Frontend:
npm run dev- Start Vite development servernpm test- Run frontend tests with Vitestnpm run build- Build for production
For recipe and operational data collection:
{
"name": "Chicken Parmesan",
"category": "main_course",
"servingSize": 1,
"prepTimeMinutes": 20,
"cookTimeMinutes": 25,
"ingredients": [
{
"name": "Chicken Breast",
"quantity": 6,
"unit": "oz",
"preparationMethod": "pounded thin"
}
]
}{
"name": "Chicken Breast",
"category": "protein",
"unitType": "weight",
"standardUnit": "lb",
"avgCostPerUnit": 4.50,
"storageType": "refrigerated",
"shelfLifeDays": 5,
"typicalWastePercentage": 0.03
}# All tests
npm run test
# Watch mode
npm run test:watch
# With coverage
cd backend && npm run test:coverage
cd frontend && npm run test:coverage- Node.js with Express
- PostgreSQL for primary data storage
- Redis for caching
- Sequelize ORM
- OpenAI API for AI agents
- Winston for logging
- React 18 with Hooks
- Vite for development and builds
- Redux Toolkit for state management
- React Query for server state
- Tailwind CSS for styling
- Recharts for data visualization
- Jest for backend testing
- Vitest for frontend testing
- ESLint for code quality
- Docker for development environment
- Review the API endpoints at
/api/v1 - Test the development environment with
npm run dev
CostFX supports two deployment architectures:
| Type | Cost | Best For | Features |
|---|---|---|---|
| EC2 (Default) | ~$51/mo | Development, MVP | Simple, cost-effective |
| ECS | ~$126/mo | Production | Auto-scaling, load balancing, HA |
Current Default: EC2 (simplified deployment)
- Go to Actions → "CostFX Infrastructure Deploy (Manual)"
- Click "Run workflow"
- Select:
- Environment:
devorprod - Deployment type:
ec2(default) orecs
- Environment:
- Click "Run workflow"
⏱️ Time: 15-20 minutes for EC2, 20-30 minutes for ECS
EC2: http://<elastic-ip> (from GitHub Actions output)
ECS: https://<load-balancer-dns> (from GitHub Actions output)
- 📚 Full Guide: docs/DEPLOYMENT.md
- 🚀 Quick Start: deploy/QUICK_START.md
- 🔧 Terraform: deploy/terraform/README.md
Architecture:
- EC2: Single instance with Docker Compose, RDS PostgreSQL
- ECS: Fargate containers, ALB with HTTPS, RDS PostgreSQL, Auto-scaling
Built for restaurant operations optimization with AI-powered insights.