π MERN E-Commerce Application A full-stack e-commerce web application built using the MERN stack (MongoDB, Express, React, Node.js) with modern best practices, responsive UI, and a modular architecture.
Layer | Technology |
---|---|
Frontend | React, TailwindCSS, Axios, Zod |
Backend | Node.js, Express.js, MongoDB, JWT |
Input Validation | Zod (on frontend) |
API | RESTful (JSON-based) |
Auth | JWT (Bearer Token) |
State Mgmt | Local Component State (or Context) |
- π User Authentication (JWT)
- π Product Catalog
- π¦ Cart Functionality
- π Pincode Availability Check
- π§Ύ Order Creation (Planned)
- π¨ Fully Responsive UI
- π§Ή Clean & Modular Code
cd backend
npm install
Create a .env
file inside the backend
folder:
PORT=5000
MONGO_URI=mongodb+srv://<your-db>
JWT_SECRET=your_jwt_secret
Start the backend:
npm run dev
cd frontend
npm install
npm run dev
This will start the React app at http://localhost:5173
.
Method | Endpoint | Description |
---|---|---|
GET | /api/products |
Fetch all products |
GET | /api/products/:id |
Get single product |
POST | /api/auth/signup |
Register user |
POST | /api/auth/signin |
Login user |
Zod is used to validate frontend forms like:
- Login / Register
- Address input
- Pincode checker
const formSchema = z.object({
email: z.string().email(),
password: z.string().min(6),
});
- Admin Dashboard
- Product Filters
- Product Ratings / Reviews
- Payment Gateway Integration
- Image Carousel & Zoom
Add product page, cart view, and authentication UI screenshots here.
Contributions are welcome! Fork the repo, make your changes, and submit a PR.