easyshell is a platform for trying, learning and mastering shell commands. See it for yourself - easyshell.sh.
There are a few microservices that work together to make the platform work.
-
Frontend for easyshell.sh. See Website for more information.
-
Manages the terminal sessions. See Session Manager for more information.
-
Processes the submissions. See Queue Processor for more information.
-
Entrypoint for all testcase images. See Entrypoint for more information.
In this section,
- Node (v22.14.0) and NPM (10.9.2) (can be installed using
nvm install 22. see nvm) - Go (1.23.6)
- Docker
The following environment variables might be required
APPPROJECT_ROOTWORKING_DIRDOCKER_REGISTRYDATABASE_URLSESSION_MANAGER_URLNEXTAUTH_URLNEXTAUTH_SECRETDISCORD_CLIENT_IDDISCORD_CLIENT_SECRETGITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
This is a helper variable that is used to determine which environment variables to load and verify.
Possible values are - submission-manager, website and script.
To run certain scripts, the project root is automatically determined using git rev-parse --show-toplevel when within a git context. If running outside of one, please set the PROJECT_ROOT environment variable manually.
Directory for temporary files. If not specified, /tmp/easyshell is used.
Docker registry to use for pushing images. This is required for pushing images to the registry. If unset, the images will not be pushed.
If you are using a registry, then make sure you are already logged in.
Database connection string.
URL of the drizzle proxy.
Token for the drizzle proxy.
URL of the session manager. For cloudflare deployment, this cannot be a fixed IP address.
Token for the session manager. This is required for the website to communicate with the session manager.
These are the NextAuth configuration variables. These are required for running the Next.js application.
Many scripts have been defined in the package.json. This section will go over these scripts and the additional steps or environment variables required for their execution.
Also see Next.js Scripts, Queue Processor Scripts and Script Scripts for more information.
lint:tsclint:nextformat:checkformat:writeproblems:newproblems:lintproblems:buildproblems:build-pkg
Lint the entire TS/JS codebase using tsc.
Lint the Next.js codebase using next lint.
Check formatting for the entire codebase using prettier and gofmt.
Format the entire codebase using prettier and gofmt.
Create a new problem.
Might require the following environment variables.
APP=scriptPROJECT_ROOTmight need to be defined if the script is not run from within the git repository.
Lint the problem configuration files.
Might require the following environment variables.
APP- This is required and should be set toscript. Already set in package.json.PROJECT_ROOTmight need to be defined if the script is not run from within the git repository.
Test the problem images using tests defined in the problem configs.
Might require the following environment variables.
APP- This is required and should be set tosubmission-manager. Already set in [package.json].PROJECT_ROOTmight need to be defined if the script is not run from within the git repository.
Build (and push) the problem images.
Might require the following environment variables.
APP- This is required and should be set toscript. Already set in package.json.PROJECT_ROOT- required if the script is not run from within the git repository.DOCKER_REGISTRY- required if the images need to be pushed to a registry.WORKING_DIR- optional, defaults to/tmp/easyshell.
Calls problems:cache in website app.
Calls problems:cache in submission-manager app.
Calls both problems:cache:website and problems:cache:submission-manager.
All problems for easyshell are stored in the problems/ directory. They have a strict structure, which dictates the problem's behaviour and affects its build process.
Explanation of the problem. For consistency, it should contain only two top-level headings - Problem Statement and Instructions.
This file is required.
Folder containing hints for the problem. This folder is optional.
Hint for the problem. <hint-id> must begin from 1 and can only increase sequentially from there on.
Folder containing testcases for the problem. This folder is required.
Folder containing the files for the testcase. <testcase-id> must begin from 1 and can only increase sequentially from there on.
At least one public testcase is required.
This file contains the configuration for the problem. It is required.