Skip to content

πŸ”” Notification application, using NestJS integrated with Prisma as ORM.

Notifications You must be signed in to change notification settings

gabrielvsc/notifications-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”” Notifications Microsservice


NestJS TypeScript Prisma

πŸ“„ Description

Β  This service was born out of the fact that many applications need notifications functionality nowadays, so it is extremely feasible to separate this functionality into a single microservice that can be implemented by anyone who wants to.

Β  This microservice specializes in notifications, where other applications can communicate with it to send notifications. This service will only be responsible for notifications.

πŸ–₯️ Run Application

Clone this Repository

$ git clone https://github.com/gabrielvsc/notifications-microservice.git

Go to the directory

$ cd notifications-microsservice

Install dependencies

$ npm install

Run with

$ npm run start

This starts in http://localhost:3000

πŸ§ͺ Run Tests

Run Tests with

$ npm run test
$ npm run test:watch

You can run with Prisma Studio

 $ npx prisma studio

πŸ“• API Documentation

πŸ“Œ Create Notification

  POST /notifications

Create a Notification if you give a body with.. recipientId must be a UUID.

JSON Example: { "recipientId": "6d6eec98-1b86-4bda-891c-d0b595697273", "content": "New Test Notification", "category": "Test" }


πŸ“Œ Count from Recipient

  GET /notifications/count/from/{recipientId}

Returns a count of {recipientId} notifications

JSON Example: { "count": 1 }


πŸ“Œ Get from Recipient

  GET /notifications/from/{recipientId}

Returns a Array of {recipientId} notifications JSON Example: { "notifications": [ { "id": "1e5d8ae6-847e-41d3-9151-ff76444b8fac", "content": "New Test Notification", "category": "Test", "recipientId": "6d6eec98-1b86-4bda-891c-d0b595697273" } ] }


πŸ“Œ Cancel Notification

  POST /notifications/{id}/cancel

Cancels a {id} notification, does not remove


πŸ“Œ Read Notification

  POST /notifications/{id}/read

Read a {id} notification.


πŸ“Œ Unread Notification

  POST /notifications/{id}/unread

Unread a {id} notification.

About

πŸ”” Notification application, using NestJS integrated with Prisma as ORM.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published