• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
join

join

concept

Public
Like
concept
Home
Code
4
backend
3
frontend
3
shared
3
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
shared
/
README.md
Code
/
shared
/
README.md
Search
5/17/2025
README.md

RackTracker Shared Code

This directory contains shared code that is used by both the frontend and backend of the RackTracker pool match scoring system.

Structure

  • types.ts - TypeScript interfaces and types used throughout the application
  • utils.ts - Utility functions for common operations

Types

The types.ts file defines the core data structures used in the application:

  • Player - Player information
  • Match - Match details and scoring
  • Rack - Individual rack results
  • RackEvent - Special events during racks (BR, RO, fouls, etc.)
  • Tournament - Tournament information
  • PlayerStats - Player statistics

Utilities

The utils.ts file provides helper functions:

  • formatDate - Format Unix timestamps into readable dates
  • calculatePlayerStats - Calculate derived statistics from raw data
  • generateMatchSummary - Create a formatted match summary text
  • formatPlayerName - Format player names in various styles

Usage

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';
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.