A simple E-commerce MERN stack application for managing products. This application allows users to create, view, edit, and delete products using MongoDB, Express, React, and Node.js.
https://mern-app-d6q9.onrender.com/
- Create new products
- View all products
- Edit existing products
- Delete products
- MongoDB: NoSQL database for data storage
- Express: Web framework for Node.js
- React: Frontend library for building user interfaces
- Node.js: JavaScript runtime for server-side logic
- Chakra UI: Modular and accessible component library for React
Clone the repository:
git clone https://github.com/mahirsust/mern-app.git
cd mern-app
npm run build
Create a .env file in the root directory of the project. Refer to .env.example for the required variables:
# db settings
MONGO_URI = Your MongoDB URI
# server settings
NODE_ENV = Node Environment
DEV_PORT = Development Port
PROD_PORT = Production Port
- Use
NODE_ENV=development
for running the app in development mode. - Use
NODE_ENV=production
for running the app in production mode.
Replace the placeholders with your actual MongoDB URI.
npm run dev
The application will run on the port defined in DEV_PORT for the backend server.
Then, open another terminal and execute the following command for the frontend development server.
cd fronend
npm run dev
The application will run on another port for the frontend.
Execute this command given below in the root folder (mern-app).
npm run build
npm run start
The application will run on the port defined in PROD_PORT.
- Create Product: Navigate to the product creation form to add a new product.
- View Products: All products are displayed on the main page.
- Edit Product: Click on the edit button next to a product to modify its details.
- Delete Product: Click on the delete button next to a product to remove it.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.