A guide for developers.
Install
Create a .env file based on met-api/sample.env
In the root of the met-api project run
make setup
- Run
docker-compose upin the root of the met-api project
This will start 4 containers:
- postgres met db
- postgres met test db
- postgres analytics db
- keycloak
- Update .env if needed with port.
- Install PostgreSQL
- Create a db:
createdb -h localhost -U postgres -p 5432 app
- Update .env if needed with port.
- Get the postgres db backup dump from current
devin OpenShift. - Connect to the docker postgres db
psql -h localhost -p <DOCKER_POSTGRES_PORT> -U admin- Create the required roles:
CREATE ROLE postgres WITH
LOGIN
PASSWORD 'postgres'
SUPERUSER
CREATEDB
CREATEROLE
REPLICATION
BYPASSRLS;
CREATE ROLE met;- Restore the db dump
pg_restore -h localhost -U postgres -p <DOCKER_POSTGRES_PORT> -d postgres -v <DEV_DB_BACKUP.DUMP>- Connect to the db and set the search path
psql -h localhost -p <DOCKER_POSTGRES_PORT> -U postgres -d postgresSET search_path TO met;You should now be able to query the table with the restored data.
- Get the postgres db backup dump from current
devin OpenShift. - Restore the db dump
pg_restore -h localhost -U postgres -p <POSTGRES_PORT> -d app -v <DEV_DB_BACKUP.DUMP>- Connect to the db and set the search path
psql -h localhost -p <POSTGRES_PORT> -U postgres -d appSET search_path TO met;You should now be able to query the table with the restored data.
In the root of the met-api project run
make run
make test
Create a .env file based on met-web/sample.env
Installing the packages:
npm install
Starting the app:
npm start
* met-api must be running concurrently
Running the unit test:
npm run test
Create a .env file based on met-cron/sample.env
Installing the packages:
make setup
This is a task scheduler project, to run tasks manually use the following commands:
make run_closeout
make run_publish
Create a .env file based on met-etl/sample.env
Running the app:
docker compose up
Create a .env file based on notify-api/sample.env
Installing the packages:
make setup
Starting the app:
make run
Running the unit test:
make test
Create a .env file based on analytics-api/sample.env.
Follow similar steps for met-api setup to populate anaytlics db if needed.
A custom redash project is used for some of the dashboards within MET.
If needed, to start an instance clone the following repository:
git clone https://github.com/bcgov/redash
create a .env file with the following:
REDASH_COOKIE_SECRET=redash
Run the docker compose command:
docker compose up