-
Notifications
You must be signed in to change notification settings - Fork 25
Dev's Guide: Running from source
This section explains how to run the Judgels platform locally from source, with default configuration. This is a good starting point for new developers to ensure that they can run Judgels on their machine.
- Prerequisites
- Setting up backend project
- Setting up Jophiel
- Setting up Uriel
- Setting up Jerahmeel
- Setting up Sandalphon
- Importing seed data
- Setting up frontend project
- Running the microservices
- Miscellaneous
- Troubleshooting
- Java 8/11 JDK
- MySQL 8
- Yarn 1.3+
- Docker
-
IntelliJ IDEA
- Community Edition is sufficient.
-
Go to the backend directory (
judgels-backends
). -
Run:
./gradlew check
This will download all required JAR dependencies, and run all unit and integration tests. Note that it may take quite a while for the first time.
-
Make sure the tests pass before moving on to the next sections.
-
Create a new local database called
judgels
.
-
Go to Jophiel directory (
judgels-backends/jophiel
). -
Copy the example config:
cp jophiel-dist/var/conf/jophiel.yml.example jophiel-dist/var/conf/jophiel.yml
-
Open the config file
jophiel-dist/var/conf/jophiel.yml
. -
Under
database:
, modifyurl
,user
, andpassword
as necessary. -
Run database migration:
../gradlew dbMigrate
. -
Verify that there are tables generated in the database.
The steps are similar to Jophiel's above. Just replace all occurrences of jophiel
to uriel
.
The steps are similar to Jophiel's above. Just replace all occurrences of jophiel
to jerahmeel
.
-
Go to Sandalphon directory (
judgels-backends/sandalphon
). -
Copy the example config:
cp sandalphon-app/conf/application_default.conf sandalphon-app/conf/application.conf
-
Open the config file
application.conf
. -
Under
db.default
, modifyurl
,username
, andpassword
as necessary. -
Run Sandalphon server:
- Go to
judgels-backends/sandalphon
. - Run:
../gradlew runPlay
. - By default, it will listen to port 9002.
- Open http://localhost:9002.
- Go to
-
Sandalphon will run the database migration automatically.
-
Verify that there are tables generated in the database.
- Import the seed data (
seeds/judgels.sql
) to the database. - Untar the tar.gz files from
seeds/jerahmeel/var/data/*
tojerahmeel-dist/var/data/
, to be able to see submission files. - Untar the tar.gz files from
seeds/sandalphon/var/data/*
tosandalphon-app/var/data/
, to be able to see problems / lessons.
-
Go to Raphael directory (
judgels-frontends/raphael
). -
Copy the example config:
cp public/var/conf/raphael.js.example public/var/conf/raphael-v4.js
-
Run:
yarn && yarn test
This will download all required NPM dependencies and run the tests. Note that it may take quite a while for the first time.
-
Make sure the tests pass before moving on to the next sections.
-
Run Jophiel server:
- Go to
judgels-backends/jophiel
. - Run:
../gradlew run
. - By default, it will listen to port 9001.
- To make sure that it is running correctly, hit the version endpoint:
http://localhost:9001/api/v2/version
. It should return the current version string.
- Go to
-
Similary, run Uriel server. By default, it will listen to port 9004.
-
Similary, run Jerahmeel server. By default, it will listen to port 9005.
-
Run Sandalphon server:
- Go to
judgels-backends/sandalphon
. - Run:
../gradlew runPlay
. - By default, it will listen to port 9002.
- Go to
-
Run Raphael server:
- Go to
judgels-frontends/raphael
. - Run:
yarn start
. - By default, it will open your default web browser and navigate to
http://localhost:3000
.
- Go to
-
Make sure that you can see the Judgels homepage with no errors.
-
Log in to Judgels using superadmin account (username:
superadmin
, password:superadmin
). -
Make sure that you can log in successfully.
Congratulations, you have successfully run Judgels from source!
- The seed data contains a
superadmin
and 6 users with the following usernames:andi
,budi
,caca
,dudi
,emir
,fuad
. Passwords are equal to the usernames.
-
Error: EMFILE: too many open files, watch
on macOS when runningyarn test
-
To fix this, run:
brew install watchman
See https://github.com/facebook/create-react-app/issues/4540 for more details.
-
-
error: method transform in class Lists cannot be applied to given types
when running./gradlew check
- This is compilation error when using Java version
1.8.0_25
, not sure which exact minimum version that compiles successfully but Java version1.8.0_201
works.
- This is compilation error when using Java version