How benildavid/knockout works
Knockout is a self-hosted tournament-management application with accounts, event operations, and a virtual-points prediction competition. Participants and staff use the web app to register and manage entrants, generate and operate brackets, submit or approve results, and—separately—place predictions and settle outcomes. The API routes these workflows through identity, community/event, tournament, and prediction logic to persistent state. README documents additional account security, team, scheduling, reporting, and deployment capabilities; those are represented where their owning source is identifiable. Edges reflect shown calls or documented behavior; unsampled subsystem links are omitted rather than inferred.
Main entry points: storage.ts State repository · Bracket.tsx Bracket view · community.ts Membership and operations · tournaments.ts Tournament engine
Components 20
Web application
- Tournament workspace
apps/web/src/App.tsx - Prediction workspace
apps/web/src/Phase2.tsx - API client
apps/web/src/api.ts - Bracket view
apps/web/src/components/Bracket.tsx - Animated bracket
apps/web/src/components/motion/knockout-bracket.tsx - Bracket wheel
apps/web/src/components/motion/knockout-wheel.tsx - Tooltip positioning
apps/web/src/components/motion/tooltip/use-position.ts
API and domain
- HTTP and event routes
apps/api/src/app.ts - Accounts and access
apps/api/src/identity.ts - Membership and operations
apps/api/src/community.ts - Tournament engine
apps/api/src/tournaments.ts - Prediction ledger logic
apps/api/src/predictions.ts
Persistence and contracts
- Shared domain contracts
packages/contracts/src/index.ts - Account and ledger types
apps/api/src/phase-types.ts - State repository
apps/api/src/storage.ts
External services
- PostgreSQL
- Local JSON state
- SMTP email
- brackets-manager
Other components
- Participants and staff
Connections 31
- Participants and staff → Tournament workspace: uses
README.md - Tournament workspace → API client: requests API
apps/web/src/App.tsx - Prediction workspace → API client: requests API
apps/web/src/Phase2.tsx - Tournament workspace → Bracket view: renders
apps/web/src/App.tsx - Prediction workspace → Bracket view: renders
apps/web/src/Phase2.tsx - Bracket view → Animated bracket: renders
apps/web/src/components/Bracket.tsx - Bracket view → Bracket wheel: loads
apps/web/src/components/Bracket.tsx - Bracket view → Tooltip positioning: positions tooltips
- HTTP and event routes → Accounts and access: installs
apps/api/src/app.ts - HTTP and event routes → Membership and operations: installs
apps/api/src/app.ts - HTTP and event routes → Membership and operations: mutates as
apps/api/src/app.ts - HTTP and event routes → State repository: reads and writes
apps/api/src/app.ts - HTTP and event routes → Tournament engine: uses
apps/api/src/app.ts - Accounts and access → State repository: persists accounts
apps/api/src/identity.ts - Membership and operations → Accounts and access: checks permissions
apps/api/src/community.ts - Membership and operations → State repository: writes state
apps/api/src/community.ts - Membership and operations → Tournament engine: uses tournament rules
apps/api/src/community.ts - Membership and operations → Prediction ledger logic: coordinates outcomes
apps/api/src/community.ts - Tournament engine → State repository: uses engine storage
apps/api/src/tournaments.ts - Tournament engine → brackets-manager: manages brackets
apps/api/src/tournaments.ts - Prediction ledger logic → State repository: updates ledger
apps/api/src/predictions.ts - Prediction ledger logic → Tournament engine: reads match state
apps/api/src/predictions.ts - State repository → PostgreSQL: stores state
- State repository → Local JSON state: stores state
apps/api/src/storage.ts - State repository → Account and ledger types: uses state types
apps/api/src/storage.ts - Tournament workspace → Shared domain contracts: uses shared types
apps/web/src/App.tsx - Prediction workspace → Shared domain contracts: uses shared types
apps/web/src/Phase2.tsx - Bracket view → Shared domain contracts: uses match types
apps/web/src/components/Bracket.tsx - Tournament engine → Shared domain contracts: uses domain types
apps/api/src/tournaments.ts - Accounts and access → Account and ledger types: projects public user
apps/api/src/identity.ts - Accounts and access → SMTP email: sends verification mail