GenoTracker is a FastAPI and Streamlit-based application for managing and visualizing genomic cohort data. The backend service is implemented using FastAPI, and the frontend is created with Streamlit. The application can read cohort data from both local CSV files and Google Cloud Storage (GCS).
- Load and visualize genomic cohort data.
- Supports reading data from local files and GCS.
- Interactive data exploration using Streamlit.
- Dockerized for easy deployment and scalability.
- Supports secure configuration using Docker secrets.
genotracker/
│
├── genotracker/
│ ├── __init__.py
│ ├── api/
│ │ └── endpoints.py
│ ├── models/
│ │ └── cohort_data.py
│ ├── services/
│ │ └── data_service.py
│ │
│ ├── tests/
│ ├── __init__.py
│ ├── test_data_service.py
│ └── test_main.py
├── Dockerfile.fastapi
├── Dockerfile.streamlit
├── docker-compose.yml
├── pyproject.toml
└── README.md
- Python 3.11+
- Docker
- Docker Compose
- Google Cloud SDK (for accessing GCS)
-
Clone the repository:
git clone https://github.com/dvitale199/genotracker.git cd genotracker
-
Install dependencies:
Using Poetry:
poetry install
Or using pip:
pip install -r requirements.txt
-
Set up Google Cloud credentials:
Ensure you have a service account JSON key and set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable:export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-file.json"
Using Docker Compose
-
Build and start the services:
docker-compose up --build
-
Access the services:
- FastAPI: http://localhost:8000
- Streamlit: http://localhost:8501
-
Run tests using pytest:
pytest
GOOGLE_APPLICATION_CREDENTIALS
: Path to the Google Cloud service account JSON key.
For secure handling of sensitive information, Docker secrets are used. Ensure your docker-compose.yml
is set up correctly to use the secret:
secrets:
gcloud-service-account:
file: ./secrets/gp2-release-terra-e65c1b67820b.json
-
Build the Docker images:
docker build -t gcr.io/your-project-id/genotracker-fastapi -f Dockerfile.fastapi . docker build -t gcr.io/your-project-id/genotracker-streamlit -f Dockerfile.streamlit .
-
Push the images to Google Container Registry:
docker push gcr.io/your-project-id/genotracker-fastapi docker push gcr.io/your-project-id/genotracker-streamlit
-
Deploy the services to Cloud Run:
gcloud run deploy genotracker-fastapi --image gcr.io/your-project-id/genotracker-fastapi --platform managed --region your-region --service-account [email protected] gcloud run deploy genotracker-streamlit --image gcr.io/your-project-id/genotracker-streamlit --platform managed --region your-region --service-account [email protected]
This project is licensed under the MIT License - see the LICENSE file for details.