Skip to content

feixukeji/CompetitionPlatform

Repository files navigation

Competition Platform

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.

Tech Stack

  • Python
  • Flask
  • MySQL with PyMySQL
  • Jinja2 templates
  • Layui and jQuery
  • Gunicorn with gevent for production deployment

Directory Structure

.
├── 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

Quick Start

  1. Create and activate a Python virtual environment.
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies.
pip install -r requirements.txt
  1. 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> -p
SHOW 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>;
  1. Start the application.
python main.py

or, for Gunicorn deployment:

gunicorn -c gunicorn_config.py main:app

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

About

A lightweight Flask-based web application for competition registration and management.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors