This API allows users to subscribe to notification emails, if any vaccine slot is empty within their pincode.
- Users can subscribe for emails about vaccine availability
- Email confirmation before subscribing to avoid spamming
- Unsubscribe button in emails if user wishes to do so.
- Cron Job runs every 1.5 hours to check for availability
- Clone the repo using
git clone https://github.com/ShauryaAg/VaccineNotifierAPI.git
- Move into the project folder
cd VaccineNotifierAPI/
- Create a
.env
file in the project folder
CURRENT_HOST=<Your Deployment Link>
PORT=<PORT>
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOST=postgres
SECRET=<Secret>
SENDGRID_API_KEY=<Your Key>
- Run using
sudo docker-compose up
- Install the dependecies using
go mod download
- Run using
go run server.go
-
This can't be deployed on Heroku since Cowin public API doesn't allow requests from anywhere outside India (at least from my experience) and Heroku doesn't allow us to choose Indian region.
-
Deploy on AWS / Digital Ocean / GCP / Any other cloud service
-
It is currently deployed on AWS
-
/api/auth/register
- Allowed Methods:
POST
- Accepted Fields:
{name, email, password, age, pincode, preferredVaccine}
- Returns:
User Details
- Sends a confirmation mail to the user
- Allowed Methods:
-
/api/auth/login
- Allowed Methods:
POST
- Accepted Fields:
{email, password}
- Returns:
{id, email, token}
Make sure email is confirmed before logging in
- Allowed Methods:
-
/api/auth/user
-
Allowed Methods:
GET
PATCH
-
GET
- Authorization:
Bearer <Token>
- Returns:
User details after update
- Authorization:
-
PATCH
- Accepted Fields:
User details to be updated
- Returns:
User details after update
- Accepted Fields:
-
-
-
api/auth/unsub
- Allowed Methods:
POST
- Authorization:
Bearer <Token>
- Unsubscribe user from getting notification mails
- Allowed Methods:
-
api/auth/reset_password
- Allowed Methods:
POST
- Accepted Fields:
{email}
- Sends a password reset email to the user
- Allowed Methods:
-
api/notifyall
- Allowed Methods:
GET
- Sends a notification email to all the registered users
This endpoint was created for testing purposes and doesn't work in production
- Allowed Methods:
-
/t/<token>
- Allowed Methods:
GET
- View to verify email confirmation token
- Allowed Methods:
-
/u/<token>
- Allowed Methods:
GET
- View to unsubscribe user from notification emails
- Allowed Methods:
-
/f/<token>
- Allowed Methods:
GET
POST
- View to reset user password
- Allowed Methods: