This directory contains shared code that is used by both the frontend and backend of the RackTracker pool match scoring system.
types.ts - TypeScript interfaces and types used throughout the applicationutils.ts - Utility functions for common operationsThe types.ts file defines the core data structures used in the application:
Player - Player informationMatch - Match details and scoringRack - Individual rack resultsRackEvent - Special events during racks (BR, RO, fouls, etc.)Tournament - Tournament informationPlayerStats - Player statisticsThe utils.ts file provides helper functions:
formatDate - Format Unix timestamps into readable datescalculatePlayerStats - Calculate derived statistics from raw datagenerateMatchSummary - Create a formatted match summary textformatPlayerName - Format player names in various stylesThese shared files ensure consistency between frontend and backend code. They should be imported directly:
import { Match, Player } from '../shared/types';
import { formatDate, calculatePlayerStats } from '../shared/utils';