Installing the Web Portal
System Requirements
To operate the backend system, you must have one of the following:
- A 64-bit Mac OS (Intel or ARM)
- A 64-bit Linux machine (Ubuntu or Debian)
Prerequisites
- Successfully installed and running backend system (refer to the backend system installation guide).
- Docker installed on your machine. If it's not, please follow this guide to install Docker.
I. (Optional) Create Development Environment
This section is only required if you are planning to make changes to the source code.
-
Install NodeJS version 16.15.0 or higher from https://nodejs.org/en/download/.
-
Setup the Yarn package manager:
-
Run
corepack enable
in your terminal to activate Yarn. -
Inside your project directory, run
yarn
to install project dependencies. -
Run
yarn dev
to start the yarn development server.
-
II. Build a Production Environment
-
Clone the portal repository from GitHub by running
git clone https://github.com/S-HealthStack/web-portal.git
-
Navigate to the cloned repository.
cd web-portal
-
Determine your
API_URL
andPUBLIC_PATH
. HereAPI_URL
is the base API URL to access endpoints andPUBLIC_PATH
is the path that will be used to host the app. -
Build a Docker image with the desired variables provided as build arguments:
docker build . -t open-source-portal \ --build-arg API_URL="http://localhost:8080" \ --build-arg PUBLIC_PATH='/' \ --build-arg MOCK_API='/api'
-
Run the Docker image:
docker run -d -p 8081:80 open-source-portal
At this point, the resulting Docker image is running nginx on port 80
.
If you prefer to build static files instead of using Docker:
- Install NodeJS version 16.15.0 or higher.
- Run
corepack enable
to activate yarn.- Run
yarn
to install dependencies.- Run
yarn build
with desired variables set using environment. For example,API_URL=https://example.com yarn build
.
The resulting static files will be located in the /build
folder and can be hosted using any web server.
III. Launch Web Portal and Create Account
-
Open your web browser (Chrome is recommended as of this writing) and navigate to your
PUBLIC_PATH
URL, for example:http://localhost:8081/
. -
In the Sign in dialog box that appears, click Create account.
-
Follow the prompts to generate an account activation email.
-
Open the email and complete the account creation and sign in process.
Note: If you are the very first person to create an account, the system adds the
Team Admin
team role to your account settings. This role has advanced access privileges to the system, therefore it's recommended for your system administrator to create the first account.