🌟 Accept VSCode extension recommandation for complete experience.
OJ Lab Platform depends on several foundational services, including:
- PostgreSQL (or other SQL database in the future)
- Redis
- MinIO
- Judger
This project provides a Makefile to help you quickly set up dependencies & other optional choices.
Run make setup-dependencies
to start these services and load the initial data.
Launch the programs with VSCode launch configurations is the most recommended way. It will automatically set the environment and run the program in debug mode.
There is also some optional approach you may want to use.
Use make get-front
to get the frontend dist codes.
In development config by default, it points to the postion where the frontend codes are located, so you will automatically get the frontend view when you start the program.
Use make gen-swagger
to generate swagger docs.
The following environment variables are available to modify the behavior of the program:
- OJ_LAB_SERVICE_ENV: The environment of the service, default to
development
- OJ_LAB_WORKDIR: Directly set the path of the workdir, application will automatically locate the workdir if not set
(it will be set to
workdirs/<service_env>
in this project by default)
Along with the make setup-dependencies
, we provide adminer
to access PostgreSQL & MinIO with its web interface.
Remember to set the type of the database to
PostgreSQL
when login to adminer.
go bin not included in PATH
# You should change .zshrc to .bashrc if you are using bash
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc