โจ Sample bug tracker app (Trello like) with event-driven microservices architecture using Apache Kafka as message broker for educational purpose
- Read: What is Apache Kafka || Install Kafka with Homebrew ๐
- Stack: Nodejs, Express, Postgre, MariaDB, MongoDB, Kafka, JWT Auth, PM2, KrakenD API Gateway
- API Docs: Postman
- Find Redis Streams example ? bugtracker-redis
- Step run the app :
1. Auth (postgree-express) [table:users]
-
endpoint:
- register
- login
- logout
- refresh jwt token
- get current user data
- get all users (+filter by name & offset based pagination)
- get detail user
-
event
- publish: newUser, newNotif
- consume: -
2. Project (mariadb-express) [table:project,card,comment,users]
-
note : here, i am still merging project service with the card service, i think the coupling is too tight to be place in separated services and because it is only for learning purpose, so ya i think it's ok to place it in the same service.
-
endpoint:
- create project
- get projects (+filter by project title & offset based pagination)
- get detail project
- update, delete project (cascade delete card)
- create,update & delete card
- get cards by projectId (+filter by status & cursor based pagination)
- get detail card
-
event
- publish: newProject, updateProject, deleteProject, newCard, updateCard, changeCardStatus, newNotif
- consume: newUser, newComment, deleteComment
3. Comment (mariadb-express) [table:comment,users,card,project]
-
endpoint:
- create comment (when comment create, totalComment in card must be update too)
- get comments by cardId (cursor based pagination)
- get detail comments
- delete comment
-
event:
- publish: newComment, deleteComment, newNotif
- consume: newUser, newProject, updateProject, deleteProject, newCard, updateCard, updateCardStatus
4. Notif (MongoDB-express) [collections: notif ]
-
endpoint:
- get notifications by userId (mongoose paginate). type notification: registration, create project, delete project, create card, change status card, create commet
-
event:
- publish: -
- consume: newNotif
- you can add, category services for grouping card inside project
- better error handling & query validation
- some primary feature, ex: forgot password, change password, kick member from project, advance permission etc..
- better try fail over & storage mechanism
- write unit & integration test
- if you have a lot of free time, you can add docker & kubernetes on top of it
๐ก July 2022 - faeshal.com