this_or_that

Crates.iothis_or_that
lib.rsthis_or_that
version0.1.1
created_at2026-01-24 15:18:08.720181+00
updated_at2026-01-24 15:49:05.449402+00
descriptionRatings website that uses Chess style rankings.
homepagehttps://crates.io/crates/this-or-that
repositoryhttps://github.com/ali-raheem/this-or-that
max_upload_size
id2066840
size1,490,629
Ali Raheem (ali-raheem)

documentation

README

This or That

Crates.io Crates.io License

A generic ELO-based ranking webapp where users vote on head-to-head matchups. Items gain or lose rating points based on votes, creating a chess-style ranking system that's fairer than simple star ratings.

You can see it in action here This or That Rocks.

Features

  • Head-to-head voting interface with keyboard shortcuts
  • ELO rating system with configurable k-factor
  • Top and bottom rankings pages
  • Individual item detail pages
  • Session-based vote validation (prevents replay attacks)
  • Fully configurable for any item type (movies, albums, games, etc.)

Quick Start

Prerequisites

  • Rust (1.70+)
  • SQLite

Installation

  1. Clone the repository

  2. Create configuration:

    cp Rocket.toml.example Rocket.toml
    # Edit Rocket.toml with your settings
    
  3. Initialize the database:

    mkdir -p data
    sqlite3 data/movies.db < schema.sql
    
  4. Populate with items (see example/TMDB.md for movie data)

  5. Run the server:

    cargo run
    
  6. Open http://localhost:7878

Configuration

See Rocket.toml.example for all options. Key settings:

Option Description
name Site name displayed in header
items What you're ranking (e.g., "Movie", "Album")
k ELO k-factor: 16 (slow), 32 (standard), 64 (fast)
image_path_base_url Base URL prepended to image paths
default_ranking_count Items shown in rankings

Keyboard Shortcuts

Key Action
1 or Vote for left item
2 or Vote for right item
Space Skip matchup

Examples

The example/ directory contains scripts for populating the database:

Use of AI statement

The Rust backend and code of this project is all artisanal hand coded, the front end is heavily edited by AI. Documentation like the README is also largely written based on notes by AI.

License

MIT License

Commit count: 46

cargo fmt