Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

109 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›’ Grocery Management System

A comprehensive full-stack application for managing grocery inventory, shopping lists, and generating reports.

๐Ÿ“‹ Features

Client (Frontend)

  • Dashboard: Overview of inventory with key metrics and alerts
  • Inventory Management: Add, edit, delete, and track grocery items
  • Shopping List: Create and manage shopping lists with purchase tracking
  • Reports & Analytics: View insights on inventory value, low stock, and expiring items
  • Responsive Design: Built with React and Tailwind CSS
  • Local Storage: Data persistence in the browser

Server (Backend)

  • RESTful API: Built with Node.js and Express
  • MongoDB Integration: Database support with Mongoose
  • CRUD Operations: Full create, read, update, delete functionality
  • Data Validation: Input validation and error handling
  • CORS Support: Cross-origin resource sharing enabled

๐Ÿ—๏ธ Project Structure

Grocery-Management/
โ”œโ”€โ”€ Client/                  # React frontend application
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Reusable UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ common/     # Button, Input, Card, Modal, Select
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ layout/     # Navbar, Footer, Layout
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Main application pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Inventory.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ShoppingList.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Reports.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ context/        # React Context for state management
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ GroceryContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/          # Custom React hooks
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ useLocalStorage.js
โ”‚   โ”‚   โ”œโ”€โ”€ services/       # API services
โ”‚   โ”‚   โ”œโ”€โ”€ utils/          # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx         # Main app component with routing
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx        # Entry point
โ”‚   โ”‚   โ””โ”€โ”€ index.css       # Global styles
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ vite.config.js
โ”‚   โ””โ”€โ”€ tailwind.config.cjs
โ”‚
โ””โ”€โ”€ Server/                  # Node.js backend application
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ controllers/    # Route controllers
    โ”‚   โ”‚   โ”œโ”€โ”€ inventoryController.js
    โ”‚   โ”‚   โ””โ”€โ”€ shoppingListController.js
    โ”‚   โ”œโ”€โ”€ models/         # Mongoose models
    โ”‚   โ”‚   โ”œโ”€โ”€ Inventory.js
    โ”‚   โ”‚   โ””โ”€โ”€ ShoppingList.js
    โ”‚   โ”œโ”€โ”€ routes/         # API routes
    โ”‚   โ”‚   โ”œโ”€โ”€ inventoryRoutes.js
    โ”‚   โ”‚   โ””โ”€โ”€ shoppingListRoutes.js
    โ”‚   โ”œโ”€โ”€ middleware/     # Custom middleware
    โ”‚   โ””โ”€โ”€ config/         # Configuration files
    โ”‚       โ””โ”€โ”€ database.js
    โ”œโ”€โ”€ server.js           # Express server setup
    โ”œโ”€โ”€ package.json
    โ””โ”€โ”€ .env.example        # Environment variables template

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB (optional, for database features)

Installation

1. Clone the repository

git clone https://github.com/Nandkishorjadhav/Grocery-Management.git
cd Grocery-Management

2. Install Client Dependencies

cd Client
npm install

3. Install Server Dependencies

cd ../Server
npm install

4. Configure Environment Variables

Create a .env file in the Server directory:

cp .env.example .env

Edit .env with your configuration:

PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/grocery_management
JWT_SECRET=your_jwt_secret_key_here

๐ŸŽฎ Running the Application

Development Mode

Start the Client (Frontend)

cd Client
npm run dev

The client will run on http://localhost:5173

Start the Server (Backend)

cd Server
npm run dev

The server will run on http://localhost:5000

Production Build

Build the Client

cd Client
npm run build

Start the Server

cd Server
npm start

๐Ÿ”Œ API Endpoints

Inventory

  • GET /api/inventory - Get all inventory items
  • GET /api/inventory/:id - Get single item
  • POST /api/inventory - Create new item
  • PUT /api/inventory/:id - Update item
  • DELETE /api/inventory/:id - Delete item
  • GET /api/inventory/low-stock - Get low stock items
  • GET /api/inventory/expiring-soon - Get expiring items

Shopping List

  • GET /api/shopping-list - Get all shopping list items
  • GET /api/shopping-list/:id - Get single item
  • POST /api/shopping-list - Create new item
  • PUT /api/shopping-list/:id - Update item
  • DELETE /api/shopping-list/:id - Delete item
  • PATCH /api/shopping-list/:id/toggle - Toggle purchased status
  • DELETE /api/shopping-list/purchased/clear - Clear purchased items

๐Ÿ› ๏ธ Technologies Used

Frontend

  • React 19 - UI library
  • React Router DOM 6 - Routing
  • Tailwind CSS 4 - Styling
  • Vite 7 - Build tool
  • ESLint - Code linting

Backend

  • Node.js - Runtime environment
  • Express 4 - Web framework
  • MongoDB - Database
  • Mongoose 8 - ODM
  • CORS - Cross-origin support
  • dotenv - Environment variables
  • nodemon - Development server

๐Ÿ“ฑ Features in Detail

Dashboard

  • View total items and inventory value
  • Low stock alerts
  • Expiring soon notifications
  • Quick action buttons

Inventory Management

  • Add new items with details (name, category, quantity, price, expiry date)
  • Edit existing items
  • Delete items
  • Search and filter by category
  • Sort by various criteria
  • Stock status indicators

Shopping List

  • Create shopping lists
  • Mark items as purchased
  • Filter by status (all, pending, purchased)
  • Clear completed items
  • Category organization

Reports

  • Category-based breakdown
  • Top value items
  • Inventory health metrics
  • Shopping list analytics
  • Stock and expiry status

๐ŸŽจ UI Components

  • Button - Various variants (primary, secondary, success, danger, warning, outline)
  • Input - Form input with label and error handling
  • Select - Dropdown selection
  • Card - Container component
  • Modal - Dialog for forms and confirmations
  • Navbar - Navigation with mobile support
  • Footer - Application footer
  • Layout - Page wrapper

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ‘ค Author

Nandkishor Jadhav

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

โญ Show your support

Give a โญ๏ธ if this project helped you!


Made with โค๏ธ by Nandkishor Jadhav

About

A web-based system that automates grocery store operations, enabling admins to manage products, inventory, and sales while customers can browse, add items to the cart, and place orders efficiently.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages