A comprehensive Ruby on Rails 8.2 application for managing Kyudo (Japanese archery) tournaments with support for multiple tournament formats, complex scoring systems, and role-based access control.
Core:
- Ruby: 3.4.7
- Rails: 8.1.2 (fully modernized to Rails 8 patterns)
- Database: PostgreSQL with custom enums
- Authentication: Rails 8 built-in authentication (has_secure_password + Sessions)
- Authorization: Pundit (role-based)
Frontend:
- JavaScript: Importmap-rails (no Node.js bundler needed)
- CSS: Sass/Bulma via cssbundling-rails
- Interactivity: Hotwire (Turbo + Stimulus)
Background Jobs & Infrastructure:
- Queue: Solid Queue (database-backed Active Job)
- Cache: Solid Cache (database-backed Rails.cache)
- WebSockets: Solid Cable (database-backed Action Cable)
Key Gems:
- State Machine: Statesman (tournament workflow)
- Auditing: audited (change tracking)
- I18n: Mobility (model translations EN/FR)
- Testing: Minitest with Apparition (headless Chrome)
- Ruby 3.4.7
- PostgreSQL 14+
- Yarn (for CSS bundling only)
bundle install
yarn install# Create and migrate database
bin/rails db:create
bin/rails db:migrate
# Load default data (staff roles, etc.)
bin/rails db:seed# Start all services (Rails server + CSS watcher)
bin/devThe application will be available at http://localhost:3000
# Unit and integration tests
bin/rails test
# System tests (headless Chrome)
bin/rails test:system
# Watch mode (auto-run tests on file changes)
guardCurrent Test Status:
- ✅ 193 unit tests, 721 assertions
- ✅ 122 system tests, 1035 assertions
- ✅ All passing
- JavaScript: Uses importmap-rails. No esbuild/webpack needed. Modules are loaded directly from CDN or vendored.
- CSS: Uses cssbundling-rails with Sass. Bulma framework with custom styling.
Modern Rails 8 authentication:
- Session-based with secure signed cookies
- Password reset via signed tokens (no database tokens)
- Rate limiting on login and password reset
- Email confirmation required
Solid Queue handles all background jobs:
# Queue a job
MyJob.perform_later(arg1, arg2)
# View queue dashboard
# Visit /solid_queue in development# Linting
bin/rubocop
bin/rubocop -a # Auto-fix
# Security audit
bundle audit check
bin/brakemanApplication is containerized with Docker:
# Build image
docker build -t pikaichu .
# Run container
docker run -p 3000:3000 pikaichuAzure Deployment:
- Bicep templates in
infra/directory - Azure Container Apps with PostgreSQL Flexible Server
- See
azure.yamlfor Azure Developer CLI config
# Deploy to Azure
azd up- Individual: Solo archer competition
- Team: 3-5 archers per team
- 2in1: Hybrid format with both individual and team rankings
- Matches: Elimination bracket (4 or 8 teams)
- Kinteki: Traditional hit/miss scoring
- Enteki: Distance-based scoring (0, 3, 5, 7, 9, 10 points)
Statesman-based workflow:
- new - Tournament structure can be modified
- registration - Adding participants, teams, dojos
- marking - Score entry and validation
- tie_break - Resolving ties
- done - Tournament complete (immutable)
- taikai_admin - Full tournament control
- dojo_admin - Manage own dojo's participants
- chairman - Tournament director
- marking_referee - Score entry
- shajo_referee - Floor referee
- target_referee - Target judge
- More roles documented in docs/STAFF_ROLES.md
- Useful Notes - Development recipes and console commands
- Staff Roles - Role definitions and constraints
- Modernization Report - Rails 8 upgrade documentation
- Copilot Instructions - Comprehensive technical guide
- Create a feature branch
- Make your changes
- Run tests:
bin/rails testandbin/rails test:system - Run linters:
bin/rubocop - Submit a pull request
See LICENSE file for details.
This application was fully modernized to Rails 8 in January 2025:
- ✅ Removed Devise, implemented Rails 8 authentication
- ✅ Migrated to importmap-rails (from jsbundling-rails)
- ✅ Added Solid Queue, Solid Cache, Solid Cable
- ✅ Updated to Rails 8 code patterns and best practices
- ✅ Full test coverage maintained throughout migration
See MODERNIZATION_REPORT.md for detailed migration notes.