This repository contains the NodeJS backend proxy for Het Archief.
It is build with:
- node:
v20.x.x
( ~lts/20.4
) - npm:
v9.x.x
- Nest:
v9.5.0
For a complete list of packages and version check out the package.json
file.
To setup this project, clone the repo and run npm i
to install the dependencies.
This will also setup husky via the npm run prepare
script,
this lifecycle script will run automatically after the install.
This project runs with Docker for local development and production images.
To start working, simply run docker-compose up
, the project will be available on port 3100
.
The available commands for development are:
command | runs |
---|---|
start | Run the develompent server. |
start:dev | Run the development server in watch mode. |
start:prod | Run the server in production mode. |
The available commands for building the project are:
command | runs |
---|---|
build | Build a production ready app to the /dist folder. |
The available commands for testing the project are:
command | runs |
---|---|
test | Run all the unit tests. |
test:watch | Run all the unit tests in watch mode. |
test:cov | Run all the unit tests with coverage collected. |
test:e2e | Run all the integration tests. |
Other available commands are:
command | runs |
---|---|
format | Format all files with prettier. |
lint | Lint all files with ESLint. |
lint:fix | Lint all files and automatically fix most of the problems. |
This project uses environment variables. For local development, these can be found in the .env/
folder in the root of the project.
There you can find a .env.template
file which contains all the environment variables used in this
project.
Create your own .env.local
file here with the correct values to get started. Check 1password (hetarchief - proxy - .env (TST, QAS)
)
to find the end var values for local development or contact
a developer of the project (see package.json for a list of contributors).
They are provided through the env_file
property in the docker-compose.yml
file.
There are a few debug env vars that can be useful:
-
Log queries and responses from the elasticsearch instance:
ELASTICSEARCH_LOG_QUERIES=true
-
Log queries and responses from the graphql instance:
GRAPHQL_LOG_QUERIES=true
-
Ignore object licenses in the database:
IGNORE_OBJECT_LICENSES=true
-
Enable sending email and redirect CP emails to a different email address:
ENABLE_SEND_EMAIL=true [email protected]
-
Change the elasticsearch endpoint to debug with more search results on QAS or PRD:
ELASTICSEARCH_URL=http://es-prd-hetarchief.private.cloud.meemoo.be ELASTICSEARCH_URL=http://es-qas-hetarchief.private.cloud.meemoo.be ELASTICSEARCH_URL=http://es-int-hetarchief.private.cloud.meemoo.be
To run Hasura (Database / GraphQl) locally, follow the instructions as described in https://github.com/viaacode/hetarchief-hasura
Simply run docker-compose up
to start all necessary services. The hasura console will be available on http://localhost:9000
Frequently pull this repo and update hasura to stay in sync.
In the hetarchief-hasura
folder, run the following commands (requires the hasura-cli):
hasura metadata apply
hasura migrate apply
hasura metadata reload
hasura seed apply //Select database 'hetarchief'. If all went fine, you'll see the message `INFO Seeds planted` as confirmation.
hasura seed apply --endpoint https://hasura-graphql-tst-hetarchief.private.cloud.meemoo.be --admin-secret <secret>
secrets for databases can be found in the environment variables and secrets in openshift:
- https://console-openshift-console.meemoo2-2bc857e5f10eb63ab790a3a1d19a696c-i000.eu-de.containers.appdomain.cloud/k8s/ns/hetarchief/configmaps
- https://console-openshift-console.meemoo2-2bc857e5f10eb63ab790a3a1d19a696c-i000.eu-de.containers.appdomain.cloud/k8s/ns/hetarchief/secrets
Follow Slite doc: https://studiohyperdrive.slite.com/app/docs/L0Alk6HWq5w7il
This project has been created by:
- Andry Charlier: [email protected]
Has been worked on by:
- Bart Naessens: [email protected]
- Ian Emsens: [email protected]
- Bavo Vanderghote: [email protected]
- Brecht Tourlousse: [email protected]
It is currently maintained by:
- Robbe Bierebeeck: [email protected]
- Bert Verhelst: [email protected]