Skip to content

Latest commit

 

History

History
204 lines (155 loc) · 16.4 KB

README.md

File metadata and controls

204 lines (155 loc) · 16.4 KB

Nestify
Nestify

Node.js Express.js MongoDB AWS Jest Stripe

An E-Commerce API built with Node.js, Express.js, MongoDB, and integrated with AWS and Stripe. Designed for robust and scalable online shopping experiences.

DemoKey FeaturesTechnical HighlightsHow To UseAPI RoutesAPI UsageBuilt WithMy Practices


Deployed Version

Explore the live API here 👉🏻 : https://nestify.systems/


Key Features

  • Authentication & Authorization 🚀
    • Sign up, login, logout, password reset, and Google OAuth integration.
    • Role-based access control (admin, user, manager) with JWT authentication.
  • User Profile 🧑‍💼
    • Users can update their profile, including username, email, and password.
    • Admins can manage all user profiles.
  • Product Catalog & Search 🛒
    • Browse and search products by categories, brands, and other filters.
    • Powerful search functionality to find products quickly.
    • Admins can manage products (add, update, delete).
  • Shopping Cart & Checkout 🛍️
    • Add products to cart and checkout securely with Stripe payments.
  • Order Management 📦
    • Users can track order history and shipping status.
    • Admins manage orders and process refunds.
  • Reviews & Ratings 🌟
    • Users can leave reviews for purchased products; admins can delete inappropriate ones.
  • Discounts & Coupons 💸
    • Apply discount codes at checkout; admins manage promotions.
  • Favorites ❤️
    • Users can save favorite products for future purchases.

Technical Highlights

Feature Description
Authentication & Authorization Google OAuth integration via Passport.js for seamless user login.
Role-Based Access Control Admin, user, and manager roles with granular permissions.
AWS S3 Efficient cloud storage for serving and managing product images.
Stripe Payment Gateway Secure and reliable payment processing for customer transactions.
Validation Strong input validation using express-validator ensures data integrity.
Unit & Integration Testing Comprehensive test coverage ensures API reliability and stability.
AWS Deployment Scalable and high-performance hosting using AWS EC2.

API Routes

The following routes are available for interacting with the API:

  • All routes are prefixed with /api/v1/. For example, to access the orders endpoint, use /api/v1/orders.
Resource Route Methods
Categories /categories GET, POST, PATCH, DELETE
Subcategories /subcategories GET, POST, PATCH, DELETE
Brands /brands GET, POST, PATCH, DELETE
Products /products GET, POST, PATCH, DELETE
Users /users GET, POST, PATCH, DELETE
Authentication /auth GET, POST, PATCH
Reviews /reviews GET, POST, PATCH, DELETE
Favorites /favorites GET, POST, DELETE
Addresses /addresses GET, POST, DELETE
Coupons /coupons GET, POST, PATCH, DELETE
Cart /cart GET, POST, PATCH, DELETE
Orders /orders GET, POST, PATCH

API Usage

Before using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:

- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000/ or https://nestify.systems/)
- {{password}} with your user password as value.

For more info check API Documentation on Postman 👉🏻 E-Commerce API Documentation.


How To Use

You can get the E-Commerce API up and running on your local machine using the following steps:

  1. Fork or Git-clone:

    • You can fork the app on GitHub or git-clone it into your local machine.
    git https://github.com/AhmedSalman1/E-Commerce-API.git
    cd e-commerce-api
  2. Install Dependencies and Set Environment Variables:

    • In the root directory of the app, create a file named .env.
    $ npm install
    Set your env variables(like: .env.example)
  3. Run Commands:

    $ npm run start (for development)
    $ npm run start:prod (for production)
    
  4. Run Tests:

    $ npm run test
    
  • Run specific test files:

    $ npm run test --file tests/auth.test.js
    

Built With

  • NodeJS - JavaScript runtime environment
  • Express - The web framework used
  • Mongoose - Object Data Modelling (ODM) library
  • MongoDB Atlas - Cloud database service
  • AWS EC2 - Cloud computing service for hosting the application
  • AWS S3 - Cloud storage for managing and serving images
  • Google OAuth - Authentication via Google account
  • Stripe - Online payment API for handling payments
  • Jest - JavaScript testing framework for unit and integration tests
  • Mailgun - Email delivery platform for transactional emails
  • Postman - API testing and documentation tool

My Development Practices

I adhere to these practices to ensure a maintainable and scalable codebase:

These principles guide my work to deliver high-quality, reliable, and scalable software.


Conclusion

  • Thank you for exploring this E-Commerce API built with NodeJS. This project is designed to provide a robust backend for online shopping platforms, with features like authentication, product management, and secure payment processing.

  • Feel free to clone the repository, contribute, or open issues for any questions or bugs.