Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muhhylmi/express-mongoclient
create rest api and messaging using kafka
https://github.com/muhhylmi/express-mongoclient
cqrs-pattern express-typescript kafka-consumer-producer microservices rest-api typescript-mongodb typescript-postgresql
Last synced: 18 days ago
JSON representation
create rest api and messaging using kafka
- Host: GitHub
- URL: https://github.com/muhhylmi/express-mongoclient
- Owner: muhhylmi
- Created: 2021-12-11T06:04:07.000Z (about 3 years ago)
- Default Branch: refractor
- Last Pushed: 2024-02-28T10:17:29.000Z (11 months ago)
- Last Synced: 2024-11-08T22:44:09.789Z (2 months ago)
- Topics: cqrs-pattern, express-typescript, kafka-consumer-producer, microservices, rest-api, typescript-mongodb, typescript-postgresql
- Language: TypeScript
- Homepage:
- Size: 267 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## This NodeJs Rest API Repository
this is NodeJs Rest API with `postgres` as primary database, in this repo express framework used to build the Rest API. and [sequelize](https://sequelize.org/docs/v6) is used to build database model and migration.
### whats implemented in this repo
1. Rest API
2. Messaging using Kafka
3. Combine producer and consumer as one App
4. Combine postgres and mongodb as one App (postgres as primary database and mongodb for receive event data from kafka)### Messaging Workflow
```mermaid
sequenceDiagram
User->>API: hit API create note
API->>Postgres: save note
API->>Kafka: prduce event
Kafka->>MongoDB: save note
Postgres-->>API: response succes/failed
alt succes save mongo
Kafka-->>API: Commit event
else failed save mongo
Kafka-->>API: Un Commit event
end
API-->>User:response message
```## How to Run App (install dependencies / prequisites)
1. npm init
2. npm add -D typescript ts-node @types/node @types/express nodemon
3. ./node_modules/.bin/tsc --init
4. "outDir": "./build"
5. add script tsc :dev "tsc && nodemon ./build/index.js"### How to RUN APP
1. npm install
2. npm run tsc:dev