kobrynsky / TestSupportSystem.SPA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SysEgz

On-line system supporting tests for learning of programming

Table of contents

General info

Web application that facilitates the process of testing and exams in the field of programming. It allows students to solve tasks in an integrated online development environment and to check the correctness of solved tasks. Teachers can create new tasks, add students and groups.

The system contains three main components: API for system management (API - Zarządzanie systemem), code compilation system (API - Kompilator kodu) and client application (Klient). The diagram of the system is presented below:

Technologies

  • API for system management:

    • C#
    • .NET Core 3.0 WebApi
    • EntityFrameworkCore
    • AutoMapper
    • JwtToken
    • AspNetCore.Identity
    • FluentValidation
    • MediatR
    • Microsoft SQL Server
  • Client Application:

    • ReactJs
    • TypeScript
    • MobX
    • SemanticUI
    • CodeMirror
    • Axios
    • Revalidate
  • Code Compilation System (judge0api):

    • Docker
    • Ruby on Rails
    • PostgreSQL

Setup

API for system management

To launch the application, download the code from the GIT repository under the link:
https://github.com/kobrynsky/TestSupportSystem.API.

For proper operation of the application you need the .NET Core 3.0 SDK:
https://dotnet.microsoft.com/download/dotnet-core/3.0

And Visual Studio Community/Professional/Enterprise 2019:
https://visualstudio.microsoft.com/pl/vs/

After installing the IDE and SDK, the downloaded project should be run by Visual Studio. The integrated development environment should automatically download the packages that are missing in the solution. Then in Package Manager Console, select Persistence project as default and enter two commands:

$ Enable-Migrations
$ Update-Database

Thanks to these commands the application should create a database which will be located on the local system server. ConnectionString to the database is located in project API in appsettings.json file. After successful creation of API database for system management it should start working.

Code Compilation System

To start the application you must have downloaded Docker on your system. Specific data about installing Docker on specific systems can be found on its main page:
https://www.docker.com/

Then turn on the Docker's console and download the judge0/api:

$ docker pull judge0/api
$./scripts/dev-shell

After downloading the image, copy the contents of the dojudge0-api.conf.default file to judge0-api.conf. Most likely the judge0-api.conf file will not exist, so you have to create it. Besides that (this happened to me for example). Grant permissions to the files:

$ sudo chmod 777 -R ./db/
$ sudo chmod 777 -R ./tmp/

After these actions you can run the server part of the API with a command:

$ ./scripts/run-server

In addition to the server part, you should also run the workers with the following commands:

$ ./scripts/dev-shell
$ ./scripts/run-workers

After these commands, everything should work. You can check this by going to the documentation at http://www.XXX.XXX.XX.XXX:3000, where "XXX.XXX.XXX.XXX" means the IP on which the Docker is running. The Ip is displayed when the Docker starts up in the text: "docker is configured to use the default machine with IP XXX.XXX.XXX.XX.XXX".

Client

To run the client we need the code from the GIT repository:
https://github.com/kobrynsky/TestSupportSystem.SPA

And also npm:
https://nodejs.org/en/download/

After downloading all the components, enter the folder of the downloaded GIT repository through the console:

$ npm install
$ npm start

After these commands the application should be launched on http://www.localhost:3000

Integration of modules

In order for the client to communicate to a good address it is necessary to check on which API was enabled (for system management), copy the address and paste it into agent.ts file:

axios.defaults.baseURL = "https://localhost:44323/api"

The same should be done for the management API communication with the code compilation system. Check API address for compiling code, then paste it into Startup class in API project:

var apiCompilerUri = new Uri("http://192.168.99.100:3000/");

Thanks to these steps the system should be fully functional

Screenshots


This project was written with ❤️.

XD Driven Development

About


Languages

Language:TypeScript 97.1%Language:CSS 1.6%Language:HTML 1.3%