close
Skip to content

olimpiadi-informatica/terry

Repository files navigation

terry

Tests Code Climate Coverage Status Open Source Love license

terry is a Google-Code-Jam-like programming contest environment designed for the territorial phase of the Italian Olympiad in Informatics (OII, Olimpiadi Italiane di Informatica).

Setup

Prerequisites

  • Rust (latest stable)
  • Node.js and yarn
  • SQLite

1. Clone the repository

git clone https://github.com/olimpiadi-informatica/terry
cd terry

2. Build the Frontend

cd frontend
yarn install
yarn compile
yarn build
cd ..

3. Build the Backend

cd backend
SQLX_OFFLINE=true cargo build --release

4. Configuration

Edit the config.toml file in the backend directory to configure your contest settings (name, duration, start time, JWT secrets, etc.).

5. Database Setup

Set the DATABASE_URL environment variable and create the database:

touch terry.db
export DATABASE_URL="sqlite:terry.db"

The server will automatically run migrations on startup.

CLI Usage

The terry binary (found in backend/target/release/terry) provides several subcommands:

Start the Server

terry serve --config config.toml --listen 127.0.0.1:9000

Import a Task

Tasks must follow the terry format specification.

terry import-task /path/to/task-folder 1

Import a User

terry import-user --token "user-secret-token" --name "John" --surname "Doe"

To import an admin:

terry import-user --token "admin-secret-token" --name "Admin" --surname "User" --role admin

To import multiple users from CSV:

terry import-user --csv users.csv

The CSV file must include token,name,surname headers and may optionally include a role column. If the role column is omitted or empty, the command uses --role as the default:

token,name,surname,role
alice,Alice,Smith,Contestant
bob,Bob,Jones,Admin
charlie,Charlie,Brown,

Export Results

Exports a ranking CSV and all submissions (including source, input, and output files).

terry export /path/to/export-dir

To skip exporting submissions whose score is 0 or lower:

terry export /path/to/export-dir --filter-zero-score

To export submissions without their input files:

terry export /path/to/export-dir --skip-inputs

Specification of the terry format

You can find the specification of the format accepted by terry here.

About

Terry is a very customizable programming competition software, inspired by Google Code Jam / Facebook Hacker Cup, useful for holding contests without need of running any user-generated code.

Topics

Resources

License

Stars

Watchers

Forks

Contributors