Git Product home page Git Product logo

judge-girl-web's Introduction

Judge Girl

Judge Girl is under incubation and is actively developed (here to see the Scrum kanban). The document may be obsolete. Feel free to contact [email protected] or leave issues, open a thread in the discussions page if you are interested in any apsect.

Setup & Build

Clone the project (must include the submodule): git clone --recursive (This repository depends on the submodule Judge-Girl/Code-Quality-Inspection so the --recursive flag is needed)

  1. Rename application.example.yml, application-mysql.example.yml, application-mongo.example.yml and application-redis.example.yml under the Spring-Boot/Spring-Boot-Commons/src/main/resources/config/ folder to application.yml, application-mysql.yml, application-mongo.yml and application-redis.yml respectively, and then replace the PLACEHOLDERs in these files with the values to fit your need.
  2. Rename infra.example.yml to infra.yml and replace the PLACEHOLDERs with the values in the file to fit your need.

Run the entire Judge-Girl's backend locally

For those who wants to run all-in-one deployment locally, please do the following:

  1. Create a judge-girl network by docker network create judge-girl
  2. Run the infra component by docker-compose -f infra.yml
  3. Build and run the application by sh run.sh

Contributing

Contributions are welcome, especially 'software-design' nerds are welcomed to taste the practice of microservice/OOD/clean-architecture/domain-driven-design with us.

Thanks to all the people who already contributed!

Software Design (Clean Architecture/DDD)

This project is a taste of the practicality of (Topological) Microservice, Clean Architecture and Domain-Driven Design (DDD). Topological Microservice emphasizes that Judge-Girl should be capable of being deployed in a form of both monoliths or microservices. (Currently, we only support the microservices option)

Here are some overview introductions of our software design. For more details, please navigate to the docs/ folder.

Judge Girl follows clean-architecture and DDD. The package structure is based on four bounded context (Student, Problem, Submission, Academy) with three design forces (Domain Logic, Tech Stack, Client).

The following represents our primary package structure that practices clean architecture.

├── API (Force: Client)
│   ├── API-Commons
│   ├── Judger-API
│   ├── Student-API
│   ├── Problem-API
│   └── Submission-API
├── Domain (Force: Domain)
|   ├── Primitives 
│   ├── Student
│   ├── Problem
│   ├── Submission
│   └── Academy
├── Plugins
├── Dependencies (Maven dependencies)
├── Judger (Force: Online Judge System)
│   ├── CC-Profiler-Sandbox
│   └── Code-Quality-Inspection (Submodule)
└── Spring-Boot (Force: Tech Stack)
    ├── Spring-Boot-Commons
    ├── Spring-Boot-Academy
    ├── Spring-Boot-Problem
    ├── Spring-Boot-Student
    └── Spring-Boot-Submission

with 100% respect to the following diagram from Uncle Bob: Clean Architecture

Domain

In every domain package, there are application use cases (request + presenters), domain services and repositories. Every repository encapsulates the persistency of an aggregate root (e.g., Student/Problem/Submission) and every use case represents an application feature.

Tech Stack & System Architecture

image

Spring Boot is used to run our Judge Girl application.

Never write logs in the domain layer

We would log in technical layer (Controller, technical implementations, JPA, ...), but never in our domain layer. We use Aspect-Oriented Programming to inject logs into our domain layer.

Software Testing

Judge Girl is developed under E2E (API --> Database) test cases covering application usecases and Unit Test covering domain logic and utils. Where in our tests, RabbitMQ, MongoDB and MySQL are embedded.

judge-girl-web's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

judge-girl-web's Issues

Problem Description's UX: make every code markdown section prettier and better

In Judge-Girl/Judge-Girl#48, we make the markdown prettier by adjusting some css styles defaulted by the markdown-it library. This actually is good enough to read.

In the legacy judge girl, the pionteer did a great job on optimizing the code markdown section to enable the user to copy the text within it or show the line numbers. like:
image

While currently in the new version, we have achieved:
image

This issue aims to achieve more:

For each code markdown section, we have to provide

  • copy button
  • show line numbers
  • better background theme (somehow in darkness)

features

Docker-Compile build fails on Mac

Description

Docker-Compile build fails on Mac

The error log:

38 packages are looking for funding
  run `npm fund` for details

found 281 vulnerabilities (272 low, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details

> [email protected] build /usr/src/app
> ng build  --outputPath ./dist

Generating ES5 bundles for differential loading...
An unhandled exception occurred: Call retries were exceeded
See "/tmp/ng-nPhpEc/angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] build: `ng build  --outputPath ./dist`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-12-20T17_20_58_208Z-debug.log

With the verbose log as following:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle [email protected]~build: CWD: /usr/src/app
10 silly lifecycle [email protected]~build: Args: [ '-c', 'ng build  --outputPath ./dist' ]
11 info lifecycle [email protected]~build: Failed to exec build script
12 verbose stack Error: [email protected] build: `ng build  --outputPath ./dist`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (events.js:314:20)
12 verbose stack     at maybeClose (internal/child_process.js:1022:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
13 verbose pkgid [email protected]
14 verbose cwd /usr/src/app
15 verbose Linux 4.19.76-linuxkit
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
17 verbose node v12.20.0
18 verbose npm  v6.14.8
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error [email protected] build: `ng build  --outputPath ./dist`
23 error spawn ENOENT
24 error Failed at the [email protected] build script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Prevent toast from blocking navbar

Now, toast will display in front of change password / logout part.
We hope to move toast to top-right of page content instead of whole page.

Exam problem page

Embed problem page into exam page.

  • Make problem description and submission into two components.
  • Change submission API endpoint. (As component parameter)
  • Put above two components inside exam content (keep displaying exam navbar).

File-Upload item, instead of clicking the `cross` icon to clear the current selected file, re-click on the file upload button replaces the current selected file

See the following picture of File-Upload item, user must click the cross icon to clear the current selected file.

This issue enhances the UX: instead of clicking the cross icon, re-click on the file-upload button can pop-up the file-selected panel where the selected file replaces the previously selected file. Hence, the cross icon can be removed from the page.

image

Support generic Report presentation

Description

Currently in the submission page, the viewingReport modal is hardcoded with the CC report. As the following code shows.

image

This issue improve it to support generic report, i.e., given a report of any nested map type, it can be presented in the modal. (via some nested-table way)

Report type should be declared in a recursive way

export class Verdict {
  constructor(public judges: Judge[],
              public summaryStatus: JudgeStatus,
              public totalGrade: number,
              public maximumRuntime: number,
              public maximumMemoryUsage: number,
              public compileErrorMessage: string,
              public issueTime: number,
              // TODO: report type should be declared in a recursive way
              public report: Map<string, any>) {
  }
}

Should be strong-typed, otherwise annoying message shows up
image

Tabs alignment bug

image

Somehow due to some height issue, the tabs are aligned overlapping to the border of the panel, which is an obvious bug.

You can replicate the bug by viewing the problem description panel where the problem has a longer description text exceeds a page.

Problem List: Sort problem by its id

Sort the problem list by their ids.

In the picture you can see those problems are not sorted. (Actually problems are sorted by ther creation time)

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.