简体中文 | English
A local breakfast management application based on Node.js, supporting inventory management and AI intelligent suggestion features. Help you scientifically manage your breakfast inventory and get nutritional recommendations based on your personal body data.
- Add, delete, and edit breakfast items
- Quick consume/restock inventory
- Smart alert line settings
- Low stock warnings
- Support for multiple units
- Personalized analysis based on body data (height, weight, age, gender)
- Generate recommendations based on current inventory
- Nutritional analysis and advice
- Inventory restock reminders
- Streaming output with real-time display
- Personal body data management
- Custom AI API configuration (OpenAI compatible)
- Support for special dietary needs (weight loss, lactose-free, etc.)
- Data reset functionality
- Local JSON file storage
- Automatically keep last 7 days of history
- Auto-merge breakfasts from the same day
- Support for data export and backup
- Modern UI design (Tailwind CSS)
- Responsive layout, mobile-friendly
- Chinese/English bilingual interface
- Smooth animation effects
- Intuitive operation feedback
| Category | Technology |
|---|---|
| Backend | Node.js + Express |
| Frontend | HTML5 + CSS3 + Vanilla JavaScript + Tailwind CSS |
| Data Storage | Local JSON files |
| AI Service | DeepSeek API (OpenAI compatible) |
| HTTP Client | Fetch API |
breakfast-manager/
├── server/ # Backend code
│ ├── server.js # Express main server
│ ├── routes/ # API routes
│ │ ├── breakfast.js # Breakfast management API
│ │ ├── user.js # User configuration API
│ │ └── ai.js # AI suggestion API
│ ├── data/ # Data storage
│ │ ├── breakfast.json # Breakfast inventory data
│ │ ├── user.json # User configuration data
│ │ └── history.json # History records
│ └── utils/ # Utility functions
│ └── fileStorage.js # File operations wrapper
├── public/ # Frontend static files
│ ├── index.html # Main page
│ ├── css/
│ │ └── style.css # Custom styles
│ └── js/
│ ├── app.js # Main app logic
│ ├── breakfast.js # Breakfast management module
│ ├── user.js # User configuration module
│ └── ai.js # AI suggestion module
├── package.json # Project configuration
└── README.md # Documentation
- Node.js: v14 or higher
- npm: v6 or higher
- OS: Windows / macOS / Linux
git clone https://github.com/wangshengithub/breakfast-manager.git
cd breakfast-managernpm installTo use AI suggestion features, configure DeepSeek API:
- Visit DeepSeek Platform to register
- Get your API key
- After starting the app, fill in API settings on "User Settings" page:
- API Key: Your DeepSeek API Key
- API URL:
https://api.deepseek.com/v1/chat/completions - Model Name:
deepseek-chatordeepseek-reasoner
npm startAfter successful startup, visit: http://localhost:3000
- Click "Add Breakfast" button
- Fill in breakfast information:
- Breakfast name (e.g., milk, bread)
- Remaining quantity (e.g., 10)
- Unit (e.g., box, bag, piece)
- Consumption per meal (e.g., 1)
- Alert line (e.g., 3)
- Click "Add"
- Consume: Click "Consume" button to reduce inventory
- Restock: Click "Restock" button to increase inventory
- Edit: Modify breakfast information
- Delete: Remove unwanted breakfast items
When inventory is below the alert line, the system will:
- Display red warning indicator
- Show alert dialog
- Suggest timely restocking
- Complete user body data configuration (height, weight, age, gender)
- Ensure AI API is correctly configured
- Click "Get Suggestion" button
- AI will generate personalized recommendations in real-time
- Today's breakfast combination suggestions
- Nutritional analysis
- Inventory restock recommendations
- Special dietary considerations
- Height (cm)
- Weight (kg)
- Age
- Gender
- Special Needs (e.g., weight loss period, muscle gain, lactose-free, low sugar)
- API Key: DeepSeek API Key
- API URL: Support OpenAI-compatible format
- Model Name: Customizable model
- Save User Info: Save personal basic data
- Save AI Config: Save API settings
- Reset All Data: Clear all data (confirmation required)
| Method | Path | Description |
|---|---|---|
| GET | /api/breakfasts |
Get all breakfasts |
| POST | /api/breakfasts |
Add new breakfast |
| PUT | /api/breakfasts/:id |
Update breakfast |
| DELETE | /api/breakfasts/:id |
Delete breakfast |
| POST | /api/breakfasts/:id/consume |
Consume breakfast |
| POST | /api/breakfasts/:id/restock |
Restock breakfast |
| Method | Path | Description |
|---|---|---|
| GET | /api/user |
Get user configuration |
| PUT | /api/user |
Update user configuration |
| POST | /api/user/reset |
Reset all data |
| Method | Path | Description |
|---|---|---|
| GET | /api/ai/history |
Get history records |
| POST | /api/ai/suggest |
Get AI breakfast suggestions (streaming) |
| POST | /api/ai/record |
Record today's breakfast |
All data is stored in the server/data/ directory:
| File | Description | Example |
|---|---|---|
breakfast.json |
Breakfast inventory data | {"id": 1, "name": "milk", "remaining": 10} |
user.json |
User configuration data | {"height": 175, "weight": 70} |
history.json |
History records (last 7 days) | {"2026-03-29": ["milk", "bread"]} |
- Regular Backups: Recommend regularly backing up the
server/data/directory - API Key Protection: Keep your API key safe and don't share it
- Local Storage: All data is stored locally, pay attention to data security
- Network Connection: AI suggestion features require internet connection
- Port Occupation: Default port is 3000, to change edit
server/server.js - Browser Compatibility: Recommend using modern browsers like Chrome, Edge, Firefox
- History Records: System automatically keeps last 7 days of records
A: Edit the server/server.js file and modify the PORT variable:
const PORT = 3000; // Change to your desired portA: All data is stored in JSON files under the server/data/ directory:
breakfast.json- Breakfast datauser.json- User configurationhistory.json- History records
A: Modify on the "User Settings" page:
- API URL: Change to other OpenAI-compatible API address
- Model Name: Change to corresponding model name
Supported AI services:
- DeepSeek:
https://api.deepseek.com/v1/chat/completions - OpenAI:
https://api.openai.com/v1/chat/completions - Other OpenAI-compatible services
A: The system automatically keeps the last 7 days of history records. Records older than 7 days will be automatically deleted.
A: Simply copy the JSON files in the server/data/ directory to backup all data.
A: Please check:
- API key is correctly configured
- Network connection is normal
- API address is accessible
- Model name is correct
This project is licensed under the MIT License.
wangshengithub
- GitHub: wangshengithub
- Project: breakfast-manager
Thanks to the following open-source projects and services:
Made with ❤️ by wangshengithub