🏗️Deploying COSAP

The web application hosted on cosap.bio is quite limited for large numbers of users and runs. Therefore it can be useful for some users to have their own instance of local server and web application.

This option can be also used in the scenario where a single mirror of COSAP running in server and it is accessed via a local network. This allows keeping data within an institution.

Getting API

To start the API locally you simply clone the git repository and start containers:

git clone https://github.com/MBaysanLab/cosap-webapi.git
cd cosap-webapi

Environment Variables and Example .env File

API and COSAP requires some environment variables to be set up correctly. Here is an example .env file that contains required variables.

COSAP_DJANGO_SECRET = <your_secret>
COSAP_DJANGO_DEBUG = False
COSAP_POSTGRES_NAME = <your_postgres_database_name>
COSAP_POSTGRES_USER = <your_postgres_username>
COSAP_POSTGRES_PASSWORD = <your_db_password>
COSAP_BIO_HOST = <hostname that web app is running> # Generally localhost:3000

COSAP_HG38_BUNDLE = <hg38_resources_dir>

You can then run the containers.

docker compose up -d

This will start the COSAP worker and API which communicate via a messaging queue.

Now it is time to set up the web app.

Setting up Web Application

Clone the git repository of the web app.

git clone git@github.com:MBaysanLab/cosap_frontend.git
cd cosap_frontend

Build the app

npm run build

Install the serve package and serve the application

npm install -g serve
serve -s build

You can now start using the web application on http://localhost:3000. For instructions please see:

Last updated