Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 2.52 KB

File metadata and controls

65 lines (47 loc) · 2.52 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

HackathonTUI is a Rust-based Terminal User Interface application for managing hackathons. It provides tools for participant registration, team formation, project submissions, judging, sponsorships, prizes, scheduling, and analytics.

Build and Development Commands

cargo build              # Build debug version
cargo run                # Run in debug mode
cargo build --release    # Build optimized release version
cargo test               # Run tests
cargo check              # Check for compilation errors
cargo fmt                # Format code
cargo clippy             # Run linter

Architecture

Application Structure

  • main.rs: Entry point with event loop, polls keyboard input every 100ms via crossterm
  • app.rs: Central state container (App struct) holding navigation state, data, UI state, and form state

Input Handling Pipeline

Input is processed in this priority order:

  1. Modal handling (forms, confirmations)
  2. Search mode
  3. Editing mode
  4. Screen-specific handlers
  5. Global shortcuts (q=quit, ?=help, /=search, Esc=back)

Data Layer

  • models/: Domain entities (Hackathon, Participant, Team, Project, Judge, Score, Sponsor, Prize, ScheduleEvent)
  • storage/json_store.rs: JSON file persistence at ~/.hackathontui/data/hackathons/{id}/{entity}.json
  • HackathonData: Container struct that bundles all related entities for a hackathon with load()/save() methods

UI Layer

  • ui/: Ratatui-based rendering with constraint-based layouts
  • ui/components/: Reusable components (table, form, modal, tabs, charts)
  • Screen views: dashboard.rs, hackathons.rs, participants.rs, teams.rs, projects.rs, judges.rs, judging.rs, sponsors.rs, prizes.rs, schedule.rs, analytics.rs

Key Patterns

  • Tab Navigation: 10 tabs per hackathon detail view, switchable via Tab/Shift+Tab or numeric keys (1-0)
  • List Navigation: Vi-style (j/k) or arrow keys, Enter to select
  • Common Actions: n=new, e=edit, d=delete, c=check-in, s=submit/score
  • Status Messages: Auto-clear after 3 seconds
  • UUIDs: All entities use UUID v4 for identification

Dependencies

  • ratatui (0.29): TUI framework
  • crossterm (0.28): Terminal manipulation
  • serde/serde_json: JSON serialization
  • chrono: Date/time handling
  • uuid: Unique ID generation
  • dirs: Cross-platform home directory detection
  • thiserror: Error handling