Code Monkey home page Code Monkey logo

ibrahimahmed237 / online-shop Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 156 KB

Welcome to the Online shop, a robust Node.js-based solution for efficiently managing products, handling user authentication, streamlining checkout operations with Stripe, and providing a seamless user experience. This application is designed with a comprehensive set of features and technologies to meet the demands of modern e-commerce platforms.

JavaScript 54.04% CSS 11.29% EJS 34.67%
bycryptjs csrf-protection ejs error-handling helmet joi-validation mongoose multer nodejs nodemailer pdf-generation session stripe

online-shop's Introduction

Online shop Application

This is a Node.js application for managing products. It allows administrators to add, edit products, manage user authentication, handle checkout operations with Stripe, and send emails for signup confirmation and password reset. It also includes error handling for common HTTP status codes, pagination for product listing, generates a PDF file for the checkout, provides cart operations, manages orders, handles user registration and password reset, manages products, validates user and product information, uses Express.js as the web framework, EJS as the view engine, and sessions for storing user data.

Installation

First, clone the repository to your local machine:

git clone [email protected]:ibrahimahmed237/Online-shop.git

Then, navigate to the project directory and install the dependencies:

npm install

Usage

To start the application, run:

npm start

Configuration

The application requires several environment variables to be set in order to run properly. These can be set in a .env file in the root directory of the project. Here are the required variables, add them to your .env file:

  • PORT: The port number the API will listen on.
  • MONGODB_URL: The connection URL for the MongoDB database.
  • STRIPE_SECRET_KEY: (Your Stripe secret key here)

Features

  • User Registration and Authentication:

    • Users can securely register with their name, email, and password.
    • Robust authentication with password hashing ensures user security.
  • Password Management:

    • Password reset functionality for users who forget their passwords.
    • Email confirmation upon successful signup.
  • Product Management:

    • Administrators can effortlessly add and edit products, ensuring a dynamic product catalog.
    • Product information is thoroughly validated to maintain data integrity.
  • Image Handling:

    • Support for product image uploads in popular formats (.jpg, .jpeg, .png, .bmp).
    • Utilizes Sharp for converting and optimizing images.
  • Cart Operations and Checkout:

    • Seamless cart management for users, including adding products and reviewing cart items.
    • Secure checkout operations facilitated by integration with Stripe.
  • Order Management:

    • Users can place orders, each containing detailed information about products and user data.
  • PDF Generation:

    • Generates PDF files for checkout, enhancing user documentation.
  • Error Handling and Notifications:

    • Custom error pages for 404 (Page Not Found) and 500 (Internal Server Error) status codes.
    • Flash messages for effective user notifications.
  • Security Measures:

    • Implements CSRF protection for enhanced security.
    • Utilizes bcrypt for password hashing.
  • Technological Stack:

    • Developed using Express.js as the web framework.
    • EJS employed as the view engine.
    • MongoDB for session storage.
    • Incorporates various dependencies for tasks such as email handling, image processing, and more.

Dependencies

  • Express.js: For handling server and routes.
  • bcrypt: For hashing passwords and ensuring user security.
  • nodemailer: For sending emails.
  • Multer: For handling multipart/form-data, which is primarily used for uploading files.
  • Sharp: For converting large images in common formats to smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
  • Stripe: For handling secure checkout operations.
  • Mongoose: For modeling and managing application data.
  • Joi: For validating user and product information.
  • connect-mongodb-session: For MongoDB session storage.
  • csurf: For CSRF protection.
  • connect-flash: For flash messages.
  • EJS: For the view engine.
  • express-session: For handling sessions.
  • Other dependencies...

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

online-shop's People

Contributors

ibrahimahmed237 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.