A functional E-Commerce website built with MongoDB, ExpressJS, ReactJS, and Node.js. Features include product listing, cart management, and dynamic price updates.
- Product listing with images, names, prices, and descriptions
- Add to Cart functionality
- Cart management: update quantity, remove items
- Dynamic total price calculation
- Responsive, modern UI (custom CSS + Bootstrap)
- Backend API for products and cart
- Node.js & npm
- MongoDB (local or Atlas)
cd server- Install dependencies:
npm install - Start MongoDB locally (or update connection string for Atlas)
- Seed products:
node seed.js - Start server:
node index.js(runs on http://localhost:5000)
cd client- Install dependencies:
npm install - Start React app:
npm start(runs on http://localhost:3000)
- Build command:
npm run build - Publish directory:
build - Base directory:
client - Environment variable (Site settings → Build & deploy → Environment):
REACT_APP_API_BASE_URL= https://
- Ensure
_redirectsexists atclient/public/_redirectswith:/* /index.html 200
- Root directory:
server - Build command:
npm install - Start command:
npm run start - Environment variables:
MONGO_URI= your MongoDB connection string (Atlas recommended)- Optional
PORT(defaults to 5000)
- (Optional) Seed:
npm run seed(withMONGO_URIset)
After deploying backend, set the Netlify REACT_APP_API_BASE_URL to the backend URL.
GET /items- Fetch all productsPOST /cart- Add item to cartDELETE /cart/:id- Remove item from cartGET /cart- Get all cart itemsPUT /cart/:id- Update item quantity
- name: String
- price: Number
- image: String
- stock: Number
- description: String
- items: [{ productId, quantity }]
See /public/Dashboard.png, /public/Cart.png, /public/Results.png for UI examples.
- Mandar Kajbaje
This Project is under MIT License.