E-Commerce Web App Practical Report
E-Commerce Web App Practical Report
To build a basic e-commerce web application using the MERN stack (MongoDB, Express, React,
Node.js) that allows users to register, browse products, add items to the cart, and checkout. The app
includes role-based access for admin and customers to manage products and orders.
PROCEDURE
- Initialize separate projects for backend (Node.js + Express) and frontend (React.js).
2. Backend Development:
- Implement REST API routes for user authentication, product CRUD operations, and order
processing.
3. Frontend Development:
- Create React components/pages for Home (product listing), Product Details, Login/Register,
4. Styling:
- Apply Bootstrap classes and custom CSS for a responsive and user-friendly interface.
- Optionally deploy backend and frontend on platforms like Heroku, Netlify, or Vercel.
MAIN CODE
app.use(cors());
app.use(express.json());
name: String,
price: Number,
image: String,
category: String,
});
res.json(products);
});
function ProductList() {
useEffect(() => {
axios.get('http://localhost:5000/api/products')
}, []);
return (
<div className="container">
<h2>Products</h2>
<div className="row">
{products.map(p => (
<div key={p._id} className="col-md-4 card m-2">
<div className="card-body">
<h5>{p.name}</h5>
<p>Price: Rs.{p.price}</p>
</div>
</div>
))}
</div>
</div>
);
OUTPUT
On launching the app, users can view a list of available products with images, names, and prices.
Customers can register/login, add products to their cart, and proceed to checkout. Admins can
RESULT
The e-commerce web application successfully demonstrates core functionalities including user
authentication, product browsing, cart management, and order processing. The system supports
role-based access and provides a responsive UI for both customers and admins.