Skip to content

Repository files navigation

⚽ Sports Registration Web Application

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.

Overview

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.

Features

  • 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.

Routes

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.

Requirements and setup

  • Python 3.12
  • A running MySQL Server

Install Python dependencies:

python -m pip install -r requirements.txt

requirements.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.

Running the application

python application.py

Then visit http://localhost:5000.

Tests

Tests use Python's built-in unittest module and mock all external HTTP calls:

python -m unittest discover -s tests

License

This project is distributed under the MIT License.

About

Web application in Flask for registration in sports activities, with storage in MySQL. Allows you to register participants, list registrations and search by name, with data validation on the server and error handling via logging.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages