Proto is a full-stack web application for creating, solving, and automatically assessing programming problems and submissions. It includes features to build classrooms, invite users, set assignments, and give feedback. Developers can utilise the modular backend in various contexts such as university assignments, coding challenges, hackathons, and employability examinations. The accompanying frontend aims to showcase how this backend can be implemented with a user-friendly web application.
This project requires the following:
- Node
- npm
- yarn
- PostgreSQL
- Docker/Docker Compose
Set the following envrionment variables for the frontend. Adjust them as needed for your use case.
NODE_PATH=./src
REACT_APP_BACKEND_URL=http://localhost:5000
REACT_APP_GRAPHQL_URL=http://localhost:5000/graphql
REACT_APP_GITHUB_AUTH_URL=http://localhost:5000/auth/github
REACT_APP_JWT_TOKEN_SECRET=same_as_backend_JWT_TOKEN_SECRET
-
In the frontend directory, run
yarn install
to install all the required packages. -
Run
yarn start
to start the application. It should be accessible athttp://localhost:3000/
This project uses judge0-v1.13.0
. It is included in the backend directory.
It requires Docker
and Docker Compose
. More information about the deployment procedure can be found here.
Set the following envrionment variables for the backend. Adjust them as needed for your use case.
DATABASE_URL="postgresql://username:password@localhost:5432/proto"
JWT_TOKEN_SECRET=same_as_frontend_JWT_TOKEN_SECRET
CLIENT_ID_GITHUB=GH_CLIENT_ID
CLIENT_SECRET_GITHUB=GH_SECRET_ID
REDIRECT_URI_GITHUB=http://localhost:3000/accounts/login
FRONTEND_URL=http://localhost:3000
SESSION_SECRET=some_secret_session_password
JUDGE_API_URL=http://localhost:2358
NODE_ENV=development
Information about getting a GitHub client ID and secret can be found here. Set the Homepage URL to http://localhost:5000/
and the Authorisation callback URL to http://localhost:5000/auth/github/callback
for this to work locally. Adjust according to your deployment.
-
In the backend directory, run
yarn install
to install all the required packages. -
Run
yarn run judge
to start Judge0. -
Run
yarn run test:db:setup
followed byyarn run test:db:seed
to set up the database. -
Run
yarn run dev
to start the backend. It should be accessible athttp://localhost:5000/
. You can open Apollo Studio Explorer athttp://localhost:5000/graphql
.
To run the backend tests:
-
Go to the backend directory.
-
Start a test instance of the server with
yarn run test:dev
-
Run the tests with
yarn run test
To run the frontend tests:
- Go to the frontend directory and run
yarn test
. Pressa
to run all tests.
This is part of a BSc dissertation project at King's College London supervised by Dr Christopher Hampson.