NOTE: This solution is no longer actively maintained, it serves solely as an example application for integrating with Aarogya Setu OpenAPI.
This is application is an integration with Aarogya Setu OpenAPI which allows you track your employees' COVID status and keep them safe. This code example is accompanied by this blog post.
We will be using AWS CDK to deploy our application stack. This will require you to install a few dependencies and tools, if you already have any of these installed please continue with the next step.
- Install all the pre-requisites for building and deploying cdk apps
- Install cdk in python related prerequisites
- Register for a developer account at the Asetu portal. You can only query status for the mobile number used to register the developer account.
For ease of demonstration and best experience this workshop assumes you have a user with Administrator access. You can configure more restrictive permissions for your user as required.
Note: The demo application is configured to deploy to ap-south-1
region
Download or clone the repo and open a terminal inside it. Then follow the below steps to deploy your application. You can read the explanation of each step given below.
python3 -m venv .env
source .env/bin/activate
pip install -r requirements.txt
cdk deploy asetuapi
# Fill the placeholders in `secrets.json`
python update-api-secret.py
cdk deploy asetuapifrontend
These commands perform operations equivalent to the following steps. You can paste the commands directly or make the changes yourself.
- Clone or download this repository to directory and open it in terminal.
python3 -m venv .env
- Create a new virtual environnment to install dependencies. This creates a .env directory.- Activate the environment. If you're on Mac or Linux use
source .env/bin/activate
. If you're on windows use.env\Scripts\activate.bat
- Install the required libraries using
pip install -r requirements.txt
- Deploy backend using
cdk deploy asetuapi
. This command will bundle up the dependencies and deploy the backend infrastructure for the application - The cdk app also creates a secret in the AWS Secrets Manager but it does not put the api secret values in it. Fill the placeholders in
secrets.json
with the values from your Aarogya Setu OpenAPI account and then runpython put-api-secret-value.py
. This will put values fromsecrets.json
into AWS Secrets Manager. - Deploy the fronted using
cdk deploy asetuapifrontend
. It will package the frontend application for export and deploy the infrastructure. Openasetuapifrontend.appurl
to access the web page. - Sign up as a new user and then log in. VOILA! You can now check COVID risk status and make your office safe for everyone.
You can remove both stacks using cdk destroy asetuapi asetuapifrontend
. The S3 bucket can be deleted after you remove the static files stored in it, or you can use the following command, aws s3 rb --force s3://<bucket-name>
. Finally you can delete the CDKToolkit
stack or leave it as it is.