Data-Driven Swim Roster Management
1. Roster Portability Coaches frequently manage swimmer rosters in external spreadsheet software like Excel or Google Sheets. Manually re-typing swimmer names, ages, and seed times for each meet is tedious and error-prone. Standardizing file imports is critical.
In a large club, a coach might have to manage 100 or more swimmers, each with multiple times across different strokes and distances. When entering a meet, the coach must compile this data and submit it to the meet host. If the coach has to enter this information by hand, they are highly likely to make mistakes—typing a 25.0 instead of a 22.0, or entering the wrong age or gender.
By utilizing standardized import and export formats, coaches can easily move data between their roster management systems, optimization tools, and meet entry software. This saves hours of administrative work and ensures that the data used for planning and entry is accurate and up-to-date.
2. Standardizing CSV Schemas Our application supports a standardized CSV file schema. The header row must define: `Name,Gender,Age,MaxRelays,Free25,Free50,Free100,Free200,Back25,Back50,Back100,Back200,Breast25,Breast50,Breast100,Breast200,Fly25,Fly50,Fly100,Fly200`
- **Format Guidelines:**
- - `Name`: String (e.g., "Sarah Smith")
- - `Gender`: `M` or `W` (or `X` for non-binary)
- - `Age`: Integer
- - `MaxRelays`: Integer
- - `Times`: Standard formatted times `MM:SS.hh` (e.g., `01:05.50` or `32.40` for fifty yards/meters). An entry of `0` or blank indicates no recorded swim time for that stroke.
The CSV parser in our application is designed to be robust. It handles different line endings (LF from Unix/Mac, CRLF from Windows), ignores extra whitespace around values, and handles common formatting errors (like using colons instead of periods for milliseconds). If a row contains invalid data (e.g., an age that is not a number), the parser flags the error and provides a clear message to the user, rather than crashing the application.
3. Time Course Conversions Swimmer seed times vary based on pool configurations: Short Course Yards (SCY - 25y), Short Course Meters (SCM - 25m), and Long Course Meters (LCM - 50m). When organizing national meets, coaches must apply conversion coefficients (such as those defined by USMS) to normalize roster times to the specific course of the upcoming meet.
For example, a short course yards pool is shorter than a short course meters pool, so times swum in yards are faster than times swum in meters. Long course meters pools have no turns (50m length), which makes them the slowest of all.
To compare times fairly, coaches use conversion factors. The standard USMS conversion from SCM to SCY for freestyle is to multiply the SCM time by 0.90. For example, a 50 SCM Free time of 25.0 seconds converts to $25.0 \times 0.90 = 22.5$ seconds in SCY. Conversely, converting SCY to SCM requires dividing by 0.90 or multiplying by 1.11. Our optimizer includes these conversion factors, allowing a coach to import a roster with yards times and automatically convert them if they are planning for a meters meet. This ensures that the optimization calculations are accurate and reflect the true speed of the swimmers in the specific pool configuration of the meet.
4. Data Security & Storage To maintain user privacy and facilitate offline use, roster records are persisted in local browser cache. Using JSON serialization, the entire roster is stored as a single schema under `mastersRelayRoster`. Exporting backup CSV files regularly safeguards against browser data loss.
Because the roster data contains sensitive information like full names, genders, and ages, security is a major concern. Storing the data locally on the client's device rather than on a remote server reduces the risk of data breaches and complies with privacy regulations like GDPR.
The data is serialized into a JSON string and saved using the browser's `localStorage` API. This allows the application to load the roster instantly when the user opens the page, even if they don't have an active internet connection.
However, `localStorage` can be cleared by the user or the browser under certain conditions (such as low storage space). To prevent data loss, the application includes an "Export Roster" button that allows coaches to download their entire roster as a CSV file. This file can be stored safely on their local hard drive or shared with other coaches, providing a reliable backup and transfer mechanism.