npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jemmyrehner1819/restaurant-management-system

v1.0.0

Published

A complete restaurant inventory and sales management system with web interface

Downloads

16

Readme

Restaurant Management System

npm version License: MIT

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 start

Local 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 start

Database Setup

  1. Make sure MySQL is running
  2. Create the database and tables using the provided schema:
mysql -u root -p < schemas.sql

Or 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

  1. Start the server: npm start
  2. Open your browser to http://localhost:3000
  3. 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 /ingredients

Items 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 /items

Sales API

// Record sale
POST /sales
{
  "item_id": 1,
  "quantity": 2
}

// Get sales history
GET /sales

Programmatic 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.md

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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