Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 1.83 KB

README.md

File metadata and controls

75 lines (50 loc) · 1.83 KB

Post Service

The main function of the Post service is to create and fetch posts of a particular postId and get the total count of posts by a particular user.


Database (post)

Although noSQL database is used but a proper Schema is maintained.

TrackCollection


Attribute Type Description
_id string trackId of a spotify track
trackName string name of spotify track
listenUrl string url of the spotify track
artists {artistName: string, artistId: string}[] artists of the track
images string[] url of the album arts

PostCollection


Attribute Type Description
_id ObjectId postId of the post (Primary Key)
userId ObjectId userId of the user who made the post
trackId string trackId of the track which is shared in the post

API Reference

Create a new post and publishes a PostCreatedEvent.

  POST /api/post


Get the no. of posts made by a user with id userId

  GET /api/post/getPostCount:userId


Returns the count of comments on a post with id postId.

  GET /api/comment/:postId/count

Events

PostCreatedEvent

It is published whenever a new post is created .

Attribute Type Description
postId string postId of the created post
userId string userId of the user which created post

Architecture Diagram

post