Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Liu233w/acm-statistics

An online tool (crawler) to analyze users performance in online judges (coding competition websites). Supported OJ: POJ, HDU, HYSBZ, CodeForces, UVA, ICPC Live Archive, FZU, SPOJ, Timus (URAL), LeetCode_CN, CSU, LibreOJ, 洛谷, 牛客OJ, Lutece (UESTC), AtCoder, AIZU, CodeChef, El Judge, BNUOJ, Codewars, UOJ, NBUT, 51Nod, DMOJ, VJudge
https://github.com/Liu233w/acm-statistics

acm-icpc codechef-api codeforces-api crawler csharp docker javascript nodejs spoj-api vue

Last synced: about 2 months ago
JSON representation

An online tool (crawler) to analyze users performance in online judges (coding competition websites). Supported OJ: POJ, HDU, HYSBZ, CodeForces, UVA, ICPC Live Archive, FZU, SPOJ, Timus (URAL), LeetCode_CN, CSU, LibreOJ, 洛谷, 牛客OJ, Lutece (UESTC), AtCoder, AIZU, CodeChef, El Judge, BNUOJ, Codewars, UOJ, NBUT, 51Nod, DMOJ, VJudge

Awesome Lists containing this project

README

        

# This repo contains the source code of OJ Analyzer

简体中文版:[README_zh-hans.md](./README_zh-hans.md)

[![Powered by ZenHub](https://img.shields.io/badge/Powered_by-ZenHub-5e60ba.svg)](https://app.zenhub.com/workspace/o/liu233w/acm-statistics/boards?repos=125616473)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=acm-statistics&metric=alert_status)](https://sonarcloud.io/dashboard?id=acm-statistics)
[![codecov](https://codecov.io/gh/Liu233w/acm-statistics/branch/master/graph/badge.svg)](https://codecov.io/gh/Liu233w/acm-statistics)
[![Cypress.io](https://img.shields.io/badge/cypress.io-tests-green.svg)](https://dashboard.cypress.io/#/projects/4s32o7/runs)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://app.renovatebot.com/dashboard#github/Liu233w/acm-statistics)
[![Mergify Status](https://img.shields.io/badge/Mergify-enabled-green.svg)](https://mergify.io)

[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)

#### Build status

![Unit Tests](https://github.com/Liu233w/acm-statistics/workflows/Unit%20Tests/badge.svg)
![Test E2E](https://github.com/Liu233w/acm-statistics/workflows/Test%20E2E/badge.svg)

#### Features

- Querying ac/submissions of oj
- Storing querying history

#### Under development

- Email support
- Ranks
- ……

## Directory structure

- frontend: The front end
- crawler: Crawlers to query OJs. Being used by both frontend and backend
- crawler-api-backend: A microservice that provides querying api
- e2e: E2E tests
- backend: The back end, a monoservice
- captcha-service: A microservice that provides captcha support
- ohunt: A stateful, standalone crawler microservice used to support certain OJs such as ZOJ.
- build: Codes to build and deploy the project. Tool chain: docker, docker-compose, GNU make.
- tools: Utility scripts and config files in operation

See the README file in each module for specific documents.

## Developing and deploying in docker

- The project needs docker and docker-compose to function correctly.

### Development

- This project uses makefile to manage dependency between modules. Execute `make help` in repository root to view document.
- GNU make is required.

### Deploy

There are two ways to deploy this project in a server.

#### One-liner

Execute following code in shell to deploy the project to port 3000.

`curl -s https://raw.githubusercontent.com/Liu233w/acm-statistics/master/tools/remote-docker-up.sh | bash`

Vjudge crawler is not available in this way.

#### Config file version

In this way you are able to customise the configuration, enabling all features.

```bash
# Create a folder to store config files
mkdir -p ~/www/acm-statistics
cd ~/www/acm-statistics
# Download runner script and add permissions
curl https://raw.githubusercontent.com/Liu233w/acm-statistics/master/tools/remote-docker-up.sh -o run.sh
chmod +x run.sh
# Run the script once to generate configuration file. It will exit after the line `.env file created, remember to edit it` is shown.
./run.sh
# Edit the config file following the description in it.
vim .env
# Now we can run the project by the script
./run.sh
```

Then you can use tools such as systemd to run `./run.sh`.

[./tools/acm-statistics.service](./tools/acm-statistics.service) is a template config file of systemd.

`run.sh` checks updates when it is starting. If there are updates to `template.env`, `run.sh` will exit and ask you to compare these two files. **The script compares the line count of the two files to check update, please make sure they are identical when editing.**

## Management

- Set the url of adminer in `.env` file. It is `/adminer` by default.
- You can view and edit database via adminer.
- The name of the database is `acm_statistics`. Username is `root`. You can set password in `.env`
- Backups are created automatically in 3:00am each day, stored in `db-backup` folder, which is in the folder that contains config files.

## License

- All source code except the code in `crawler/crawlers` are under AGPL-3.0 license
- The code in `crawler/crawlers` are under BSD 2-Clause license.

## Contribution

- All contribution especially crawlers are welcomed.
- Please follow [Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153) when writing git commit messages.
- You may use [cz-cli](https://github.com/commitizen/cz-cli) to help writing commit messages.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Adelard Collins🔗
🐛

BackSlashDelta🔗
🐛

Bodhisatan_Yao🔗
🐛

Geekxiong🔗
🤔

Halorv🔗
🤔

Kido Zhang🔗
🚇 🤔



Liu233w🔗
💻 🤔 🚇 ⚠️

Meulsama🔗
🤔

Michael Xiang🔗
🐛

Zhao🔗
🐛

bluebear4🔗
🐛

ct🔗
🐛



flylai🔗
💻 🐛

fzu-h4cky🔗
🐛

wwawwaww🔗
🐛

zby🔗
🤔 🐛

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!