Some information on how to locally build and serve the website if you would like to make changes to the code. There are two ways to do this:
- docker
- closer to production environment
- but less convenient for development - you need to rebuild the image every time you make a change
- python/pnpm
- further from production environment setup
- but convenient for development - see changes immediately without having to rebuild or restart anything
Requires docker and docker compose.
- clone the repo:
git clone https://github.com/ssciwr/predicTCR.git
cd predicTCR
- generate a SSL cert/key pair:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=localhost'
- build and run the website locally in docker containers on your computer:
docker compose up --build
The website is then served at https://localhost/ (note that the SSL keys are self-signed keys and your browser will still warn about the site being insecure.)
The database will by default be stored in a docker_volume
folder
in the folder where you run the docker compose command.
To modify this location, set the PREDICTCR_DATA
environment variable.
JWT tokens used for authentication are generated using a secret key.
This can be set using the PREDICTCR_JWT_SECRET_KEY
environment variable.
If this is not set or is less than 16 chars, a new random secret key is generated when the server starts.
When you # for an account when running locally it will send an email (if port 25 is open) to whatever address you use.
You can also see the activation_token in the docker logs,
and activate your local account by going to https://localhost/activate/<activation_token_from_logs>
sudo sqlite3 docker_volume/predicTCR.db
sqlite> UPDATE user SET is_admin=true WHERE email='you@address.com';
sqlite> .quit
In the runner directory, create a .env
file with the following content:
PREDICTCR_RUNNER_API_URL="http://backend:8080/api"
PREDICTCR_RUNNER_JWT_TOKEN="" # you need to generate this using the admin page of your local instance
PREDICTCR_RUNNER_LOG_LEVEL=DEBUG
Then build and start the runner with:
docker compose up --build
Requires Python and pnpm
- clone the repo:
git clone https://github.com/ssciwr/predicTCR.git
cd predicTCR
- install and run the backend development server:
cd backend
pip install .
cd ..
predicTCR_server
- install and run the frontend development server:
cd frontend
pnpm install
pnpm run dev
The website is then served at http://localhost:5173/. Note that the email activation message will be written to the console instead of being sent by email.
- install and run the runner:
cd runner
pip install .
predicTCR_runner