Chicago Free Museum Days - Backend

Val Town backend for scraping, storing, and serving Chicago free museum day data.

Vals

FileTypeDescription
db.tsScriptDatabase functions (SQLite)
scrapeChooseChicago.tsScriptChoose Chicago HTML scraper
utils.tsScriptDate normalization utilities
scraper.cron.tsCronMonthly scraper orchestrator
bot.cron.tsCronWeekly Bluesky poster (Mondays 8am CT)
api.http.tsHTTPPublic JSON API

Setup

  1. Deploy to Val Town
  2. Set secrets: BLUESKY_HANDLE, BLUESKY_PASSWORD
  3. Run scraper.cron.ts manually to populate initial data
  4. Schedule scraper.cron.ts monthly (first Monday)
  5. Schedule bot.cron.ts weekly (Mondays 8am CT → 0 14 * * 1 UTC in winter, 0 13 * * 1 in summer)

API Endpoints

  • GET / - API documentation
  • GET /free-days?start=YYYY-MM-DD&end=YYYY-MM-DD - Free days in date range
  • GET /upcoming - Next 7 days
  • GET /today - Today's free days
  • GET /institutions - List all museums
  • GET /health - Health check

Database Tables

  • scraped_free_days - Auto-populated by scrapers
  • free_days_overrides - Manual corrections (win on conflicts)