@jemmyrehner1819/restaurant-management-system
v1.0.0
Published
A complete restaurant inventory and sales management system with web interface
Downloads
16
Maintainers
Readme
Restaurant Management System
A complete restaurant inventory and sales management system with a web-based interface. Manage ingredients, menu items, sales, and generate purchase orders automatically.
Features
- 🥬 Ingredient Management: Track stock levels and set reorder points
- 🍕 Menu Item Management: Add items and update pricing
- 🔗 Recipe Mapping: Map ingredients to menu items with quantities
- 💰 Sales Tracking: Record sales and automatically deduct inventory
- 📋 Purchase Orders: Auto-generate orders for low-stock items
- 📊 Reports: Sales analytics and inventory reports
- 🌐 Web Interface: Easy-to-use HTML interface
Prerequisites
- Node.js 14.0.0 or higher
- MySQL 5.7 or higher
- npm 6.0.0 or higher
Quick Start
Global Installation
# Install globally
npm install -g restaurant-management-system
# Setup the system
restaurant-setup
# Navigate to the created directory
cd restaurant-system
# Install dependencies
npm install
# Start the server
npm startLocal Installation
# Install in your project
npm install restaurant-management-system
# Setup the system
npx restaurant-setup
# Navigate to the created directory
cd restaurant-system
# Install dependencies
npm install
# Start the server
npm startDatabase Setup
- Make sure MySQL is running
- Create the database and tables using the provided schema:
mysql -u root -p < schemas.sqlOr manually run the SQL commands from schemas.sql in your MySQL client.
Configuration
Edit config.json to customize database connection and server settings:
{
"database": {
"host": "localhost",
"user": "root",
"password": "your_password",
"database": "restaurantDB"
},
"server": {
"port": 3000
}
}Usage
- Start the server:
npm start - Open your browser to
http://localhost:3000 - Use the navigation links to:
- Add ingredients with stock levels
- Add menu items with prices
- Map ingredients to items (recipes)
- Record sales transactions
API Documentation
Ingredients API
// Add ingredient
POST /ingredients
{
"name": "Tomatoes",
"unit": "kg",
"stock_quantity": 50,
"reorder_level": 10
}
// Get all ingredients
GET /ingredientsItems API
// Add menu item
POST /items
{
"name": "Margherita Pizza",
"price": 12.99
}
// Update item price
PUT /items/:id
{
"price": 13.99
}
// Get all items
GET /itemsSales API
// Record sale
POST /sales
{
"item_id": 1,
"quantity": 2
}
// Get sales history
GET /salesProgrammatic Usage
You can also use this as a library in your Node.js applications:
const RestaurantManagementSystem = require("restaurant-management-system");
// Initialize with custom config
const restaurant = new RestaurantManagementSystem({
host: "localhost",
user: "root",
password: "mypassword",
database: "myrestaurant",
port: 4000,
});
// Start the server programmatically
restaurant.start();
// Or just copy files to a directory
await restaurant.copyFiles("./my-restaurant-app");File Structure
restaurant-system/
├── server.js # Main server file
├── config.json # Configuration
├── schemas.sql # Database schema
├── package.json # Dependencies
├── public/ # Web interface files
│ ├── index.html
│ ├── add-ingredient.html
│ ├── add-item.html
│ ├── map-ingredients.html
│ └── sales.html
└── README.mdContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Changelog
v1.0.0
- Initial release
- Full inventory management
- Sales tracking
- Web interface
- MySQL database integration
