Disclaimer: The UI was made by AI, I have written the text and explained the organization for the UI, but the styles were made by GPT. Also this project is inspired from the CS50 course.
This Flask application lets users register for a sport, browse or search the registrant list, talk in a real-time chat, and fetch a fun fact from an external API. Registration data is stored in MySQL.
- Register participants for Football, Basketball, or Tennis.
- Browse all registrants and search by name.
- Use a public real-time chat powered by Socket.IO.
- Fetch a fun fact from an external API.
| Method | Route | Purpose |
|---|---|---|
| GET | / |
Home page |
| GET/POST | /register |
Show and submit a sport registration |
| GET | /list |
Show all registrants |
| POST | /search |
Search registrants by exact name |
| GET | /chat |
Real-time chat page |
| GET | /fun_fact |
Show a fact from the external service |
| GET | /about |
About page |
If the external fun-fact service is unavailable, /fun_fact responds with a
friendly 503 Service Unavailable page.
- Python 3.12
- A running MySQL Server
Install Python dependencies:
python -m pip install -r requirements.txtrequirements.txt is the install source for this project. If you prefer Poetry,
run poetry lock after installing Poetry to generate a lock file from
pyproject.toml.
Create a local credentials.py file:
DB_USER = "your_mysql_user"
DB_PASS = "your_mysql_password"Create the sport database and registrants table with the statements in
query.sql.
python application.pyThen visit http://localhost:5000.
Tests use Python's built-in unittest module and mock all external HTTP calls:
python -m unittest discover -s testsThis project is distributed under the MIT License.