Simple full-stack e-commerce store built for the CodeAlpha Full Stack Development internship (Task 1). MERN stack: React (Vite) frontend, Express.js + MongoDB (Mongoose) backend.
- User registration/login with JWT auth
- Product listing with search
- Product detail page
- Shopping cart (add/update/remove items)
- Checkout with shipping address → order creation
- Order history and order detail page
- Admin-only product management endpoints (create/update/delete)
- Frontend: React 19, Vite, React Router, Axios
- Backend: Node.js, Express 5, Mongoose, JWT, bcryptjs
- Database: MongoDB (Atlas or local)
CodeAlpha_EcommerceStore/
├── client/ React frontend
└── server/ Express API
cd server
npm install
cp .env.example .env # fill in MONGODB_URI and JWT_SECRET
npm run seed # optional: seeds sample products + an admin user
npm run devServer runs on http://localhost:5000.
cd client
npm install
cp .env.example .env # points to the local API by default
npm run devClient runs on http://localhost:5173.
- Email:
admin@codealpha.dev - Password:
admin123
| Method | Route | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register |
Create an account | - |
| POST | /api/auth/login |
Log in | - |
| GET | /api/auth/me |
Current user | User |
| GET | /api/products |
List/search products | - |
| GET | /api/products/:id |
Product detail | - |
| POST | /api/products |
Create product | Admin |
| PUT | /api/products/:id |
Update product | Admin |
| DELETE | /api/products/:id |
Delete product | Admin |
| GET | /api/cart |
Get current user's cart | User |
| POST | /api/cart |
Add item to cart | User |
| PUT | /api/cart/:productId |
Update item quantity | User |
| DELETE | /api/cart/:productId |
Remove item from cart | User |
| POST | /api/orders |
Place order from cart | User |
| GET | /api/orders |
List my orders | User |
| GET | /api/orders/:id |
Order detail | User/Admin |
| PUT | /api/orders/:id/status |
Update order status | Admin |
- Frontend → Vercel
- Backend → Render
- Database → MongoDB Atlas