Skip to content

ChiranLK/Online-Ayurvedic-Product-Distribution-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Online Ayurvedic Product Distribution System

A comprehensive web application for buying, selling, and managing Ayurvedic products with multi-user roles (Customer, Seller, Admin).

🌿 Overview

The Online Ayurvedic Product Distribution System is a full-stack MERN application designed to create an ecosystem for the distribution and sale of Ayurvedic products. The platform connects customers with sellers of authentic Ayurvedic products while providing robust administration features.

Dashboard Screenshot

✨ Features

Multi-User Roles

  • Customers: Browse products, manage cart, place orders, track deliveries
  • Sellers: List products, manage inventory, track sales, receive orders
  • Administrators: User management, product approval, analytics, system configuration

Key Functionalities

  • User Authentication: Secure login, registration, and role-based access control
  • Product Management: Comprehensive product listings with descriptions, images, and categories
  • Shopping Cart: Add, remove, and modify cart items before purchase
  • Order Processing: Complete checkout flow with shipping and payment options
  • Seller Dashboard: Sales analytics, inventory management, and order fulfillment
  • Admin Controls: User management, seller approval, and system monitoring
  • Seller Request System: Allow customers to request seller privileges
  • Reviews & Ratings: Product feedback and quality assurance

πŸš€ Technology Stack

Frontend

  • React.js
  • TailwindCSS
  • Axios
  • React Router
  • Context API for state management

Backend

  • Node.js
  • Express.js
  • MongoDB
  • JWT Authentication
  • REST API

DevOps & Tools

  • Git & GitHub
  • MongoDB Atlas (Cloud Database)
  • VS Code

πŸ“‹ Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn

πŸ”§ Installation

1. Clone the repository

git clone https://github.com/ChiranLK/Online-Ayurvedic-Product-Distribution-System.git
cd Online-Ayurvedic-Product-Distribution-System

2. Setup MongoDB

Follow the instructions in MONGODB_SETUP.md

3. Install Backend Dependencies

cd backend
npm install

4. Install Frontend Dependencies

cd ../frontend
npm install

5. Environment Variables

Create .env files in both the backend and frontend directories:

Backend .env:

PORT=5000
MONGODB_URI=mongodb://localhost:27017/ayurvedicdb
JWT_SECRET=your_secure_jwt_secret_here
NODE_ENV=development

Frontend .env:

REACT_APP_API_URL=http://localhost:5000

6. Run the Application

Development Mode (Backend):

cd backend
npm run dev

Development Mode (Frontend):

cd frontend
npm start

πŸ—οΈ Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/          # Configuration files
β”‚   β”œβ”€β”€ controllers/     # Request handlers
β”‚   β”œβ”€β”€ middleware/      # Express middleware
β”‚   β”œβ”€β”€ models/          # Mongoose models
β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”œβ”€β”€ scripts/         # Utility scripts
β”‚   └── server.js        # Entry point
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/          # Static files
β”‚   └── src/
β”‚       β”œβ”€β”€ components/  # UI components
β”‚       β”œβ”€β”€ context/     # React context
β”‚       β”œβ”€β”€ config/      # Configuration
β”‚       β”œβ”€β”€ hooks/       # Custom hooks
β”‚       β”œβ”€β”€ pages/       # Page components
β”‚       β”œβ”€β”€ services/    # API services
β”‚       β”œβ”€β”€ utils/       # Utility functions
β”‚       β”œβ”€β”€ App.js       # Root component
β”‚       └── index.js     # Entry point
β”‚
β”œβ”€β”€ MONGODB_SETUP.md     # MongoDB setup guide
└── README.md            # Project documentation

πŸ”„ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get product by ID
  • POST /api/products - Create new product (Seller/Admin)
  • PUT /api/products/:id - Update product (Seller/Admin)
  • DELETE /api/products/:id - Delete product (Seller/Admin)

Categories

  • GET /api/categories - Get all categories
  • POST /api/categories - Create new category (Admin)
  • PUT /api/categories/:id - Update category (Admin)
  • DELETE /api/categories/:id - Delete category (Admin)

Orders

  • GET /api/orders - Get user's orders
  • POST /api/orders - Create new order
  • GET /api/orders/:id - Get order by ID
  • PUT /api/orders/:id - Update order status (Admin/Seller)

Users

  • GET /api/users - Get all users (Admin)
  • GET /api/users/:id - Get user by ID (Admin)
  • PUT /api/users/:id - Update user (Admin)
  • DELETE /api/users/:id - Delete user (Admin)

Seller Requests

  • POST /api/seller-requests - Submit seller request (Customer)
  • GET /api/seller-requests - Get all seller requests (Admin)
  • GET /api/seller-requests/me - Get user's seller request
  • PUT /api/seller-requests/:id/approve - Approve seller request (Admin)
  • PUT /api/seller-requests/:id/reject - Reject seller request (Admin)

πŸ§ͺ Testing

Backend Tests

cd backend
npm test

Frontend Tests

cd frontend
npm test

πŸ› οΈ Utility Scripts

Sync Seller Records

Ensures data consistency between Users and Sellers collections.

cd backend
node scripts/syncSellerRecords.js

Check Seller Integrity

Verifies and reports any data inconsistencies.

cd backend
node scripts/checkSellerIntegrity.js

🀝 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.

πŸ™ Acknowledgements

About

Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages