This repository contains the code for the API service that communicates to the Database and exposes endpoints to interact with it alongside Bio specific alignment algorithms and search export functionality.
No endpoint documentation is available yet since this API is not meant to be used publicly.
In order to develop for this repository you need:
- Python 3.12 (but any
>3.12
should work fine) - Docker
- Have env-development running locally.
First, clone this repository:
git clone https://github.com/starpep-web/api-bio
Create an environment:
python3 -m venv ./venv
Load the environment:
source ./venv/bin/activate
(Or, if you're on Windows, you might have to do it with:)
.\env\Scripts\activate.ps1
Install the dependencies:
pip install -r requirements.txt
Create an .env
file with the following contents:
REDIS_URI=redis://localhost:6379
NEO4J_DB_URI=bolt://localhost:7687
ASSETS_LOCATION=/path/to/files
TEMP_ARTIFACTS_LOCATION=/path/to/artifacts
Run the fastapi
entrypoint:
fastapi dev main.py
And done, the service should be reachable at http://localhost:8000
.
Some testing commands are available to you:
This command will run unit tests once.
This command will run the unit test runner in watch-mode.
If you're developing this on your local machine, consider building the Docker image with the following command:
docker build -t local-starpep/api-bio:latest .
You can create a new container to try it out with the following command:
docker run -it --rm -p 8000:8000 -e REDIS_URI=redis://localhost:6379 -e NEO4J_DB_URI=bolt://localhost:7687 -e ASSETS_LOCATION=/path/to/files -e TEMP_ARTIFACTS_LOCATION=/path/to/artifacts local-starpep/api-bio:latest
And done, the service should be reachable at http://localhost:8000
.
Consider checking this docker-compose.yml for an example on how to run this image in production.