Skip to content

Service - API to expose Bio algorithms and search exports.

License

Notifications You must be signed in to change notification settings

starpep-web/api-bio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API - Bio

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.

Requirements

In order to develop for this repository you need:

Development

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.

Testing

Some testing commands are available to you:

pytest test

This command will run unit tests once.

ptw test

This command will run the unit test runner in watch-mode.

Building

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.

Production

Consider checking this docker-compose.yml for an example on how to run this image in production.

About

Service - API to expose Bio algorithms and search exports.

Resources

License

Stars

Watchers

Forks

Packages