A WeChat Mini Program that helps you manage fridge inventory, track expiry dates, build shopping lists, and get AI-powered recipe recommendations.
English | ไธญๆๆๆกฃ
- Features
- Screenshots
- Architecture
- Quick Start
- Project Structure
- Configuration
- Testing
- Documentation
- Contributing
- Security
- License
| Feature | Description |
|---|---|
| Fridge Dashboard | Food overview, daily tasks, quick actions at a glance |
| Food Management | Category filtering, search, status tracking, bulk operations |
| Expiry Alerts | Tiered warnings: today / 3 days / 7 days / expired |
| Shopping List | Manual add, category grouping, cost estimation, auto-replenish from used items |
| AI Recipe Recommendations | Smart suggestions based on current fridge contents, prioritizing expiring items |
| Weekly Menu | Auto-generated 7-day meal plan with breakfast/lunch/dinner |
| Statistics | Category distribution, waste tracking, savings tips, monthly reports |
| Photo Recognition | Camera-based food identification (mock mode, ready for real API) |
| Data Export | Export fridge and shopping data as CSV or JSON |
| Family Sharing | Invite code system for shared household fridge management |
| Nutrition Tracking | Calorie and macro tracking with weekly nutrition reports |
| Dark Mode | Light / dark theme toggle |
| Accessibility | Font size, high contrast, color blind modes |
| i18n | Simplified Chinese and English |
| Subscription Messages | Expiry reminders, shopping alerts, and weekly reports via WeChat subscriptions |
Page -> Service -> Storage (three-layer architecture)
| Layer | Responsibility | Example |
|---|---|---|
| Page | UI rendering, user interaction | pages/fridge/fridge |
| Service | Business logic, CRUD operations | services/food-service.js |
| Storage | Local persistence via wx.setStorageSync | utils/storage-utils.js |
- Framework: WeChat Mini Program (native)
- Data: Mock data +
wx.setStorageSynclocal cache (no backend required) - API Layer: Unified request wrapper (
services/api/request.js) with interceptors, cache, retry, and cancellation - Theming: CSS variables + Behavior mixins
- Components: Pure presentational, communicate via
properties/triggerEvent - AI Engine: Mock recipe generation with real API switch ready (
services/ai-recipe-engine.js)
- WeChat Developer Tools
- WeChat base library 3.3.4+
git clone https://github.com/WuSuBuDuoMing/freshkeeper.git
cd freshkeeper- Open WeChat Developer Tools
- Click Import Project and select the cloned directory
- Enter your AppID (or use a test account)
- Click Compile -- the app runs immediately with mock data
No backend required. The app works entirely offline with pre-loaded mock data and local storage.
After compilation, you should see:
- Home page with food overview and daily tasks
- 50+ sample food items in the fridge
- 20 sample recipes
- Working shopping list with 30 items
freshkeeper/
โโโ app.js / app.json / app.wxss # Entry point and global config
โโโ pages/ # 10 page modules
โ โโโ index/ # Home dashboard
โ โโโ fridge/ # Fridge inventory management
โ โโโ add-food/ # Add/edit food item
โ โโโ expiry/ # Expiry alerts page
โ โโโ shopping/ # Shopping list
โ โโโ recipes/ # Recipe recommendations
โ โโโ weekly-menu/ # Weekly meal plan
โ โโโ stats/ # Statistics and reports
โ โโโ profile/ # User settings and export
โ โโโ scan/ # Photo recognition
โโโ components/ # 22 reusable UI components
โโโ services/ # Business service layer
โ โโโ food-service.js # Food CRUD + expiry queries
โ โโโ recipe-service.js # Recipe matching + weekly menu
โ โโโ shopping-service.js # Shopping list management
โ โโโ ai-recipe-engine.js # AI recipe generation engine
โ โโโ stats-service.js # Analytics and statistics
โ โโโ nutrition-service.js # Nutrition tracking
โ โโโ family-service.js # Family sharing
โ โโโ food-recognition.js # Photo recognition
โ โโโ subscription-service.js # WeChat subscription messages
โ โโโ export-service.js # CSV/JSON data export
โ โโโ api/ # HTTP API layer
โ โโโ request.js # Unified request wrapper
โ โโโ config.js # API configuration
โ โโโ interceptors.js # Request/response interceptors
โโโ utils/ # 15 utility modules
โ โโโ storage-utils.js # Local storage wrapper
โ โโโ date-utils.js # Date formatting and calculations
โ โโโ food-utils.js # Food status helpers
โ โโโ i18n.js # Internationalization
โ โโโ theme-behavior.js # Theme switching behavior
โ โโโ accessibility.js # Accessibility utilities
โ โโโ ... # Animation, image, validation, etc.
โโโ assets/ # Static resources (icons, images)
โโโ docs/ # Project documentation
โ โโโ product-requirements.md
โ โโโ technical-architecture.md
โ โโโ data-model.md
โ โโโ mock-data-design.md
โ โโโ manual-test-checklist.md
โโโ tests/ # Test cases
โ โโโ test-cases.js
โโโ .github/ # GitHub configuration
โ โโโ workflows/ci.yml # CI pipeline
โ โโโ ISSUE_TEMPLATE/ # Issue templates
โ โโโ PULL_REQUEST_TEMPLATE.md # PR template
โ โโโ FUNDING.yml # Sponsorship
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ CODE_OF_CONDUCT.md # Community code of conduct
โโโ SECURITY.md # Security policy
โโโ CHANGELOG.md # Version history
โโโ LICENSE # MIT License
| Platform | Download Link | Notes |
|---|---|---|
| macOS (Intel) | Download | Drag to Applications |
| macOS (Apple Silicon) | Download | Native M1/M2/M3 support |
| Windows 64-bit | Download | Run installer |
| Windows 32-bit | Download | For older systems |
Warning: WeChat DevTools >= 1.06.2301010
macOS / Linux:
git clone https://github.com/WuSuBuDuoMing/freshkeeper.git
cd freshkeeper
npm install # if the project has npm dependenciesWindows (PowerShell):
git clone https://github.com/WuSuBuDuoMing/freshkeeper.git
cd freshkeeper
npm install- Open WeChat Developer Tools
- On the welcome screen, click the + (Import Project) button
- In the import dialog:
- Project Directory: Browse to the cloned repository folder
- AppID: Enter your Mini Program AppID (get it from MP Backend)
- Or use the Test AppID (ๆต่ฏๅท) for quick preview
- Project Name: Auto-filled from the folder name
- Click Import (็กฎๅฎ)
Tip: If you don't have an AppID yet, click "Test Account" (ๆต่ฏๅท) to use a sandbox environment.
- After import, the simulator panel opens automatically on the left
- The app compiles and renders in the simulator with pre-loaded mock data
- Use the simulator toolbar to:
- Switch phone models (iPhone 14, Pixel 7, etc.)
- Toggle dark mode
- Adjust network speed (WiFi, 4G, Offline)
- Rotate screen orientation
Method A: Preview (้ข่ง)
- Click the Preview (้ข่ง) button in the toolbar
- A QR code appears -- scan it with your phone's WeChat
- The mini program loads on your real device
Method B: Real-time Debug (็ๆบ่ฐ่ฏ)
- Click Real-time Debug (็ๆบ่ฐ่ฏ) in the toolbar
- Scan the QR code with your phone
- A debug panel opens in DevTools showing console logs, network requests, and storage
- Click Upload (ไธไผ ) in the toolbar
- Fill in:
- Version: e.g.,
1.0.0 - Description: What changed in this version
- Version: e.g.,
- Click Upload
- Go to MP Backend -> Management -> Version Management
- Click Submit for Review (ๆไบคๅฎกๆ ธ)
- Wait for WeChat's review (usually 1-7 days)
- After review approval, go to Version Management in MP Backend
- Click Release (ๅ จ้ๅๅธ)
- The mini program is now live for all users!
For Linux servers or CI/CD pipelines, use miniprogram-ci:
# Install
npm install -g miniprogram-ci
# Generate CI private key from MP Backend > Development > Upload Key
# Save as ci-private.key
# Preview (QR code for scanning)
miniprogram-ci preview \
--appid YOUR_APPID \
--pk-version 1 \
--pk-branch main \
--private-key-path ci-private.key \
--desc "Preview"
# Upload (submit for review)
miniprogram-ci upload \
--appid YOUR_APPID \
--pk-version 1 \
--pk-branch main \
--private-key-path ci-private.key \
--desc "Release v1.0.0"# docker-compose.yml
version: '3'
services:
miniprogram-ci:
image: nicepkg/miniprogram-ci:latest
volumes:
- .:/app
- ./ci-private.key:/app/ci-private.key
command: miniprogram-ci upload --appid YOUR_APPID --pk-version 1 --private-key-path ci-private.key| Problem | Solution |
|---|---|
| "AppID does not exist" | Verify your AppID in MP Backend, or use test AppID |
| Simulator shows blank page | Check app.json pages array, ensure all files exist |
| npm packages not working | Run npm install then click "Compile" in DevTools |
| Upload fails with "version exists" | Increment the version number in project.config.json |
| Real device shows different layout | Enable "Remote Debug" to check CSS/rendering differences |
No backend required. The app works entirely offline with pre-loaded mock data and local storage.
To switch from mock to a real AI API, edit services/ai-recipe-engine.js:
const AI_CONFIG = {
useRealAPI: true, // Set to true
apiEndpoint: 'https://api.openai.com/v1/chat/completions',
apiKey: 'your-api-key-here',
model: 'gpt-3.5-turbo',
maxTokens: 2000,
temperature: 0.8
}To switch from mock to a real vision API, edit services/food-recognition.js:
const CONFIG = {
useRealAPI: true,
apiEndpoint: 'https://your-vision-api.com/analyze',
apiKey: 'your-api-key-here',
confidence: 0.6
}Configure template IDs in services/subscription-service.js by registering templates in the WeChat Official Account backend.
Run the test suite in WeChat Developer Tools:
- Import the project
- Open the Console
- Run:
require('./tests/test-cases')
The test suite covers:
- Food expiry logic (13 tests)
- Recipe matching algorithms (12 tests)
- Shopping list CRUD (18 tests)
| Document | Description |
|---|---|
| Product Requirements | Feature specifications and user stories |
| Technical Architecture | System design and decisions |
| Data Model | Schema, category system, and storage keys |
| Mock Data Design | Mock data generation strategy |
| Manual Test Checklist | Step-by-step manual testing guide |
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Run tests to verify
- Commit:
git commit -m 'feat: add my feature' - Push:
git push origin feat/my-feature - Open a Pull Request
Please follow Conventional Commits for commit messages.
Please see SECURITY.md for our security policy and vulnerability reporting process.
This project is licensed under the MIT License.
Copyright (c) 2026 WuSuBuDuoMing