Skip to content
Yvette Martinez edited this page Apr 19, 2022 · 8 revisions

Quickstart

In order to get started locally:

  1. Clone the repo: git clone https://github.com/RiceAstroparticleLab/xenon-users-web.git
  2. Add a .env file with all the required environmental variables
  3. In order for the app to run, MONGO_LOCAL_URI, DAQ_MONGO_URI, GITHUB_CLIENT_ID, and EXPRESS_SESSION must not be left blank. In order to log in, you must have at least created an OAuth app or created a GENERAL_LOGIN_PW instead.
  4. If running locally, the base url must be set to an empty string (BASE_URL=""). If running on LNGS machine, the BASE_URL="/shifts". This variable must be set to the correct value in both the .env file and public/javascripts/directory_scripts.js in order to have access to all necessary javascripts and functions.
  5. From the root directory run npm start
  6. If running locally open http://localhost:3000/ in your browser. Otherwise, check https://xenonnt.lngs.infn.it/shifts/ and hope everything is right.

Required environmental variables

In the root directory, create a file called .env that contains the following values:

MONGO_LOCAL_URI=""
DAQ_MONGO_URI=""
CALLBACK_URL=""
GITHUB_CLIENT_ID=""
GITHUB_SECRET_KEY=""
SLACK_INVITE=""
NOTIFS_ACCOUNT=""
SMTP_HOST=""
SMTP_PORT=
CHRIS_EMAIL=""
CB_EMAIL=""
ZE_EMAIL=""
ADMIN_EMAIL=""
EXPRESS_SESSION=""
PERSONAL_ACCESS_TOKEN=""
LDAP_BIND_DN=""
LDAP_BIND_CREDENTIALS=""
LDAP_URI=""
GENERAL_LOGIN_PW=""
PORT=
ERROR_FILE=""

For more info on how to get the necessary values for these, please see the tab on Environmental Variables.

Source code structure

xenon-users-web/
├── bin/
├── config/
├── public/
│   ├── images/
│   ├── javascripts/
│   └── stylesheets/
├── routes/
└── views/
    └── components/

The bin/ folder contains the www file which contains the startup scripts for the website. The config/ folder contains the file which configures all the different Passport.js strategies used as authentication for the website. The images/, javascripts/, and stylesheets contain all the static assets that are served through the express.static middleware. The routes/ folder contains different files that create routers as modules (mini-apps) which are then mounted on a path in the main app. The views/ folder contains all the EJS files with the HTML that gets rendered for each page. The components/ folder within it contains components which can be reused inside main pages by just including them wherever necessary using <% include components/XXXX %> where XXXX represents the name of the component. Beyond that, any other included file provides support for packages, choosing which files get pushed to GitHub (.gitignore) and the main app itself (app.js).

Clone this wiki locally