|Tianyun Zhang 94eb86257e||2 months ago|
|.vscode||2 months ago|
|Client||2 months ago|
|Dockerize||2 months ago|
|Isolate||8 months ago|
|Notification||2 months ago|
|Server||2 months ago|
|Shared||2 months ago|
|Worker||2 months ago|
|.dockerignore||8 months ago|
|.drone.yml||2 months ago|
|.gitignore||8 months ago|
|.gitlab-ci.yml||7 months ago|
|CHANGELOG.md||2 months ago|
|Dockerfile.env||2 months ago|
|Dockerfile.node||2 months ago|
|Dockerfile.runtime||2 months ago|
|Dockerfile.sdk||2 months ago|
|Dockerfile.webapp||2 months ago|
|Dockerfile.worker||2 months ago|
|DotOJ.sln||2 months ago|
|LICENSE||2 months ago|
|README.md||2 months ago|
|release.sh||2 months ago|
Also known as: .OJ, NTOJ, OJ Core, etc.
Yet another online judge built on .NET Core tech stack, with ASP.NET and Angular.
DotOJ depends on multiple open-source projects:
The judging service depends on control group of Linux kernels. It is not possible to run workers on Windows or macOS, but the web application is cross-platform.
Follow the steps to prepare a dev environment:
Proceed to https://dotnet.microsoft.com/download and download .NET Core SDK for your platform. Do not download .NET Framework or you will not be able to make a build. After installation, fire
dotnet in a shell to check it is correctly installed.
Important: You MIGHT see a line in output that tells 'Successfully installed the ASP.NET Core HTTPS Development Certificate.' This would be critical in step 5 for development environment.
Now install Entiry Framework Core CLI tools with the following commands (reference):
$ dotnet tool install --global dotnet-ef $ dotnet add package Microsoft.EntityFrameworkCore.Design
You can verify that the EFCore tool is correctly installed with
Visit https://nodejs.org/ and download the latest LTS version installer. After installation, you should check
node --version and
npm --version to make sure these two tools are working.
We are not using Yarn for this project. If your Internet connection is not smooth, refer to this page to learn how to change registry for NPM.
Clone this repository and open the folder in a shell.
$ dotnet restore
/ClientAppand run the following command to install Node.js dependencies.
$ npm install
During the installation you might get a prompt for telemetering of Angular. After that you should see Angular modules being compiled locally. You should test installation with
We are using MySQL or MariaDB (preferred) as the data source.
Install DB server on your computer and update the connection string in
WebApp/appsettings.json, then create a user called
dotoj with full access to database
dotoj. Tables will be created on the first run so there is no need for manual migrations.
Before we run the application for the first time, it is CRITICAL to install and trust an HTTPS development certificate on Windows and macOS. Simply run the following command and trust the certificate, or refer to this manual:
$ dotnet dev-certs https --trust
dotnet run and you should be able to visit the site at
Docker containers are published in registry and namespace
ccr.ccs.tencentyun.com/dotoj. There are six containers to build and run services:
sdk: .NET Core SDK.
runtime: ASP.NET runtime.
env: build environment.
node: node environment.
webapp: web frontend and server.
worker: judge service.
For more information on how to deploy with docker, refer to Dockerize/README.md.
The application can be easily scaled by adding or removing workers.
However, workers needs to share file system with web app in order to keep judge data updated. On the other hand, if judge data can be made read only, then workers can run on separate environments with connection to the same DB context.
$ openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ -subj "/CN=DotOJ" -keyout identity.key -out identity.crt $ openssl pkcs12 -export -out out/identity.pfx -password pass:identity \ -inkey identity.key -in identity.crt