Is the companion site for the thesis fairs hosted by the University of Amsterdam. A thesis fair is an event where students and companies meet each other to find interesting thesis projects and students respectively.
To run the platform locally in development mode (e.g. with automatic updating of microservices in response to edited code), it is presumed that you have access to a local kubernetes cluster set up using minikube. Minikube requires some certain settings for this (see code below).
You will be running the helm chart in development mode, which at a minimum requires setting dev.enabled
to true
in your values.yaml
. You will also want to have a container repository running locally to push the containers to, which will be pulled by the helm chart to run the platform.
In dev-values.yaml
:
dev_mode: true
msa:
API_gateway:
env:
JWT_SECRET: # Fill in
OPENID_ISSUER_URL: # Fill in
OPENID_CLIENT_ID: # Fill in
OPENID_CLIENT_SECRET: # Fill in
OPENID_REDIRECT_URL: # Fill in
OPENID_RESOURCE: # Fill in
user_service:
env:
jwtKey: # Fill in
OVERRIDEMAIL: # Fill in
MAILHOST: # Fill in
MAILPORT: # Fill in
MAILUSER: # Fill in
MAILPASS: # Fill in
Run:
minikube start --mount --mount-string="${location of repository on your machine}:/home/docker/thesisfair"
minikube addons enable ingress
make pushDevelop # Will run a local container repository for you and push the containers there
helm install thesisfair chart --values dev-values.yaml # Run the helm chart in dev mode
kubectl port-forward svc/database 27017:27017 # Give your local machine access to the database in minikube
node test/test/db.js run # Populate the database with test values
xdg-open http://$(minikube ip) # Go to the platform
or alternatively, simply run make dev
to start the dev environment.
JWT_SECRET
- Is the signing key for the JSON web tokens. The API gateway and user service need this token. It can be generated using the commandopenssl rand -base64 512
.FS_ROOT
- The root path of the project on the filesystem. Used to mount the data directories into the containers. (For example/opt/thesisfair/
)URL
- The url of the website(For examplethesisfair.ivi.uva.nl
).
These should be supplied to the API gateway.
OPENID_ISSUER_URL
- The URL of the openID instance.OPENID_CLIENT_ID
- The Client ID that identifies this application to the openID server.OPENID_CLIENT_SECRET
- The Client Secret to validate that this application is actually this application.OPENID_REDIRECT_URL
- The URL to which should be redirected afterwards. Should have the formhttps://<YRK>/sso/loggedin
OPENID_RESOURCE
- Should have the formhttps://<URL>
.
These are used by the user service to send emails regarding representative accounts.
OVERRIDEMAIL
- All emails that the system will send will be sent to this email address instead of the "correct" email address.MAILHOST
- The SMTP host.MAILPORT
- The port to use for SMTP.MAILUSER
- The username to authenticate this application to the SMTP server.MAILPASS
- The password to authenticate this application to the SMTP server.
Run make pushProduction
in the root of the project. Make sure you are logged into the fnwi CR.
All monitoring related configuration can be found in /deploy/monitoring/
.
Copy the template below to /deploy/monitoring/.env
and /deploy/monitoring/.env.prod
for staging and production environment respectively.
URL
- The same URL value as the other environment file.WHITELISTED_IPS
- A comma separated list of all the IPs that are allowed to reach the Grafana dashboard.
URL=
WHITELISTED_IPS=
Duplicate /deploy/monitoring/alertmanager.template.yml
to /deploy/monitoring/alertmanager.yml
and configure alertmanager to your liking.
SSH to the server and run docker compose up -d
in the monitoring directory to start the monitoring stack.
- Prometheus runs on port 9090
- Alert manager runs on port 9093
- Grafana runs on
https://{URL}/grafana
for whitelisted IPs
Run node test/test/db.js run
to initialize the database for testing.
The default logins are: student
, rep
, repAdmin
and admin
. Where the password is their username.
All data is automatically imported from an external system. Documentation for this is below.
The only manual database change that needs to be made is the creation of administrator accounts.
Administrators can be created by adding an entry in the users
collection with a field email of type string and a field admin of type boolean and value true. Afterwards, the user can log in via single sign-on on the supplied email address.
- Duplicate the file
/msa/.env.examle
, name it/msa/.env
and fill in the blanks. - Run
make ci
ormake install
in the root of the project to runnpm ci
ornpm install
respectively for each microservice.
This is a simple utility script which allows you to run the same command in every microservice folder.
Usage: runCmd.sh <root> <command>
So from the root of the project running npm ci
is:
./scripts/runCmd.sh ./msa "npm ci"
The docker-files in the different service folders should be executed from /msa
.
The following environment variables should be used within the docker-compose files:
NODE_ENV
-> Set asNODE_ENV
during buildingNODE_CMD
-> Command to execute to start the container, eitherstart
for development with automatic restarting orproduction
for production.
All shared libraries are in the /msa/libraries
folder. The folder name should match their package name on npm so that during building the code can be rewritten using the regex (\.\./)*libraries
-> @amicopo
When the NODE_ENV
is set to development
, it is possible to authenticate get requests sent directly from the browser by adding an authorization query parameter.
This way it is possible to access the graphqli interface via the URL: http://localhost:3000/api/graphql?authorization={"type":"a"}