This project aims at providing a back-end server that will serve as a companion to the Codecast front-end. The main functionalities provided by this back-end are:
- fetch information about a specific task
- grade a user submission on a task
- save user source code and avancement on a task
It is a complete rewriting in NodeJS/TypeScript of TaskPlatform which has been written in PHP in 2015.
The Codecast front-end can interact with this backend through a JSON API with
GET or POST methods (see the available routes in src/server.ts
).
This back-end can then interact with other back-end servers. In particular, to grade a user submission, this back-end calls the API of the grader queue to run tests on the user submission.
This back-end also interacts with a MySQL database that will store:
- the available tasks that can be solved with Codecast
- the user submissions and the grading of each of the submissions
- the user source codes
The goal is for this database to keep the same structure as the one used by TaskPlatform so that the migration from TaskPlatform to CodecastTaskBackend can be done smoothly.
This project is currently in development and not used in production yet.
You need to have NodeJS and Yarn installed on your computer. Then, clone this project and use:
yarn
yarn dev
To run the Cucumber tests, prepare the testing environment:
- Create a database
task_platform_test
- Import
schema.sql
into this database - Copy
.env
to a.env.test
file and fill in your database credentials
Then, run:
yarn test
To build a new version of the back-end, use:
yarn build
openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -outform PEM -pubout -out public.pem