Restaurant staff scheduling website
The goal is to have a website that can be deployed to an Amazon Elastic Cloud instance and would support multiple restaurants. This will facilitate the communication of schedule between employees and managers.
Restaurant turn-over is a huge challenge to establishing standard practices in scheduling.
Oh, and I am using this project to help family members get experience in coding in python with a project that has commercial value.
If this fills such a valuable need for restaurants, why are you putting the source in the public domain?
I believe that those who have the technical skills to implement this for their restaurant can save themselves a lot of time and money. For those other restaurants that do not have those with the skills to deploy this, enterprising people with the skills can sell this solution to them. I feel there is a great need in society for this tool. If I try to sell it by myself, I may make a lot of money but I will not be able to fulfill the need as effectively as several people going out and filling that need.
If you wish to sell your services to set this up for a restaurant or even for several restaurants, please do. If you receive feedback, please contribute it back here, but most of all, fill the need.
Assuming the source has been cloned to ~/Documents/scheduling (on cbook is has been).
cd ~/Documents/scheduling
git pull
The interface is stored in src/ui
and src/ui/template
(mainly).
These are just web pages, but have special markup to insert variables and have some basic logic.
The logic behind the interface is stored in src/scheduling.py
.
This has the logic to perform when the interface makes a request.
The data model is stored in src/model.py
.
This manages the database.
In general, you get objects or create objects.
If you modify an object you get back, you must call flush()
on the model (database.flush()
) before returning the webpage.
You only have to call flush()
once, even for multiple changes to multiple objects.
Make sure all files are saved to disk.
./pr_build.sh fix
(Note: pr_build.sh has only been tested on macOS and Ubuntu)
This will reformat your code, and run some checks on it. If any of the checks fail, you must address these problems before submitting.
./pr_build.sh run
(Note: pr_build.sh has only been tested on macOS and Ubuntu)
This will check the changes again, and start the web server (on port 8000
).
You can try out your changes by going to http://localhost:8000/
You can make changes while the web server is running and as long as you don't have invalid Python, the server will update to your changes live. This allows you to make changes and refresh the page and see the changes.
The first step in the boot-strap process is to create an admin account. The first user to log in creates an admin account.
Once the admin account is created, the admin can create a restaurant.
After the restaurant is created, log out and create the general manager account on the restaurant page: http://localhost:8000/restaurant/1
Log out of the GM's account.
Log in as the admin account and go to the new restaurant's page.
Set the GM account on the restaurant page.
Log out of the admin account and log back into the GM account.
Go to the restaurant's page and add the roles.
Log out and create an employee account on the restaurant page: http://localhost:8000/restaurant/1
You can now set the employee's priority for the different roles.
First, verify that your changes are still valid.
./pr_build.sh fix
(Note: pr_build.sh has only been tested on macOS and Ubuntu)
git checkout -b users/my_name/meaningful_change_name
git diff
Review the changes you have made and look for things you missed.
git commit -a
Press i
to start inserting text into the description.
Put the full description of your changes (which you reviewed in the last step).
When you are done, press esc
then type :wq
and press return
.
git push
The first time you push
you will need to connect your branch upstream.
Don't worry, git will helpfully give you the full command, which will be something like:
git push --set-upstream origin users/my_name/meaningful_change_name
Any changes you make to this branch after this point will just need git commit -a
and git push
.
If there have been changes added to the main
branch since your branch was created, you will need to merge those changes back into your branch.
git checkout main
\
git pull
\
git checkout my_name/meaningful_change_name
\
git merge main
If there were any changes in main
that conflicted with your changes, they will be marked with HEAD and will show both changes in the same file.
Search through your files for HEAD.
Fix the conflicts by choosing from main
, your branch, or rewrite the code to include both changes.
git commit -a
You can just leave the merge comment and type :wq
and press return
.
Changes go into main
from your branch through a pull request.
This allows review of the code to get another set of eyes on it.
Go to https://github.com/marcpage/scheduling/pulls
There should be a green button that says Compare & pull request
.
After the pull request is created, respond to comments, fix anything needed.
Changes can be made, and then you can commit
and push
(see above) to update your branch.
Once everything is good, you can complete the pull request (green Squash and merge
button near the bottom).
<img
width="553" alt="Screen Shot 2021-12-30 at 11 45 48 AM" src="https://user-images.githubusercontent.com/695749/147775964-eb40d818-8ce0-4cb8-b31f-2191726616e8.png">
The confirm the completion by pressing the green Confirm squash and merge
button.
After the pull request is complete, main
now has newer source than you have on your machine.
git checkout main
\
git pull
You can now go back to the Modify the source step above.
The commands in pr_build.sh
can be used to determine how to work on Windows.
Contribution of pr_build.bat
to support Windows are definitely welcome.