The shadow analysis application is containerized and deployed using Flask and docker.
The core server component is server.py
, and the project includes other shadow-related modules, helper scripts, and utility functions can be found in the src/ directory.
The .ipynb
file used to validate the hosted application is shadow_client.ipynb
.
The apache conf used to reverse proxy the hosted application is present in apache/
.
If you want to set up the project, you can refer to the setup instructions below.
- API Gateway - https://gw5lcvggtg.execute-api.us-east-2.amazonaws.com/smart-research/shadow-matrix
- Request Method: POST
- Authentication: TOKEN is required in json parameters
- JSON Parameters:
- TOKEN (required)
- cmap (optional)
- Allowed cmap values -
['viridis', 'plasma', 'inferno', 'magma', 'cividis']
- Allowed cmap values -
- Install Python (3.9+)
- Install Python Package Manager (pip/pip3)
- Set up the environment :
- Create virtual environment files -
python3 -m venv venv
- Activate virtual environment -
source venv/bin/activate
- Create virtual environment files -
- Install dependencies -
pip3 install -r requirements.txt
- Configure mongo atlas
- Create a database -
smart_research
- Create a collection -
shadow_matrix
- Create a database -
- Copy contents of
.env.example
to a new file.env
-cp .env.example .env
- Fill
.env
file following setup-env.
- Fill
- Start the server -
flask --app server run
- Access the application in port
5000
- Install
docker
- Install
docker-compose
- Copy contents of
.env.example
to a new file.env
-cp .env.example .env
- Fill
.env
file following setup-env.
- Fill
- Build the docker image -
docker-compose build
. - Start the container -
docker-compose up -d
. - Access the application in port
5000
- Set
APP_SECRET
to random secret string - Set
DB_PROTOCOL
tomongodb+srv
if you are using mongo atlas, otherwisemongodb
(in most cases). - Set
DB_HOST
,DB_USERNAME
, andDB_PASSWORD
to your values. - If you are using mongo atlas, you won't have
DB_PORT
. Otherwise, fillDB_PORT
.