Skip to content

[INDIA] A spring POC for tracking jabs/vaccines. It exposes an API that performs various types of search on the availability of vaccines. Also it exposes configurable jobs that can run as per the schedule defined and check for availability

Notifications You must be signed in to change notification settings

errakeshm/jab-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vaccine Tracker POC App

  • This is a POC Spring based application that provides the following:
    • API : An API that consumes the COWIN Open API and provides you with various filter option
    • Batch Job : Batch Application that would keep track of slot availability. Also alerts the user with an alarm sound incase of availability.
    • Messaging Based solution (In Progress)

API Description

Base URL : http://localhost:8080/api/cowin

Methods

ALL

Example : http://localhost:8080/api/cowin/all?district_id=446&date=16-05-2021

Description : Provides you with all center related information

AVAILABLE

Example : http://localhost:8080/api/cowin/available?district_id=446&date=16-05-2021

Request Parametes(Optional) :

  • fee_type : free/paid
  • age_limit : 18/45
  • type : covaxin/covishield
  • dose : 1/2 (dose 1/dose 2)

Examples including optional request parameters:

Batch Job

  • This module is responsible for checking the slot availability in a periodic manner
  • The user has complete control over what needs to be run a period manner.
  • Also the user is given the option of configuring the batch job as per the desired schedule schedule.
  • For FUN : The application also **sounds an alarm **when a slot is available. To enable it mark the property alarm.enabled=true in configurations.properties :)

Output

  • If slots are available based on the configured job the data is printed in the system console as mentioned below :

Example

Configuration

  • The configuration for batch job is defined in two files : beans.xml, scheduler.properties

scheduler.properties

# Job Names (Comma separated job names. You can define multiple)
jobs.names=available18Free09,available18Free16

# Cron expression for the job (<jobName>.scheduler.expression=0/20 * * * * ?)
available18Free09.scheduler.expression=0/20 * * * * ?
available18Free16.scheduler.expression=0/30 * * * * ?

# Whether job is enabled or not (<jobName>.job.enabled=true|false). If job is not enabled it wont be run by the scheduler
available18Free09.job.enabled=false
available18Free16.job.enabled=true

beans.xml

<!-- Define job configuration. Name should be same as <jobName> defined in scheduler.properties -->
<bean name="available18Free16" class="com.tracker.cowin.batch.dataobjects.JobConfiguration">
    <!-- jobName --> 
        <property name="name" value="available18Free"></property>
        <property name="api" value="${calendarByDistricts}"></property>
        <property name="params" ref="available18Free16-params"></property>
    </bean>
    
    <!-- All the query parameters are defined as key-value pair.-->
    <util:map id="available18Free16-params" key-type="java.lang.String" value-type="java.lang.String">
        <entry key="district_id" value="446"></entry>
        <entry key="date" value="16-05-2021"></entry>
        <entry key="fee_type" value="free"></entry>
        <entry key="age_limit" value="45"></entry>
    </util:map>

About

[INDIA] A spring POC for tracking jabs/vaccines. It exposes an API that performs various types of search on the availability of vaccines. Also it exposes configurable jobs that can run as per the schedule defined and check for availability

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages