-
Notifications
You must be signed in to change notification settings - Fork 24
Dev's Guide: Running from source
Ashar Fuadi edited this page Aug 9, 2024
·
46 revisions
This page explains how to run Judgels locally from source.
- Go to
judgels-backends/judgels-server-app
. - Copy the example config file:
cp var/conf/judgels-server.yml.example var/conf/judgels-server.yml
- Create a new local MySQL database called
judgels
. - Open the config file
var/conf/judgels-server.yml
. - Under
database:
, modifyuser
andpassword
as necessary so that we can connect to thejudgels
database. - Run database migration:
../gradlew dbMigrate
- Verify that there are new tables generated in the database.
- Finally, run the server app:
../gradlew run
- Verify that we can open the server admin app at
http://localhost:9101
. - Verify that we can log in as the default superadmin user (username:
superadmin
, password:superadmin
).
- Import the sample SQL data from
seeds/judgels.sql
to thejudgels
database. - Still in
judgels-backends/judgels-server-app
, untar the*.tar.gz
files fromseeds/
tovar/data
:mkdir -p var/data tar -xf ../../seeds/problems.tar.gz -C var/data/ tar -xf ../../seeds/lessons.tar.gz -C var/data/ tar -xf ../../seeds/submissions.tar.gz -C var/data/
The seed data contains:
- 6 users with the following usernames:
andi
,budi
,caca
,dudi
,emir
,fuad
. Passwords are equal to the usernames. - Sample problems, lessons, and submissions data.
- Go to
judgels-client
. - Copy the example config:
cp public/var/conf/judgels-client.js.example public/var/conf/judgels-client.js
- (Optional) If you are developing for TLX, open the config file (
public/var/conf/judgels-client.js
) and changewindow.conf.mode
toTLX
. - Install client app dependencies:
yarn install
- Finally, run the client app:
yarn start
- Verify that we can open the client app at
http://localhost:3000
.
Congratulations, you have successfully run Judgels from source!
-
Error: EMFILE: too many open files, watch
on macOS when runningyarn test
- To fix this, run:
See https://github.com/facebook/create-react-app/issues/4540 for more details.
brew install watchman
- To fix this, run: