清华软院 2020秋 软件工程 Q05组。球类赛事管理平台 ”清球汇“ 的后端实现及文档。
MIT License
2020
**** (: Tsinghua University Ball-game Platform)
****:
****:
****:
500 RPS(Request per Second) 1
JMeter 60 X Y
95% | |
---|---|
Github Issue & Kanban() Issue Issue
YApi API YApi
****:
****: APIvue-ApollographQL
****: APIgraphql
****: API SSL
:
:
: JDK 1.8 & Maven 3
: MongoDB 4
IDE: Idea Intellij
Git Main Dev
:
/
//
/
///
/
/
/>=2****
/
//
//
/
/
401
/ | ||
---|---|---|
./doc/documentation
:
****:
****:
****:
:
****:
****:
****:
()
:
Spring(SpringBoot) MVC
Restful GraphQL
Restful HTTP Status application/json
200 OK message
"ok"
400/401/403/404
{
"message": string, //
"code": int, //
"path": string, // API
"timestamp": string, //
"errorDetail": object //
}
401 Unauthorized
GraphQL src/main/resources/graphql/schema.graphqls
MongoDB MongoDB
MongoDB (Colletions)
user | |
match | |
round | |
game | |
unit | |
notification | |
comment | |
bulletin |
MongoDB 2
MongoDB () prod
Vue Apollo Apollo client Apollo provider axios graphql
Ant Design Vue a-upload beforeUpload action token key
Vue create setTimeOut
web Tab/Table
/////
/
extra
GraphQL Restful GraphQL Restful $33%\sim50%$
Restful $600\sim700$ GraphQL $200\sim300$
`` Restful
MongoDB
API Spring Swagger Controller API
dev
http://0.0.0.0:9960/swagger-ui/
swagger http://127.0.0.1:9960/swagger-ui/
Swagger Yapi API
YApi YApi API YApi API API
YApi 9
API API root dev root
GraphQL API
JUnit
61 YApi 85.33%
:
:
MongoDB ()
** docker-compose
MongoDB**
**** docker-compose MongoDB host
docker ( linux )
docker-compose.yml
version: '3'
services:
master:
image: mongo
container_name: mongo_thubp1
volumes:
- /home/ubuntu/mongo/thubp1/db/:/data/db/
- /home/ubuntu/mongo/thubp1/configdb/:/data/configdb/
- /home/ubuntu/mongo/thubp1/tmp/:/thubp/tmp/
restart: always
command: ["mongod", "--port", "27117", "--replSet", "rs_thubp"]
network_mode: "host"
slave:
image: mongo
container_name: mongo_thubp2
volumes:
- /home/ubuntu/mongo/thubp2/db/:/data/db/
- /home/ubuntu/mongo/thubp2/configdb/:/data/configdb/
restart: always
command: ["mongod", "--port", "27118", "--replSet", "rs_thubp"]
network_mode: "host"
docker-compose.yml
shell
docker-compose up -d
docker Mongo
docker exec -it mongo_thubp1 sh
docker mongo :
mongo localhost:27117
mongo_thubp2 :
rs.initiate()
rs.add("localhost:27118")
MongoDB mongodb://localhost:27117/thubp?replicaSet=rs_thubp
docker MongoDB
****: MongoDB prod
(**) Mongo dev
application-dev.properties
Mongo URL dev
****: dev
Mongo
backend/code/src/main/resources/config/config.properties
config-template.properties
(**) Docker
docker
docker-compose
(**) Maven
code
mvn spring-boot:run
JDK 8 Maven 3
(**) Maven
mvn package -DskipTests
target
jar
java -jar thubp-SNAPSHOT-xxx.jar
frontend
node vue-clinode
vue-cli
npm install -g vue-cli
frontend
npm install
npm run build
dist
http server
nginx :
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name thubp.iterator-traits.com;
ssl_certificate /path/to/certificate;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /path/to/compilation/results;
try_files $uri $uri/ /index.html;
index index.html index.html;
}
location ~ ^/api/ {
proxy_pass http://localhost:9960;
}
}
/
data #
mongo #
thubp1
thubp2
thubp #
docker # docker-compose
docker-compose.yml
thubp # Dockerfile
doc #
backend #
frontend #
Makefile # makefile