Fullstack application for grading user submitted code for coding problems.
Frontend: Astro + React components
Backend uses Deno and communicates with WebSockets.
Database uses PostgreSQL which is migrated using Flyway. Redis is also used to cache latest submissions.
Prerequisites: Docker and docker-compose. Check out Docker Desktop if you have not them installed
- Create the grader docker image If you don't have grader-image in as Docker container then: 1.1. Go to grader-image folder 1.2. Build the container
docker build -t grader-image .
- Go to folder containing the docker-compose.yml and run the docker compose function
docker-compose up --build
or
docker-compose build --no-cache
docker-compose up
!! If your system has containers with same names than the ones in the docker-compose, rename the container names and start again.
- Wait until flyway has loaded.
The actual website is available faster than the actual database when first running the program. Please wait until flyway notifies you about it successfully migrating to version 1 of database.
- Open the application in http://localhost:8000 If any
of the steps fails, please close the container instance and repeat these
steps. If API did not start with the first try, try running
docker-compose up --build
again.
In order to run the tests, the application needs to be running. Tests can be found in load_test folder.
- Go to load_test folder.
- Run the tests in docker.
docker run --rm -i --network=host grafana/k6 run - <main_page.js
docker run --rm -i --network=host grafana/k6 run - <submit.js
test | average (ms) | media (ms) | 95th (ms) | 99th (ms) |
---|---|---|---|---|
"main page" / | 76.55 | 69.6 | 128.05 | 167.74 |
"api endpoint" /api | 28.6 | 25.86 | 52.01 | 71.41 |
page | performance | accessibility | best practices | SEO | PWA |
---|---|---|---|---|---|
"main page" / | 86 | 97 | 92 | 89 | - |
"exercise page" /exercises/exercise-1 | 100 | 84 | 92 | 89 | - |