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

wohara010

SportCalApp

Sports schedule to Calendar sync tool
Public
Like
SportCalApp
Home
Code
5
api
7
README.md
SEARCH_DEMO.md
index.html
H
main.tsx
Environment variables
Branches
1
Pull requests
Remixes
History
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
/
README.md
Code
/
README.md
Search
2/22/2026
Viewing readonly version of main branch: v146
View latest version
README.md

Sports Calendar Sync - Architecture

Entity Disambiguation System

This app uses a robust entity identification system to handle athletes with the same name across different sports.

Entity ID Structure

Each entity has a unique ID that encodes:

  • Type: sport, team, or athlete
  • Sport code: f1, nfl, nba, etc.
  • Unique identifier: API-provided ID or generated UUID

Examples:

  • sport_f1 - Formula 1 as a sport
  • team_f1_redbull - Red Bull Racing team
  • athlete_f1_verstappen_33 - Max Verstappen (F1, car #33)
  • athlete_nfl_smith_67890 - John Smith (NFL player)
  • athlete_f1_smith_12345 - John Smith (F1 driver)

Search Flow

  1. User searches for "John Smith"
  2. API returns ALL matching entities with unique IDs:
    [ { "id": "athlete_f1_smith_12345", "name": "John Smith", "sport": "Formula 1", "team": "Example Racing", "metadata": { "carNumber": "88" } }, { "id": "athlete_nfl_smith_67890", "name": "John Smith", "sport": "NFL", "team": "Example FC", "metadata": { "position": "WR" } } ]
  3. User selects the correct John Smith
  4. App stores the unique entity ID
  5. Schedule fetched using that specific ID

Multi-Series Athletes

Athletes like Max Verstappen who compete in multiple series have:

  • Single athlete ID: athlete_f1_verstappen_33
  • Multiple categories: ["Formula 1", "IGTC"]
  • Aggregated events from all series they compete in

Data Sources

Current Implementation

  • F1: Ergast API (https://ergast.com/api/f1/)
    • Free, reliable, real-time
    • Provides race schedules, circuit info, results
    • Automatically updates when races are rescheduled

Future Integrations

Planned API integrations:

  • NFL: ESPN API or NFL official API
  • NBA: NBA Stats API
  • NHL: NHL Stats API
  • MLB: MLB Stats API
  • Soccer: Football-Data.org or API-Football

Upcoming Events Filter

All schedules automatically filter to show only upcoming events:

  • Compares event datetime against current time
  • Past events are excluded
  • Updates in real-time (no stale data)

Auto-Update Strategy

Race Schedule Changes

When a race gets rescheduled:

  1. Ergast API updates immediately
  2. Next fetch gets new time
  3. Option 1: Manual refresh button
  4. Option 2: Webhook to update Google Calendar events (future feature)

Proposed Sync Mechanism

User adds events β†’ Store entity ID in calendar metadata
Daily cron job β†’ Check for schedule changes
If changed β†’ Update calendar event via Google Calendar API

File Structure

/
β”œβ”€β”€ main.tsx              # Main UI component
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ search.ts         # Entity search with disambiguation
β”‚   β”œβ”€β”€ schedule.ts       # Fetch events for specific entity
β”‚   β”œβ”€β”€ add-to-calendar.ts  # Google Calendar integration
β”‚   └── auth/
β”‚       └── google.ts     # OAuth flow

Next Steps

  1. Google Calendar OAuth - Set up credentials
  2. More sports APIs - NFL, NBA, NHL, MLB
  3. Auto-sync - Detect schedule changes and update calendar
  4. Webhook system - Real-time updates when events change
  5. User preferences - Save followed entities
  6. Notification system - Alert when schedules change
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.