A demo web-map application designed to display active fires for give country based on user selection.
FastAPI was used as backend with a Streamlit Folium map frontend, active fires data are from FIRMS dataset based on country code through the FIRMS Country API. Follow the setup guide below to try it out. Enjoy !!!
HTTP
git clone https://github.com/enguy-hub/streamlit_fastapi_firms.git
SSH
git clone git@github.com:enguy-hub/streamlit_fastapi_firms.git
For CONDA
environment (assuming conda or miniconda is already installed), run the following command at the root folder:
-
Create a conda environment from the
conda_env.yml
file:conda env create --file conda_env.yml
-
Activate the conda environment:
conda activate stfapi
-
Install the packages/dependencies in editable mode:
pip install -e .
For VENV
environment, perform the following commands at the root folder:
-
Create a python
venv
virtual environment:python -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Install the package in editable mode:
pip install -e .
Source: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
Run the following command at the root folder:
uvicorn api.main:app --reload
The server will be available at http://127.0.0.1:8000/
Get your FIRMS Map Key here: https://firms.modaps.eosdis.nasa.gov/api/area/
Enter your map key in the YOUR_FIRMS_MAP_KEY_HERE
variable in the services/firms_services.py
file
streamlit run stfapi_firms.py
The app will be available at http://localhost:8501
For CONDA
environment, run the following command:
conda deactivate
For VENV
environment, run the following command:
deactivate