About | Features | Technologies | Requirements | Starting | License | Author
This project aims to create and manage the notifications of a system in an organized and well be structured way. Developed during Rocketseat Education's Ignite Lab Classes (@rocketseat-education)
✔️ Create notification;
✔️ List notification recipient by id;
✔️ Count notifications from recipient id;
✔️ Get recipient data from notification id;
✔️ Cancel notification by id;
✔️ Mark notification as read;
✔️ Mark notification as unread;
✔️ Persist information to database;
Nota: Database options to persist data https://www.prisma.io/docs/concepts/database-connectors#overview
The following tools were used in this project:
- Upstash
-
- Create new Cluster
-
- Insert a name
-
- Select a region
-
- Click Create to continue
-
Before starting 🏁, you need to have Git and Node installed.
-
Access your terminal
-
Execute commands bellow:
# clone project $ git clone https://github.com/andrelinos/notifications-service.git # Access project folder cd notifications-service
-
Access here and follow steps to continue
# Execute application
$ yarn start
# Create a new notification message
$ yarn create:producer
The server will initialize in the http://localhost:3000
- Create (POST): http://localhost:3000/notifications
{
"recipientId": "0dc9af21-4915-4908-b8b1-779a7cad9629",
"content": "Você tem uma nova notificação",
"category": "social"
}
- Count from recipient (GET): http://localhost:3000/notifications/count/from/0dc9af21-4915-4908-b8b1-779a7cad9629
{
"count": 2
}
- Get content from recipient (GET): http://localhost:3000/notifications/from/0dc9af21-4915-4908-b8b1-779a7cad9629
{
"notifications": [
{
"id": "e44e7c26-8939-4d22-8834-c539ba2d0949",
"content": "Você tem conta pra pagar",
"category": "mega",
"recipientId": "0dc9af21-4915-4908-b8b1-779a7cad9629"
},
{
"id": "e92af443-40fd-4c86-90a2-069a4cd3b9bf",
"content": "Você tem conta pra pagar",
"category": "mega",
"recipientId": "0dc9af21-4915-4908-b8b1-779a7cad9629"
}
]}
- Cancel notification (PATCH): http://localhost:3000/notifications/0dc9af21-4915-4908-b8b1-779a7cad9629/cancel
- Mark as read notification (PATCH): http://localhost:3000/notifications/0dc9af21-4915-4908-b8b1-779a7cad9629/read
- Mark as unread notification (PATCH): http://localhost:3000/notifications/0dc9af21-4915-4908-b8b1-779a7cad9629/unread
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by Andrelino Silva