/ACM-PLATFORM

A platform for ACM training management.

Primary LanguagePLpgSQL

ACM-PLATFORM

A small website is used for the management of ACM training problem library, competitions, teams, completed problems with solution.

How to Run

  1. Install support libraries needed for this project (Tornado 4.5.3+, pymsql 0.9.2+, python 3.7+, mysql 8.0.16+)
  2. Import the sql data into mysql, modify the mysql connection parameters in config.py, and run server.py.

Details of Installation

Taking Ubuntu 18.04 for example.

python3

sudo apt update
sudo apt -y upgrade
sudo apt install -y python3-pip
pip3 install package_name

pymysql

python3 -m pip install PyMySQL

tornado

sudo apt-get install python3-tornado

mysql

Installation of mysql 8.0+.

sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
mysql -u root -p # login to MySQL Database

Create a MySQL remote user.

mysql -u root -p
CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

Enable MySQL remote access.

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
# change the "bind-address = 127.0.0.1" into "bind-address = 0.0.0.0"
sudo systemctl restart mysql.service

Reference link

Run

Install Screen and run the project in it.

sudo apt-get install screen
screen
python3 server.py

Back Up

cron

crontab -l # check all tasks
crontab -e # add new task

/etc/init.d/cron stop
/etc/init.d/cron start
/etc/init.d/cron restart
/etc/init.d/cron status

we need to use crontab -e to add the task below to back up mysql every two hours.

54 */2 * * * /root/mysql_backup_script.sh

.sh file

This file contains the config and the input of command line, we could use it to back up the mysql.

/etc/mysql/mysql.conf.d

And we add the specific configs in the "/etc/mysql/mysql.conf.d".

[mysqldump]
user=root
password=passwd

Website details display

Web Portal

Image of Web

Main Page

Image of Web

Problem Library

Image of Web

Contest

Image of Web

User

Image of Web

More Details

If you want to know more information, you could consult for the "ACM-PLATFORM Report.pdf" in this project.