concept
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v15View latest version
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 operations
The 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 statistics
The 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 styles
These 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';