A comprehensive web application for buying, selling, and managing Ayurvedic products with multi-user roles (Customer, Seller, Admin).
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.
- 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
- 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
- React.js
- TailwindCSS
- Axios
- React Router
- Context API for state management
- Node.js
- Express.js
- MongoDB
- JWT Authentication
- REST API
- Git & GitHub
- MongoDB Atlas (Cloud Database)
- VS Code
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
git clone https://github.com/ChiranLK/Online-Ayurvedic-Product-Distribution-System.git
cd Online-Ayurvedic-Product-Distribution-SystemFollow the instructions in MONGODB_SETUP.md
cd backend
npm installcd ../frontend
npm installCreate .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
Development Mode (Backend):
cd backend
npm run devDevelopment Mode (Frontend):
cd frontend
npm startβββ 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
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/products- Get all productsGET /api/products/:id- Get product by IDPOST /api/products- Create new product (Seller/Admin)PUT /api/products/:id- Update product (Seller/Admin)DELETE /api/products/:id- Delete product (Seller/Admin)
GET /api/categories- Get all categoriesPOST /api/categories- Create new category (Admin)PUT /api/categories/:id- Update category (Admin)DELETE /api/categories/:id- Delete category (Admin)
GET /api/orders- Get user's ordersPOST /api/orders- Create new orderGET /api/orders/:id- Get order by IDPUT /api/orders/:id- Update order status (Admin/Seller)
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)
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 requestPUT /api/seller-requests/:id/approve- Approve seller request (Admin)PUT /api/seller-requests/:id/reject- Reject seller request (Admin)
cd backend
npm testcd frontend
npm testEnsures data consistency between Users and Sellers collections.
cd backend
node scripts/syncSellerRecords.jsVerifies and reports any data inconsistencies.
cd backend
node scripts/checkSellerIntegrity.js- 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
This project is licensed under the MIT License - see the LICENSE file for details.
