This repository contains a subscription system consisting of three microservices built with Node.js, Nest, Nx, and MySQL, using Kafka for message processing and TypeScript for development.
- Node.js v19.8.1
- Nest v9.0.0
- Docker v2
- Nx v15.8.7
- MySQL
- Kafka
- TypeScript
- Swagger
- Jest
- TypeORM
- Prettier
This microservice uses The Orchestrator pattern and can be run in development mode using the command npm run start-orchestration
. After starting the microservice, you can access the API documentation by visiting http://localhost:3000/api
.
This microservice is responsible for sending notifications and emails and can be run in development mode using the command npm run start-email
.
This microservice contains the subscription database and manages all subscription-related tasks. It can be run in development mode using the command npm run start-subscription
.
-
Clone this repository to your local machine.
-
Create a MySQL database and update the credentials in the
.env
file. -
Install the required dependencies by running
npm install
. -
Run Kafka with Docker on
localhost:29092
using the commandnpm run start-kafka
. -
Run MySQL with Docker on
localhost:3306
using the commandnpm run start-db
. -
Run the Orchestration Microservice with the command
npm run start-orchestration
. -
Run the Email Microservice with the command
npm run start-email
. -
Run the Subscription Microservice with the command
npm run start-subscription
. -
Access the Swagger documentation at
http://localhost:3000/api
. -
To run unit tests with Jest, use the command
npm run start-test
.
- Manuel Irazabal