Platform for coding challenges and code interviews.
Please help to code this, any help is wanted. 🙂
Rails 7
- rspec
- guard
- devise
- active-admin
- active-record
- spring
- rubocop
- Add support for https://github.com/judge0/judge0
- create container on docker-compose.yml for judge0 calls
- add support for at least 5 languages
- Crud for new challenges
- figma/design project for whole user experience
- Screen to solve challenges
- Templated questions
- Database relationship analisys
https://github.com/DMOJ/online-judge
https://github.com/DOMjudge/domjudge
https://github.com/NikolayIT/OpenJudgeSystem
https://gitlab.c3sl.ufpr.br/maratona-ufpr/jughisto
Database relations on dbdiagram (View)
Database relations on dbdiagram (Edit)
https://piradata.gitbook.io/kodoverdikto/
First set up an ssh key for you with ssh-keygen -t rsa -b 4096
if you don't have any and clone the project with git clone
.
Open the project with VS Code.
Make a copy of .env.sample
and call it .env
, them write up the following values:
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- RAILS_SECRET_KEY_BASE
You can get the google codes here.
And the RAILS_SECRET_KEY_BASE
can be any string really, but it is recommended to generate it with the command bin/rails secret
. More info about that here and here.
Obs: If you dont create the .env
file, the project will fail to open as a container.
Then install the Dev Containers extension.
Click on the green bar in the bottom-left corner and them select Reopen in container
.
Run bundle install
in the container terminal.
To run the server press ctrl+shift+B
to run the build task in vscode. Alternatively you can press ctrl+P
and type task
(yes, task
+ an empty space) and select one of the custom tasks for the workspace. There is a task for starting rails s
and also a task for rails c
. These tasks become buttons on the bottom bar if you use the actboy168.tasks
extension of vscode.
Then run guard
on a separated terminal to automate testing, formatting and bundle gem updates.
You may want to push commit inside dev-containers. For that, the extension already forward your local SSH agent if one is running. For more information in how to set up an ssh agent refer to this link about sharing git credentials and this link about the ssh agent itself.
In my case i just put the following inside my zprofile file:
SSH_ENV="$HOME/.ssh/agent-environment"
function start_agent {
#echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
#echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add -q;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
The old cli for devcontainers was deprecated, so if you don't want to open vscode and only then reopen the code in the containers but do all together in the terminal, just download/install the new devcontainer cli with:
npm install -g @devcontainers/cli
And then in the zprofile file add the following function:
function devopen() {
local workspace_folder="$(readlink -f "$1")"
if [ -d "$workspace_folder" ]; then
local wsl_path="$(wslpath -w "$workspace_folder")"
local path_id=$(printf "%s" "$wsl_path" | xxd -ps -c 256)
code --folder-uri "vscode-remote://dev-container%2B${path_id}/$(basename "$workspace_folder")"
else
echo "Usage: devopen <directory>" 1>&2
echo "" 1>&2
echo "Error: Directory ${1@Q} does not exist" 1>&2
false
fi
}
Now you can open the code directly inside the devcontainer on the CLI with devopen .
instead of code .
.
It is a little gambit while this issue is not resolved.