A lightweight Flask-based web application for competition registration and management. It supports user registration and login, team management, work submission, notifications, feedback, and an admin dashboard.
This project was used for USTC's Yuqing Cup Campus Software Design Competition.
- Python
- Flask
- MySQL with PyMySQL
- Jinja2 templates
- Layui and jQuery
- Gunicorn with gevent for production deployment
.
├── main.py # Flask application entry point and routes
├── utils.py # Configuration loading and database table setup
├── requirements.txt # Python dependencies
├── gunicorn_config.py # Gunicorn deployment configuration
├── config_yuqing.json # Default runtime configuration
├── config_icpc.json # Alternative competition configuration
├── static/ # Static assets and frontend libraries
├── templates/ # Jinja2 page templates
| ├── admin/ # Admin dashboard pages
| └── manage/ # User management pages
└── logs/ # Gunicorn runtime logs
- Create and activate a Python virtual environment.
python -m venv .venv
source .venv/bin/activate- Install dependencies.
pip install -r requirements.txt- Prepare a MySQL database and create
config.json.
The app creates the required tables on startup, but it does not create the database itself. Create the database first, then use config_icpc.json and config_yuqing.json as references to create a config.json that matches your competition and deployment environment. Update the configuration file name loaded in main.py to use your new config.json.
Useful MySQL commands:
sudo systemctl start mysql
mysql -h <host> -u <admin_user> -pSHOW DATABASES;
CREATE DATABASE <database_name>;
CREATE USER '<db_user>'@'<host>' IDENTIFIED BY '<db_password>';
GRANT ALL PRIVILEGES ON <database_name>.* TO '<db_user>'@'<host>';
FLUSH PRIVILEGES;
USE <database_name>;
DROP DATABASE <database_name>;- Start the application.
python main.pyor, for Gunicorn deployment:
gunicorn -c gunicorn_config.py main:appThis project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).