NTNU Beta - Web Page
This is a web application created to present NTNU Betas projects/services. Users associated with NTNU can access the application by logging in with FEIDE. A secondary registration option is implemented to allow external users to access this site. It requires an administrator to approve the request. As an administrator one can also create, edit and delete projects/services, as well as manage tickers. Everyone with access to the page can share concerns and issues they may have with features in the projects. These tickers are available to all users, but can only be resolved by administrators.
Getting Started
This application runs entirely on Docker. All the application processes are running in cleanly separated docker containers.
Prerequisites
The only prerequisite for running this is a working docker installation. Both docker and docker-compose are required. Follow the instructions from the official documentation:
- Docker
- Docker Desktop for Mac: https://docs.docker.com/docker-for-mac/install/
- Docker Desktop for Windows: https://docs.docker.com/docker-for-windows/
- Docker for Linux:
On desktop systems like Docker Desktop for Mac and Windows, Docker Compose is included as part of those desktop installs.
- Docker Compose
https://docs.docker.com/compose/install/
⚠️ Warning: do not attempt to simply run apt-get install docker docker-compose on older Ubuntu platforms, such as 16.04 (Xenial), as you will get older versions of these utilities.
Installation
-
Clone the project
``git clone https://gitlab.stud.idi.ntnu.no/simenve/ntnu-beta-web.git``
-
Navigate to the ntnu-beta-web folder:
``cd PATH_TO_PROJECT_FOLDER/ntnu-beta-web/``
-
Run the following command to build and start the services:
``docker-compose build && docker compose up``
- Visit the application on http://localhost:3000
Configuration
- Https credentials
- Set your private key and certificate in
server.js
or preferably add the files toserver/config/
- Database configuration If you wish to use another database than the one that ships with the application you can change the database credentials:
- Set your db credentials in
server/config/default.json
- Json Web Token secret
- Set your jwt secret in
server/config/default.json
- Third party SAML identification (Feide)
- We are using the npm package passport-saml to handle XML requests and responses
- Set the metadata for your identity provider in
server/config/default.json
- Provide your metadata (entityID, SSO and SLO) to your SAML IDP
- Update
SSO_redirect
andSLO_redirect
inserver/config/default.json
tohttps://<DOMAIN>/
andhttps://<DOMAIN>:3000/login
- Update routes to the backend API calls
- We've used a proxy during development that routes every call from frontend to backend to
localhost:5000/...
- These backend API calls from the frontend needs to be updated manually before production
- Create adminuser
- The first adminuser has to be added manually to the database
Run development servers
- Run the backend
-
npm run server
from beta-web/server
- Run the frontend
-
npm start
from beta-web/