A simple e-commerce application built using Node.js, Express, EJS, and MongoDB.
- User authentication and management
- Product listing and management
- Shopping cart functionality
- Order processing
- Admin dashboard for managing products and orders
- Node.js: Server-side JavaScript runtime
- Express.js: Web application framework for Node.js
- EJS: Embedded JavaScript templating engine
- MongoDB: NoSQL database for storing data
- Mongoose: ODM (Object Data Modeling) library for MongoDB and Node.js
-
Clone the repository:
git clone https://github.com/your-username/shop-app.git cd shop-app
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the following variables:MONGO_URI=mongodb://localhost:27017/shop PORT=3000
-
Run the application:
npm start
The application will be running on
http://localhost:3000
.
- controllers/: Contains the route handlers for the application.
- data/: Contains data files or seed data (if any).
- images/: Stores images used in the application.
- middleware/: Contains middleware functions used in the application.
- models/: Defines the MongoDB models and schemas.
- public/: Contains static files like CSS, JavaScript, and images.
- routes/: Defines the application's routes.
- util/: Contains utility functions.
- views/: Contains EJS templates for rendering HTML.
Feel free to fork the repository and submit pull requests. For major changes, please open an issue to discuss your proposed changes before implementing them.