Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.45 KB

HOWTORUN.adoc

File metadata and controls

56 lines (43 loc) · 1.45 KB

How to Run the WHAM Server Locally

This document provides step-by-step instructions for setting up and running the WHAM server locally.

Prerequisites

  1. Install Python 3.12 or later.

  2. Install MongoDB.

Steps to Run the Server

1. One-time local setup

To run the server locally, the overall approach is to clone the repo, create a python virtual environment, and install the dependencies and application. This is typically a one-time activity.

1.1. Clone the Repository

Clone the repository to your local machine:

git clone https://github.com/FNNDSC/wham.git
cd wham

1.2. Create a python virtual environment

Create a venv in the repo directory:

python -m venv venv

1.3. Install Dependencies

Install the required dependencies using pip:

pip install -r requirements.txt

1.4. Install the Application in Editable Mode

To ensure the application is available for uvicorn, install it in the current environment:

pip install -e .

2. Start MongoDB

Now, assuming the application an dependencies are setup in a local python virtual environment, start MongoDB locally or using Docker Compose:

docker-compose up

3. Run the WHAM Server

Run the FastAPI server using uvicorn:

uvicorn app.main:app --reload --host 127.0.0.1 --port 8000

4. Access the Application

Open your browser and navigate to: - API Root: http://127.0.0.1:8000 - Interactive API Docs: http://127.0.0.1:8000/docs