A monorepo containing an application for registering students' work groups. Intended to be hosted by teachers, allowing their students to register their groups and provide their individual GitHub handlers.
At the start of each semester, we ask hundreds of students across multiple classes to form their work groups and report their individual GitHub handlers. This information is required so we can later create proper GitHub organizations and group repositories for their practical assignments.
This plataform aims to provide a tool that streamlines this process.
- Easy and containerized deployment with automatic SSL Certificate handling (thanks to Caddy).
- Email invites using Gmail.
- Customizable group size.
- Restrict registration to authorized emails/students.
- Validation of GitHub handlers.
- Custom main page content using Markdown.
Note
These instructions assume you have a domain pointing to the server in which you will host this platform. Furthermore, it configures its own reverse proxy (Caddy), assuming this is the only web service running on the server.
-
Clone the repository
git clone [email protected]:RuiCunhaM/group-registration.git -
Create a
.envfilecp .env.example .env -
Edit the
.envfile with the apropriate valuesDOMAIN: The host domainSITE_NAME: The platform title. We recommend a short acronym.MIN_MEMBERS: The minimum number of members each group requires.MAX_MEMBERS: The maximum number of members each group can have (Can be equal toMIN_MEMBERS).DB_PASSWORD: The DB password.GMAIL_USERNAME: A Gmail handler from where to send the automatic emails.GMAIL_APP_PASSWORD: The Gmail APP password forGMAIL_USERNAME. See here how to get one.
-
Edit the
main_page.mdfile to customize your main page content with Markdown syntax.
Tip
The Markdown support in this step is not perfect. If you want more control over your main page content, directly edit the Python source code at index.py.
-
Build and start the containers.
docker compose up -d -
The platform should now be accessible at the domain configured in Step 3.
-
At this stage, you need to add a list of emails authorized to register in the plataform. Refer to Utility Scripts to see how.
You'll find some utility scripts with distinct purposes in the scripts folder. Before using any of the scripts, first export the DB_PASSWORD variable:
export $(cat .env | grep DB_PASSWORD | tr -d '"')
If you have a file with one email per line:
./loadEmails.py -f <file>
To manually add a single email:
./loadEmails.py -e <email>
Using this script, it is possible to manually add a group of any size. The group is immediately considered valid, and students are not required to accept any invitation.
./createGroup.py
The script guides you through the process.
Dump the information about the confirmed groups. Useful to export the data collected to other tools.
./dumpGroups.py
It will print information to the stdin. You should redirect it to a file.
Steps to run the Reflex app locally:
-
Create a
.envfilecp .env.example .env
-
Edit the
DB_PASSWORDvalue todev_password -
Start the database container
docker compose up db -d
-
Change directory to
reflex_appcd reflex_app/ -
Create a Python environment and install dependencies
python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt -
Start Reflex in development mode with live preview
reflex run
Warning
In the current iteration, group members are completely public, including their academic emails and GitHub handlers! In the context we use this application, we do not consider it a problem, but please be aware of such behavior.
- Python Reflex
- Caddy
- Docker
- PostgreSQL
-
Admin page (Should remove the need for utility scripts)
- Login
- Add authorized emails
- Export groups info
- Manually add group
-
Cron job to resend emails
-
Go to bottomandGo to topbuttons for easier navigation -
Better backend async support (We don't have any real demand operation but should improve performance nevertheless)
-
README improvements