This project aimed to make a unified platform for students to solve programming exercises in Haskell. Users would register for an account and then work on teacher-defined exercises. The exercises would be tested for successful completion automatically and the user would be able to see their progress.
The following commands you are in the backend/webserver
folder.
Build the file using:
$ docker build -t webserver .
Builds dockerfile in current directory and names it webserver
.
and run it using
$ docker run -p 8000:8000 -e PORT=8000 -e ROCKET_ADDRESS=0.0.0.0 webserver
Runs the webserver
image given port and environment variables. Port and address environment variables are necessary.
You may need to prepend sudo
, depending on your user permissions / OS.
The following commands you are in the frontend
folder.
To run the frontend, ensure you have npm
installed. Then run:
$ npm ci
This installs the latest packages for the project.
Then run:
$ npm run dev
to enter development mode.
This may fail if you do not have the appropriate environment variables set. You can set them in a .env
file in the frontend
folder. The variables are:
WEBSERVER_ADDRESS=http://localhost:8000
Which depends on the port you set for the backend.
We use Prisma. From the frontend
folder, use npx prisma db push
to get set up.
Docker example:
$ docker run --name postgres -e POSTGRES_PASSWORD=1234 -p "5432:5432" -d postgres