A complete backend system for an E-commerce platform with user management, product handling, cart features, and order processing.
- Demo
- Features
- Tech Stack
- Getting Started
- Folder Structure
- Deployment
- API Reference
- Contributing
- License
- Contact
Add screenshots or API demo here (e.g., Postman response examples)
- 🧑 User Registration & Login (with bcrypt password hashing)
- 👨💼 Admin-only product creation
- 🛍️ Product listing, update, and delete
- 🛒 Cart: Add, update, delete products
- 📦 Order placement (from cart or direct)
- 🔐 Secure MongoDB operations with Mongoose models
- 🌐 API endpoints for full CRUD operations
Backend: Node.js, Express.js Database: MongoDB, Mongoose Tools: Postman, VS Code, Git
git clone https://github.com/ManjunathDharappanavar/FullStack-E-commerce-Project.git
cd FullStack-E-commerce-Project
npm install
node index.jsServer runs on
http://localhost:4000
Test endpoint: GET /api/test ➝ ✅ "server working fine"
├── controller/ # All route logic
│ ├── usercontroller.js
│ ├── productcontroller.js
│ ├── orderscontroller.js
│ └── cartcontroller.js
├── model/ # Mongoose schemas
│ ├── usermodel.js
│ ├── productmodel.js
│ ├── ordermodel.js
│ └── cartmodel.js
├── route/ # Express routers
│ ├── userroute.js
│ ├── productroute.js
│ ├── orderroute.js
│ └── cartroute.js
├── db/
│ └── connectdb.js # DB connection utility
├── index.js # Server entry point
└── README.mdAdd deployment URL here (e.g., Render, Vercel, or Railway)
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/register |
Register new user |
| POST | /api/login |
Login user |
| GET | /api/getusers |
Get all users |
| GET | /api/getuserbyemail/:email |
Get user by email |
| PUT | /api/updateuser/:id |
Update user |
| DELETE | /api/deleteuser/:id |
Delete user |
| POST | /api/createproduct/:userid |
Create product (admin only) |
| GET | /api/product |
Get all products |
| GET | /api/getproductbyid/:id |
Get product by ID |
| PUT | /api/updateproduct/:id |
Update product |
| DELETE | /api/deleteproduct/:id |
Delete product |
| POST | /api/addtocart/:userid/:productid/:quantity |
Add to cart |
| GET | /api/getcartofuser/:userid |
Get cart by user ID |
| PATCH | /api/updatecart/:cartid/:quantity |
Update cart quantity |
| DELETE | /api/deletecart/:cartid |
Delete cart item |
| POST | /api/createorder |
Create order (from cart or direct) |
| GET | /api/getorders |
Get all orders |
| GET | /api/getuserorders/:userid |
Get user order history |
| PUT | /api/updateorder/:id |
Update order status |
Contributions are welcome!
- Fork the repo
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add YourFeature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Manjunath Dharappanavar 📫 Email: manjunathgd85@gmail.com
Feel free to reach out for feedback, ideas, or collaboration!