This project is an api for a notification redirection service that receives data in the form of notifications and forwards it to a designated destination.
It also acts as a Kafka consumer to receive messages from multiple other services asynchronously.
This project was built during the IgniteLab event hosted by RocketSeat.
git clone https://github.com/mathbraga/rs_nest_prisma.git
npm install
cp .env.example .env
npm run start:dev
You can also run an intuitive database UI with Prisma
npx prisma studio
You can also run unit tests for each one of the use-cases and some entities. The test framework is Jest
npm run test
To send messages to this service using Kafka, you need a Kafka producer to create the messages.
I recommend following this guide from KafkaJS to create a simple producer, but you can use whatever is your preferred approach. You can also use something like Upstash.
Request body
{
"category": "test",
"content": "New notification test.",
"recipientId": "some-unique-id"
}
Response: newly created notification
{
"id": "some-unique-id",
"category": "test",
"content": "New notification test.",
"recipientId": "some-unique-id"
}
Request body
None
Response
{
"count": number
}
Request body
None
Response
{
"notifications": [
{
"id": "some-unique-id",
"category": "test",
"content": "New notification test.",
"recipientId": "some-unique-id"
},
...
]
}
Request body
None
Response
None
Request body
None
Response
None
Request body
None
Response
None
Released in 2022.
This project is under the MIT License.