Skip to content

πŸ›’πŸš€ A robust eCommerce REST API (built with Express.js & MongoDB) designed to streamline the development of online stores. It offers comprehensive features including user authentication, product management, cart functionality, order processing, and much more.

License

Notifications You must be signed in to change notification settings

fazle-rabbi-dev/Bazaar-Hub-Rest-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bazaar-Hub-Rest-Api πŸ›οΈ

Built With πŸ‘‡πŸΎ

Bazaar-Hub-Rest-Api is a powerful and flexible eCommerce API that makes it easy to build online stores. Use this API as a solid template for any eCommerce platform, saving you time and effort. It covers everything from product management and user authentication to cart functionality and order processing. This complete API, from scratch to documentation, provides a strong foundation and simplifies your development process.

πŸ”΄ Unveiling the Journey of Building Bazaar-Hub-Rest-Api

Note

I developed this e-commerce API to enhance my REST API development skills. It served as a real-world project to master industry-standard REST API concepts, providing me with invaluable hands-on experience. In this API, I applied all of my REST API development skills to create a comprehensive and robust solution.

Project Created at

  • πŸ—“ June 2024

Technologies Used βš’οΈ

  • Node.js
  • Express.js
  • MongoDB
  • Cloudinary
  • Express-Validator
  • Node Mailer

πŸ”₯ Fun Fact! How I Made This project || Screenshots

Read Here

🌟 This project was created using an Android phone

πŸ“± Coding with Android is Amazing!

If you think you need a PC to start coding, think again! With just an Android phone, you can dive into the world of web and app development. Here’s a showcase of a project created entirely on an Android phone using Acode, Restler, and Termux.

πŸ”§ Tools Used:

  • Acode: A powerful code editor with features similar to VS Code, such as auto code completion, keyboard shortcuts, and theme customization.
  • Restler: A REST API client for testing and debugging APIs similar to Postman.
  • Termux: A terminal emulator for Android that allows you to run Linux commands and scripts.
  • Hacker's Keyboard: A pc like Keyboard for Android that allows you to use commands like: Ctrl, Alt, F1, F2, (Up, Down, Right, Left Arrow) etc.

πŸ–ΌοΈ Screenshots:

  1. Project in Acode Editor:
Acode Editor Acode Editor
  1. Running the Project in Termux:
Termux Termux
  1. Testing APIs with Restler:
Restler Restler Restler

πŸš€ Why Coding with Android is Amazing:

  • Portability: Code anytime, anywhere with just your phone.
  • Convenience: No need to carry a laptop; everything you need is in your pocket.
  • Efficiency: Get a lot done with minimal resources.

[!Note] With the right tools, learning and developing on an Android phone is not only possible but also an incredibly rewarding experience. Start your coding journey now!


Features

  • πŸ” Authentication: Secure user authentication and authorization.
  • πŸ›’ Cart Management: Add, update, and remove items from the shopping cart.
  • πŸ“¦ Order Management: Create and manage orders and delivery statuses.
  • πŸ“ Product Management: CRUD operations for products with detailed information.
  • πŸ—ƒοΈ Category Management: Organize products into categories for easy navigation.
  • πŸ“Š Pagination & Sorting: Efficiently manage large data sets with pagination and sorting features.
  • 🌐 Partial Response: Retrieve only the necessary data for optimized performance.
  • πŸ“€ File Upload with Cloudinary: Upload and manage files using Cloudinary.
  • πŸ”’ Secure with JWT: JSON Web Tokens for secure authentication.
  • βœ… Validation with Express-Validator: Ensure data integrity and correctness.
  • 🚦 Rate Limit: Protect against abuse and ensure fair usage.
  • πŸ“§ Account Confirmation: Features for confirming user accounts before login.
  • πŸ”‘ Reset Password: Allow users to securely reset their passwords.
  • πŸ“§ Change Email: Enable users to change their email with new email.
  • πŸ” Change Password: Allow users to securely change their passwords.
  • ️🐞 Graceful Error Handling: Consistent and informative error responses.
  • πŸ“ƒ Documentation: A comprehensive documentation with swagger.

