The Resident Assistant Duty Scheduling Application (RADSA) is Web application that schedules Resident Assistants for nightly duty shifts and displays the schedule for the RAs to see. The application allows RAs to login and submit any conflicts they might have for a particular month. Then a Hall Director (HD), or their Assistants (AHDs), may run the scheduling algorithm, manually manipulate the result and export the schedule to Google Calendar.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
RADSA utilizes a Flask web server to serve pages to the client. The web server also communicates with a PostgreSQL database to display the proper information to the client in addition to running the scheduling algorithm. For this application, you will need:
- PostgreSQL 10.17
- Python 3.6
- VirtualEnv 15.1
- RabbitMQ 3.8.14
Here is a step by step series of examples that tells you how to get the development environment up and running.
$ sudo apt-get update
$ sudo apt-get install postgresql postgresql-contrib
$ sudo -u postgres createuser --interactive
Follow the prompts to create a role for yourself. I suggest creating a role that is the same name as your username and making yourself a superuser.
$ sudo apt-get install python3.6
$ sudo pip install virtualenv
$ virtualenv -p python3 /path/to/home/MyEnv
$ source /path/to/home/MyEnv/bin/activate
In order to develop in the correct Python environment,
you will need to perform the last step each time after
closing your terminal. Similarly, if you would like to
exit the virtual environment without closing the terminal,
simply type deactivate
in the terminal.
After the virtual environment is created, execute the following to install of the necessary python packages into the virtual env:
pip install -r requirements.txt
RADSA uses on a number of environment variables to pass
information into the runtime of the application. These
can be configured in the activateEnv
file. Once
configured, the setting can be exported into the env
by running the following command:
. activateEnv
This step will need to be performed each time a new terminal is opened.
With all of the above prerequisites installed, you should be able to run the following to initialize the database:
$ python createDB.py
$ python populateDB.py
Doing so will create the Database and populate it with some starting data.
For instructions installing RabbitMQ visit their website.
Follow the below steps in order to run this application locally.
- Open two terminals and active the virtual env for this applications in each.
- In each terminal, navigate to the application
directory and run
. activateEnv
. - In one terminal run
python scheduleServer.py
to start the web server. - In the other terminal run
python schedulerProcess.py
to start the scheduler process.
After the above steps are completed, the application can be
reached by opening a web browser and navigating to
localhost:5000/
.
Unit tests are automatically run against each branch and PR by Travis CI, however they can also be run manually by following the steps below:
- Open a terminal and navigate to the application directory
(
~/RAscheduler/
for example). - Execute the
runTests
script. This will run through all of the written unit tests and generate a coverage report. - To view the generated coverage report open the
index.html
file located in thecoverageHTML/
directory.
RADSA is deployed on Heroku.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use CalVer for versioning. The schema used by this project is YY.MM.DD
For the versions available, see the releases on this repository.
- Tyler Conzett - conzty01
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Special thanks to Ryan Ehrhardt for the inspiration for this project.