Book-a-desk
The Book-a-desk web app allows any member of an organization to make desk reservations.
The source code is hosted at:
https://github.com/RBDE-Digital-Engineering/web-frameworkSetting up fresh
Requirements
The full app requires neo4j-drivers, which require some more advanced binaries. For a quick and dirty setup, your best shot is at https://github.com/RBDE-Digital-Engineering/web-framework/tree/partial_django_fresh, the minimal version for book-a-desk development.
Those requirements should be handled by docker anyways, so use Jenkins to deploy it via Jenkinsfile or manually via the Dockerfile.
Docker
Setting up a new volume should automatically initialize all tables according to the Django guidelines, all required tables are defined in the models.py files.
Jenkins Pipeline
For CI/CD, the Jenkinsfile (which can be found at the root level of the git repository) defines the pipeline for automatic deployment to the remote server.
Maintenance
Keeping it running
Replace the azure ad key for authentication every 2 years
- Delegated Permission -> User.Read, email, offline.access, OpenID
-> /home/django/web-framework-env/
-> in all .env files (hidden from ls)
For local development, create a play.py file in rbde_web/ to set environment variables. Like this:
from os import environ
from manage import main
environ['SECRET_KEY'] = 'RANDOM KEY'
environ['DEBUG'] = '1'
environ['SQL_HOST'] = '10.18.2.1'
environ['SQL_DATABASE'] = 'django_play'
environ['SQL_PASSWORD'] = 'PASSWORD FOR postgres USER'
environ['PGLAKE_PASSWORD'] = '-> idk'
environ['NEO4J_PASSWORD'] = '-> for fbe'
environ['NEO4J_STRECKEN_NETZ_PASSWORD'] = '-> for tender-graph'
environ['SENDGRID_API_KEY'] = '-> password reset mails'
environ['MS_CLIENT_ID'] = '-> azure ad ms auth'
environ['MS_CLIENT_SECRET'] = '-> azure ad ms auth'
environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = 'True'
main()Updating/Adding a Room
Since the GitHub repository gets deployed by the Jenkins workflow automatically, one only has to edit the HTML file. New offices/seats can be implemented by the same scheme of all previous ones.
The images need to be kept up to date and match the filenames give in each office These are overlayed by the HTML elements, which then provide the functionality via the JavaScript files.
The file mentioned is at rbde_web\book_a_desk\templates\bookadesk.html
It is recommended to set up a local test environment to fiddle with the exact pixel values of the image positioning. Since these are absolute, one configuration should work for all relevant systems.
GT = Ganzer Tag VM = Vormittag NM = Nachmittag
Git Workflow
git clone git@github.com:RBDE-Digital-Engineering/web-framework.git
git checkout partial_django_fresh
git checkout -b your_feature_branch
\# make your modifications to the book-a-desk files
\# run `python rbde_web/play.py runserver` to check locally -> `http://127.0.0.1:8000/book-a-desk/`
git add .
git commit -m 'short desc of changes'
git pull
git push
\# pull branch into dev
\# check dev.develop-ing.ch/book-a-desk
\# merge branch into `prod`