AI-powered warehouse management system designed for fresh food logistics with FEFO (First Expired, First Out) intelligence
A comprehensive warehouse management platform built for HeySalad's fresh food operations, featuring real-time inventory tracking, expiration management, and AI-driven insights.
- Live inventory statistics and KPIs
- 7-day trend analysis with interactive charts
- Category distribution visualization
- Top 10 stock items tracking
- Auto-refresh every 30 seconds
- First Expired, First Out logic for stock-out operations
- Expiration alerts (configurable threshold)
- Lot-based inventory tracking
- Spoilage rate monitoring
- Temperature breach logging
- Detailed product views with images
- Transaction history tracking
- Real-time stock levels
- Safety stock monitoring
- Multi-language support (English | 中文)
- Multi-provider AI chat (OpenAI, Anthropic, Gemini, DeepSeek)
- Natural language inventory queries
- Recipe suggestions for expiring ingredients
- Automated reporting
- Stripe payment processing
- SendGrid email notifications
- Twilio SMS alerts
- Webhook handling
| Dashboard | Product Details | Inventory List | FEFO Alerts |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Real-time warehouse management with beautiful, intuitive interface
- Framework: Flask 3.1+ with modular blueprints
- Database: Supabase (PostgreSQL) with real-time subscriptions
- API: RESTful endpoints with CORS support
- Authentication: JWT tokens with role-based access
- Deployment: Raspberry Pi + Cloudflare Tunnel
- Core: Vanilla JavaScript (ES6+)
- Charts: ECharts 5.4+ for data visualization
- Styling: Custom CSS with HeySalad® branding
- Deployment: Cloudflare Pages with CI/CD
- Domain: xinyi.heysalad.app
Frontend (Cloudflare Pages)
↓ HTTPS
Backend API (wms.heysalad.app)
↓ PostgreSQL
Database (Supabase)
- Python 3.12+
- uv package manager
- Supabase account
- Node.js 18+ (for frontend deployment)
# Clone repository
git clone https://github.com/Hey-Salad/Xin-Yi.git
cd Xin-Yi
# Install dependencies
uv sync
# Configure environment
cp .env.example .env
# Edit .env with your credentials
# Initialize database
# Run the SQL migrations in backend/migrations/
# Start backend
uv run python backend/app_platform.py
# Start frontend (in new terminal)
cd frontend
python3 server.py- Frontend: http://localhost:2125
- Backend API: http://localhost:2124
- API Docs: http://localhost:2124/
GET /api/wms/dashboard/stats # Dashboard statistics
GET /api/wms/dashboard/category-distribution # Category pie chart
GET /api/wms/dashboard/weekly-trend # 7-day trend data
GET /api/wms/dashboard/top-stock # Top 10 itemsGET /api/wms/materials/all # All inventory items
GET /api/wms/materials/info?name=X # Single product details
GET /api/wms/materials/product-stats?name=X # Product statistics
GET /api/wms/materials/product-trend?name=X # 7-day trend
GET /api/wms/materials/product-records?name=X # Transaction history
POST /api/wms/stock/in # Stock-in operation
POST /api/wms/stock/out # Stock-out (FEFO)GET /api/wms/fefo-alerts?hours=48 # Expiring items
GET /api/wms/spoilage-rate?days=30 # Waste statisticsPOST /api/ai/chat # Multi-provider AI chat
POST /api/ai/image/generate # Image generation
GET /api/ai/providers # Available AI providersCREATE TABLE materials (
id UUID PRIMARY KEY,
name TEXT NOT NULL,
sku TEXT UNIQUE NOT NULL,
category TEXT NOT NULL,
quantity INTEGER DEFAULT 0,
unit TEXT DEFAULT 'unit',
safe_stock INTEGER DEFAULT 20,
location TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);CREATE TABLE inventory_lots (
id UUID PRIMARY KEY,
material_id UUID REFERENCES materials(id),
lot_number TEXT NOT NULL,
expiration_date DATE NOT NULL,
quantity INTEGER NOT NULL,
catch_weight DECIMAL(10,2),
status TEXT DEFAULT 'active',
received_at TIMESTAMPTZ DEFAULT NOW()
);CREATE TABLE inventory_records (
id UUID PRIMARY KEY,
material_id UUID REFERENCES materials(id),
type TEXT CHECK (type IN ('in', 'out')),
quantity INTEGER NOT NULL,
operator TEXT DEFAULT 'System',
reason TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);# Database
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key
SUPABASE_SERVICE_KEY=your-service-key
# Backend
BACKEND_PORT=2124
FRONTEND_PORT=2125
FLASK_ENV=production
# AI Providers (optional)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
# Payment (optional)
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLIC_KEY=pk_live_...
# Communication (optional)
SENDGRID_API_KEY=SG....
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...# Install Wrangler
npm install -g wrangler
# Login
wrangler login
# Deploy
./deploy-to-cloudflare.shOr use CI/CD:
- Add GitHub secrets:
CLOUDFLARE_API_TOKEN,CLOUDFLARE_ACCOUNT_ID - Push to
mainbranch - Automatic deployment via GitHub Actions
# On Raspberry Pi
cd ~/Xin-Yi
git pull origin main
# Set up systemd service
sudo cp scripts/heysalad-backend.service /etc/systemd/system/
sudo systemctl enable heysalad-backend
sudo systemctl start heysalad-backend
# Configure Cloudflare Tunnel
cloudflared tunnel create xinyi-wms
cloudflared tunnel route dns xinyi-wms wms.heysalad.app
cloudflared tunnel run xinyi-wms# Run all tests
./test/run_all_tests.sh
# Test specific components
python3 test/test_api.py # API endpoints
python3 test/test_mcp.py # MCP integration
python3 test/test_fefo.py # FEFO logic
# Test platform
./test_platform.shWe welcome contributions! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use TypeScript for new frontend features
- Add tests for new functionality
- Update documentation
- Maintain bilingual support (EN | 中文)
Install the GitHub App:
Run /install-github-app to add Claude to this repository for automated code reviews and PR assistance!
Once installed, tag @claude in issues and PRs for AI assistance!
- API Documentation - Complete API reference
- Deployment Guide - Production deployment
- Frontend Guide - Frontend development
- Code Walkthrough - Architecture deep dive
- Testing Guide - Testing procedures
- Cloudflare Setup - CI/CD configuration
- Real-time dashboard
- Inventory management
- Product detail views
- Multi-language support
- Lot-based tracking
- Expiration alerts
- FEFO stock-out logic
- Temperature monitoring
- Automated spoilage reports
- Natural language queries
- Recipe suggestions
- Demand forecasting
- Automated reordering
- React Native app
- Barcode scanning
- Offline mode
- Push notifications
This project is licensed under the MIT License - see the LICENSE file for details.
HeySalad® (UK Trademark Registration No. UK00004063403) is a registered trademark of SALADHR TECHNOLOGY LTD.
- Supabase for excellent PostgreSQL hosting and real-time features
- Cloudflare for global CDN and Pages deployment
- ECharts for beautiful data visualization
- Open Source Community for countless libraries and inspiration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: peter@heysalad.io
- Website: heysalad.io
If you find Xin Yi WMS useful, consider supporting HeySalad!
This software is provided "as is" without warranties. Always test thoroughly before using in production environments. For food safety compliance, consult with regulatory experts in your jurisdiction.
Built with ❤️ by HeySalad
Making food logistics smarter, one warehouse at a time
⭐ Star this repo • 🐛 Report Issues • 💬 Discussions
Let's make every meal count! 🌱✨