Important

Please note that the API Documentation is currently a work in progress. Proper API documentation using Swagger is not yet complete. This means some endpoints may not be fully documented.

Note

Im working on completing this documentation to provide a more comprehensive guide for using Bazaar-Hub-Rest-Api.

Live Demo πŸŽ‰

The API has not yet been deployed.


Setup Guide

Prerequisites

Ensure you have the following installed on your machine:

  • Node.js
  • Git

Installation

  1. Clone the repository:

    git clone https://github.com/fazle-rabbi-dev/Bazaar-Hub-Rest-Api
    cd Bazaar-Hub-Rest-Api
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    Create a .env file in the root directory and add your configuration settings. For example:

    PORT=3000
    
    MONGODB_URI=
    JWT_SECRET=
    
    ACCESS_TOKEN_SECRET=
    REFRESH_TOKEN_SECRET=
    
    ACCESS_TOKEN_EXPIRY="1d"
    REFRESH_TOKEN_EXPIRY="10d"
    
    CLOUDINARY_CLOUD_NAME=
    CLOUDINARY_API_KEY=
    CLOUDINARY_API_SECRET=
    
    GMAIL_USERNAME=
    GMAIL_PASSWORD=<Write your app password that you can get by enabling two factor auth in your gmail account>
    
    ENVIRONMENT=dev <For Seeding Purpose>
    
  4. Customize Configuration: Modify the constants in /src/index.js to fit your specific needs.

  5. Run the server:

    npm run dev

Usage

  • πŸš€ The server will start on http://localhost:3000.

  • Use a tool like Postman to interact with the API endpoints.

  • API base URL: http://localhost:3000/api/v1

    • AUTH Base URL: base_url/auth
    • USERS Base URL: base_url/users
    • PRODUCTS Base URL: base_url/products
    • CATEGORIES Base URL: base_url/categories
    • CARTS Base URL: base_url/carts
    • ORDERS Base URL: base_url/orders
    • SEEDING Base URL: base_url/seed
  • πŸ“˜ API Documentation:

    • http://localhost:3000/api-docs
  • ⚑ API Health Check:

    • http://localhost:3000/health

Contributing πŸ«±πŸ»β€πŸ«²πŸΌ

Contributions are welcome! πŸŽ‰ If you would like to contribute to Bazaar-Hub-Rest-Api, please follow these steps:

  1. Fork the repository: Click the "Fork" button at the top right of this page to create a copy of this repository under your GitHub account.
  2. Clone your fork: Clone your forked repository to your local machine.
    git clone https://github.com/your-username/Bazaar-Hub-Rest-Api
  3. Create a branch: Create a new branch for your feature or bugfix.
    git checkout -b feature/your-feature-name
  4. Make your changes: Make your changes to the codebase.
  5. Commit your changes: Commit your changes with a clear and concise commit message.
    git commit -m "Add your commit message here"
  6. Push to your branch: Push your changes to your forked repository.
    git push origin feature/your-feature-name
  7. Create a Pull Request: Go to the original repository on GitHub and create a pull request from your forked repository. Provide a clear description of your changes and the reasons for them.

Your contributions will help make Bazaar-Hub-Rest-Api even better. Thank you for your support! πŸš€

License

This project is licensed under the MIT License.


Thank you for using Bazaar-Hub-Rest-Api! I hope it accelerates your eCommerce development and makes your life easier. Happy coding! πŸš€

πŸ“¬ Connect with me

Let's connect! Reach out for collaborations, projects, or just a friendly chat.

Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi

Feel free to explore, contribute, and get inspired!

About

πŸ›’πŸš€ A robust eCommerce REST API (built with Express.js & MongoDB) designed to streamline the development of online stores. It offers comprehensive features including user authentication, product management, cart functionality, order processing, and much more.

Topics

Resources

License

Stars

Watchers

Forks