- Send Reddit Notification Email
- run the
docker-compose
available in the root directory. - To start run below command
docker-compose up -d
- To Stop run below
docker-compose down
-
Either you can remove the volume path from
docker-compose
but data will be lost if container is stopped, Or change it to your local path. -
Create Sendgrid Api key and set it in the Application.yml
api:
key: {Please add your Sendgrid API key}
- Then run the application directly from your id. Application starts at 8081 port.
- Create User Account
- URL
http://localhost:8081/api/user/create/
- PUTRequest
{
"fullName":"Umesh Verma",
"emailId":"TestEmail@gmail.com",
"countryCode": "DE",
"notificationStatus": "SUBSCRIBED"
}
- GETRequest with Path Param {emailId}
- URL
http://localhost:8081/api/user/fetch/{emailId}
- Response Format : Please Note UserId is essential for further API call
{
"userId": "dd178821-15c6-45c2-9b97-7df4d1ce73d1",
"emailId": "TestEmail@gmail.com",
"notificationStatus": "SUBSCRIBED"
}
- URL
http://localhost:8081/api/user/enableSubscription
- PUTRequest
{
"userId": "8b065a35-b305-49e9-b601-2e7ecbe84f4f"
}
- URL
http://localhost:8081/api/user/disableSubscription
- PUTRequest
{
"userId": "8b065a35-b305-49e9-b601-2e7ecbe84f4f"
}
- URL
http://localhost:8081/api/subscribe/addChannel
- PUTRequest
{
"userId": "dd178821-15c6-45c2-9b97-7df4d1ce73d1",
"redditChannel": "technology"
}
-
This API removes all the old subscribed channels and Add new updated channel.
-
URL
http://localhost:8081/api/subscribe/updateChannel
- PUTRequest
{
"userId": "dd178821-15c6-45c2-9b97-7df4d1ce73d1",
"redditChannel": "technology"
}
-
This API will send the email to list of user provided they have notification enabled and have valid channel subscribed.
-
URL
http://localhost:8081/api/email/send
- PUTRequest
[
"dd178821-15c6-45c2-9b97-7df4d1ce73d1",
"8b065a35-b305-49e9-b601-2e7ecbe84f4f",
"97095a32-h602-47b2-l205-6h0ecke24j4j"
]
- Application will be Running in UTC TimeZone
- I will be having some Api to identify Users Local TimeZone and equivalent UTC time.
- User always sending correct Channel names during Adding channel, no validation done for checking valid channel names.
- No failure in third party system (Ahh!!! this is big one)
- Proper exception handling.
- Proper User response during exception in API.
- Using Circuit breaker during calling third party API.
- Fault tolerance, handle failure scenario.
- Retry logic during failure.
- Transaction handling.
- Code refactoring.
- Proper Logging for debugging.
- Monitoring and health check dashboard the API.
- API documentation as code.
- Executor service to send email in parallel to the USER.
- Adding Integration test.
- Add more Unit Test.