https://github.com/joeldev1021/ecommerce-api
e-commerce api
https://github.com/joeldev1021/ecommerce-api
cqrs ddd ddd-architecture dependency-injection domain-driven-design ecommerce eventbus express hexagonal-architecture inversify jest nodejs rabbitmq rest-api ts
Last synced: about 1 year ago
JSON representation
e-commerce api
- Host: GitHub
- URL: https://github.com/joeldev1021/ecommerce-api
- Owner: Joeldev1021
- Created: 2021-11-11T16:26:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T01:02:56.000Z (about 3 years ago)
- Last Synced: 2025-02-03T20:51:50.623Z (over 1 year ago)
- Topics: cqrs, ddd, ddd-architecture, dependency-injection, domain-driven-design, ecommerce, eventbus, express, hexagonal-architecture, inversify, jest, nodejs, rabbitmq, rest-api, ts
- Language: TypeScript
- Homepage:
- Size: 731 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# E-commerce API!
## Description
This project is an e-commerce API that is based on Domain-Driven Design (DDD) and also implements a CQRS pattern.
In DDD, the different parts of the system are separated into different "domains", each with its own logic and business rules. Each domain is further divided into "subdomains" that focus on a specific task. To handle domain events, we will use RabbitMQ, which allows us to exchange messages asynchronously and scalably. Currently, this project has 3 domains.
- **User**
- **Category**
- **Product**
> **Note:** Please note that I am not an expert in these technologies, methods, and patterns. If you have any advice or feedback, it will be welcome.

## Technologies
> Nodejs, Express, Typescript, Typeorm, Inversify, amqplib, Eslint, Prettier, Docker
## Structure project ☘️
```tree
├── src
│ ├── apps
│ │ ├── mooc
│ │ └── backend
│ │ ├── command
│ │ ├── controller
│ │ ├── dependency-injection
│ │ ├── routes
│ │ ├── bootstrap.ts
│ │ └── server.ts
│ └── contexts
│ ├── category
│ │ ├── infrastructure
│ │ ├── application
│ │ └── domain
│ ├── product
│ │ ├── infrastructure
│ │ ├── application
│ │ └── domain
│ ├── shared
│ │ ├── infrastructure
│ │ ├── application
│ │ └── domain
│ └── user
│ ├── infrastructure
│ ├── application
│ └── domain
└── test
```
## Environment 🔑
```
PORT=4000
DB_NAME=ecommerce
MYSQL_USER=root
MYSQL_PASSWORD=example
MYSQL_PORT=3306
```
```
RABBIT_USERNAME='example'
RABBIT_PASSWORD='example'
RABBIT_VHOST='/'
RABBIT_SECURE=false
RABBIT_HOSTNAME='localhost'
RABBIT_PORT=5672
EXCHANGE_NAME='domain_events'
MAX_RETRIES=3
MODULE_NAME='mooc'
````
## Getting Started 🚀
1. Fork this project:
- [Click here](https://github.com/Joeldev1021/ecommerce-api).
2. Clone the repository:
```
git clone https://github.com/Joeldev1021/ecommerce-api
```
3. Install dependencies:
```
npm install
npm run docker:up
npm run rabbit:config:command
npm run dev
```