Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.63 KB

README.md

File metadata and controls

64 lines (44 loc) · 1.63 KB

User Service

The main function of the Comment service is to create and fetch comments of a post and the count of comments.


Database (user)

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

UserProfileCollection


Attribute Type Description
_id ObjectId userId of user (Primary Key)
userName string userName of the user
email string email of the user
firstName string first name of the user
lastName string last name of the user
bio string bio of the user
gender string gender of the user
profileImage string url of profile image of the user

API Reference

Gets the profile info of a user with id userId

  GET /api/user/:userId/profile

Gets the name and username of a user

  GET /api/user/:userId/profile/forPost

Upload a new profile image

  PUT /api/user/:userId/profile/image

Delete the previous profile image

  DELETE /api/user/:userId/profile/image

Handlers

Handlers consumes events from NATS stream and processes them.

It consumes the UserCreatedEvent and processes it to create a document related to that user in UserProfileCollection .


Architecture Diagram

user