NOTE: To host this application in docker for local development, please see file here: Docker Hosting GDX Agreements Tracker
For deploying to OpenShift please reference the OpenShift Readme
Below is the current preferred method for development. (ao. 03/25/2022)
The following prerequisites are required for this application to function correctly:
- PostgreSQL
- NPM (latest stable version)
- Colima or Docker desktop
- Clone the repo to your local development system:
git clone https://github.com/bcgov/gdx-agreements-tracker.git
- Install dependencies for the backend.
- Open a new terminal in the directory of the repo you just cloned locally and run the following commands:
cd /backend npm i
- Open a new terminal in the directory of the repo you just cloned locally and run the following commands:
- Now install dependencies for the frontend.
- Open a new terminal in the directory of the repo you just cloned locally and run the following commands:
cd /frontend yarn i
- Open a new terminal in the directory of the repo you just cloned locally and run the following commands:
- Run the seeders and migrations for the local development database.
- To bring your local database up to the latest version run:
docker compose exec backend npx knex migrate:latest docker compose exec backend npx knex seed:run
-
Update the .env file in the backend directory (backend .env) with the following:
- If you don't what JWKSURI should be, contact your site administrator
NODE_ENV=development JWKSURI=https://example.com/auth/realms/aaoozhcp/protocol/openid-connect/certs POSTGRES_PORT=15432 POSTGRES_HOST=localhost POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DATABASE=gat_db DATABASE_AUTO_DEPLOY=1
This step is required to run the app as the npm start command requires the app to run locally with https. This only has to be run on intial setup.
-
install the following with brew through terminal
brew install mkcert
brew install nss
mkcert -install
-
From the root of your gdx-agreement-tracker frontend, you should now run:
mkdir -p .cert
mkcert -key-file ./.cert/key.pem -cert-file ./.cert/cert.pem "localhost"
-
Start the Database container in docker
- Open a terminal in the root of the project directory and run:
docker compose start db
- Open a terminal in the root of the project directory and run:
-
Start the backend and frontend
- Open a terminal in the /frontend directory and run:
npm run start
- Open a terminal in the /backend directory and run:
npm run start
- Open a terminal in the /frontend directory and run:
-
In your browser, visit localhost:3000 to access the site and login