This project is a full-featured online shop application built with Node.js, Express.js, and MongoDB. It includes core features like user authentication, product management, shopping cart functionality, and order processing, providing a practical, real-world example of a Node.js application.
Visit the deployed application: Online Shop Deployment
Note: Due to free tier limitations, expect delays on first load due to app sleep mode.
Note: This project is derived from the Udemy course NodeJS - The Complete Guide (MVC, REST APIs, GraphQL, Deno) by Maximilian Schwarzmüller.
Table of Contents
This online shop project simulates a functional e-commerce application where users can browse products, add items to a cart, and complete a checkout process. It covers the essential features of web development, including:
- Product Management: Admins can add, edit, and delete products.
- User Authentication: Users can sign up, log in, and manage their accounts.
- Shopping Cart: Users can add products to the cart, update quantities, and proceed to checkout.
- Order Management: Includes checkout process, order history, and payment processing.
- Responsive Design: Ensures compatibility across devices.
- Node.js: Backend server to handle requests and data processing.
- Express.js: Framework for creating server routes and API endpoints.
- MongoDB: Database for storing user, product, and order information.
- EJS: For rendering dynamic web pages.
- Stripe: For payment processing.
- SendGrid: For sending emails, including registration confirmations and password resets.
- Render: For deploying the application, providing a seamless deployment process.
- View Products: Users can view a list of products with descriptions, prices, and images.
- Admin Access: Admins can add, edit, and delete products, demonstrating CRUD operations.
- Sign Up and Login: Users can create accounts and log in securely.
- Access Control: Restricts certain actions to authenticated users only.
- Email Confirmation: Sends confirmation emails upon registration using SendGrid.
- Password Reset: Sends password reset links for account recovery.
- Add to Cart: Users can add products, adjust quantities, and remove items from their cart.
- Persisted Data: Cart data is stored in sessions or associated with user accounts.
- Checkout and Orders: Users can place orders and receive a summary; admins can view all orders.
- PDF Invoices: Generates PDF invoices, demonstrating file generation and handling.
- MongoDB & Mongoose: Stores data for products, users, carts, and orders, managed with Mongoose.
- Data Modeling: Uses schema validation to structure data and ensure consistency.
- Dynamic HTML Views: Renders dynamic HTML views with real-time data from the database.
- Email Confirmation: Sends a confirmation email upon user registration.
- Password Reset: Sends password reset links, enhancing account security.
- Form Validation: Ensures proper validation of user inputs in registration and checkout forms.
- Error Handling: Implements user-friendly error messages and error-handling best practices.
- Responsive Design: Ensures compatibility with a range of devices.
By completing this project, you will:
- Build a CRUD application with secure user authentication.
- Implement the MVC pattern for organized code.
- Integrate with a NoSQL database using Mongoose.
- Generate files (PDF invoices) and handle file downloads in Express.
- Manage user sessions and apply security practices with authentication.
- Node.js (v14.x or later)
- MongoDB: Local or Atlas instance.
- Stripe Account: For payment processing.
This project is deployed using Render. Please note the following regarding the deployment:
- Free Tier Limitations: Due to the limitations of the free tier on Render, the instance will spin down with inactivity, which can delay requests by 50 seconds or more.
Visit the deployed application: Online Shop Deployment
- Clone the repository
git clone https://github.com/RamMichaeli17/Online-Shop.git
- Install NPM packages
npm install
- Set up environment variables
- Create a
.envfile and add your credentials:MONGO_DEFAULT_DATABASE=your_mongo_default_database MONGO_PASSWORD=your_mongo_password MONGO_USER=your_mongo_user NODE_ENV=your_node_env PORT=your_port SENDGRID_KEY=your_sendgrid_key STRIPE_KEY=your_stripe_key
- Create a
- Start the server
npm start
- Admin Panel: Manage products (add, edit, delete).
- User Registration and Login: Create an account and log in.
- Shopping Cart: Add products to the cart and manage them.
- Checkout Process: Complete the purchase with payment and view order history.
Distributed under the MIT License. See LICENSE.txt for more information.
Thanks to the following people who have contributed to this project:
|
Ram Michaeli |
Ram Michaeli - ram153486@gmail.com
Project Link: https://github.com/RamMichaeli17/Online-Shop
