This is the initial setup you need to do on your machine to get everything up and running,
after you have done this, you can skip this section and go straight to the Running the server and webapp section
Set up your python virtual environment (you only have to do this once)
https://docs.python.org/3/library/venv.html
python3 -m venv venv
You have to do this everytime before launching the programs
PS> venv\Scripts\activate
source venv/bin/activate
This installs all of the pip requirements for the project, you only need to do this once,
and make sure that you have activated your virtual environment (venv) before running this command
pip install -r requirements.txt
Install Node.JS on your computer if you have not done so already
Navigate to the webapp
directory in your terminal/powershell
and run npm install
. You only have to do this one time.
- Activate your python venv (virtual environment)
PS> venv\Scripts\activate
source venv/bin/activate
- Run Flask with
python -m flask run
- Navigate to
webapp
directory - Run
npm start
to launch the webapp
Make sure to use the most recent version of python, ideally 3.10.8 and up. Adjust the Python interpretter settings in your IDE and ensure the most recent version is being used for the project environment.
The json.get() request can sometimes run inconsistently and break the connection with Flask if the reponse is not valid, and then throws the following error:
requests.exceptions.JSONDecodeError
To combat this issue,
- Navigate to the Project Folder ->
ClassScheduling.py
- Replace lines 51 & 52 with the following:
try:
is_running = r.json().get('is_running')
except:
is_running = True
This should allow for consistent checking of the website status.
Before running the application, you need to feed the program a base file. To do this,
- Access the Project Folder, and move the "Course list and attributes(1).xlsx" file elsewhere, i.e your desktop or your documents. You will use this later.
- Make a copy of the "Course list and attributes(1).xlsx", from wherever you placed it, and paste it into the Project Folder.
- Rename the copied file to "default", or something arbitrary.
- Open the project in your IDE, Navigate to Project folder ->
config.py
. - Replace line 22, with the following or what you renamed your copy to:
self._FILE_PATH = './default.xlsx'
- Save and repeat the steps to run the server/wepapp listed above.
For more information: Scheduler App Manual