Skip to content

andesco/calsnap

Repository files navigation

CalSnap Logo

CalSnap
Custom Calendars for TeamSnap

CalSnap delivers custom team calendar that are more detailed, clear, and usable. CalSnap deploys as a Cloudflare Worker (serverless function), connects to your TeamSnap account, and serves .ics iCalendar subscriptions for each team.

“TeamSnap already has calendars! Why use this?”

While TeamSnap supports calendar subscriptions, events lack useful information, team names can be too long, and descriptions are messy.

CalSnap uses the TeamSnap API so that your calendars include:

  • a custom team name (shorter or more descriptive)
  • links to TeamSnap event pages
  • arrival times (minutes early)
  • event notes by team manager or coach
CalSnap Event List TeamSnap Event List
Leafs vs. Forest Hill Knights
Leafs vs. North York Jets
Leafs vs. East York Lynx
North Toronto Leafs 2014 U12 AAA…
North Toronto Leafs 2014 U12 AAA…
North Toronto Leafs 2014 U12 AAA…
CalSnap Event Details TeamSnap Event Details
Leafs vs. Forest Hill Knights
GitHub Arena
101 Command Line Ave.
North Toronto Leafs 2014 U12 AAA…
101 Command Line Ave.
 
Away at Forest Hill Knights
Uniform: White
GitHub Arena
Rink B
Arrival: 1:20 PM · 40 min.
Notes: limited parking
TeamSnap event page link
Location: GitHub Arena - Rink A
Uniform: White (Arrival Time: 1:20
PM (Eastern Time (US & Canada)))
 
 
 
 

 

Deployment

step 1. Create Cloudflare Worker

option A: Cloudflare Dashboard

Deploy to Cloudflare

  1. Workers & Pages ⇢ Create an application ⇢ Clone a repository
  2. Git repository URL:
    http://github.com/andesco/calsnap
    

option B: Wrangler CLI

  1. Create a Cloudflare Workers KV namespace with Wrangler CLI and note the new namespace ID:

    git clone https://github.com/andesco/calsnap.git
    cd calsnap
    wrangler kv namespace create "CALSNAP_CALENDAR_STORE"
  2. Update wrangler.toml with the new KV namespace ID and set your environment variables:

    [[kv_namespaces]]
    binding = "CALSNAP_CALENDAR_STORE"
    id = "{new KV namespace ID}"
  3. Deploy with Wrangler CLI:

    wrangler deploy
  4. Note your new worker URL from the output:
     
    https://calsnap.{subdomain}.workers.dev

step 2. Create TeamSnap Application

  1. TeamSnap authenticationYour AccountYour ApplicationsNew Application

  2. Name: TeamSnap Custom Calendar
    Description: Cloudflare Worker
    Redirect URI: https://calsnap.{subdomain}.workers.dev

  3. Client ID: {your Client ID}
    Client Secret: {your Client Secret}

step 3. Setup Cloudflare Worker

option a: Cloudflare Dashboard

  1. Workers & Pages{worker} ⇢ Settings: Variables and Secrets: Add:
  2. Type: Text
    Variable name: TEAMSNAP_CLIENT_ID
    Value: {your Client ID}
  3. Type: Secret
    Variable name: TEAMSNAP_CLIENT_SECRET
    Value: {your Client Secret}

option b: Wrangler CLI

  1. set your environment variables wrangler.toml:
    [vars]
    ALLOWED_USER_EMAIL = "{your TeamSnap email}"
    TEAMSNAP_CLIENT_ID = "{your Client ID}"
  2. Set your secrets with Wrangler CLI:
    wrangler secret put TEAMSNAP_CLIENT_SECRET

step 4.

  1. Open your Cloudflare Worker in a browser: https://calsnap.{subdomain}.workers.dev
  2. Authenticate with TeamSnap.

 

Environment Variables

Required Variable Type Description
ALLOWED_USER_EMAIL Text TeamSnap email address authorized to use this calendar service. Only this user can access the service.
TEAMSNAP_CLIENT_ID Text Client ID from your TeamSnap OAuth application
TEAMSNAP_CLIENT_SECRET Secret Client Secret from your TeamSnap OAuth application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •