/Clean-Architecture

It's an ecommerce backend made with clean architecture

Primary LanguageJavaScript

eCommerce Project

Welcome to the ongoing eCommerce project built with Node.js, MongoDB, and Express using clean architecture. This project is designed to help developers learn about the structure and implementation of clean architecture in a real-world eCommerce application.

Introduction

The goal of this project is to build a scalable and maintainable ecommerce platform using Node.js, MongoDB and Express with Clean Architecture. The project is divided into different modules such as Category, Product, User and Order. Each module has its own use cases, entities, repositories and controllers.

Architecture

Clean Architecture is used for this project. Clean Architecture is a software design pattern that emphasizes the separation of concerns and the use of layers to ensure that the code is maintainable, testable and scalable. Clean Architecture consists of four layers:

  • Entities: These are the domain models or business objects that encapsulate the business rules and logic.
  • Use Cases: These are the application-specific business rules that define the use cases of the application.
  • Repository: These are the gateways or interfaces that define the methods to interact with the data sources.
  • Controllers: These are the interfaces that handle the HTTP requests and responses.

Features added

Categories

  • Create a new category
  • Update an existing category
  • Delete a category
  • List all categories

Products

  • Create a new product
  • Update an existing product
  • Delete a product

Getting Started

To get started with this project, follow these steps:

  • Clone the repository to your local machine.
  • Install the required dependencies by running npm install.
  • Create a .env file in the root directory and add the necessary environment variables.
  • Start the server by running npm start. ###Environment Variables The following environment variables are required to run this project: PORT: The port number on which the server will run. MONGODB_URI: The URI for the MongoDB database.

Features

Categories

  • Create a new category
  • Update an existing category
  • Delete a category
  • List all categories

Products

  • Create a new product
  • Update an existing product
  • Delete a product

Contributing

If you would like to contribute to this project, please follow these steps:

  • Fork the repository.
  • Create a new branch for your feature or bug fix.
  • Make your changes and commit them with descriptive commit messages.
  • Push your changes to your fork.
  • Submit a pull request to the main repository.