Skip to content

sftimeless/csc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cal Sailing Club Live Demo (Static HTML + React UMD)

This repo now runs as a static site with a single dev command, Supabase auth, realtime updates, and QR camera scanning with cleanup.

One-command local run

npm install
npm run dev

Open:

  • http://localhost:5173/
  • http://localhost:5173/cal-sailing-club-website/members-login.html
  • http://localhost:5173/cal-sailing-club-website/dashboard-embedded.html

One-command tunnel (same Wi-Fi or remote sharing)

Cloudflare:

npm run tunnel:cloudflare

ngrok:

npm run tunnel:ngrok

Share the generated HTTPS URL plus /cal-sailing-club-website/members-login.html.

Supabase setup

Apply migrations in order:

  1. /Users/cmunoz/Desktop/Website/supabase/migrations/20260209120000_csc_supabase_foundation.sql
  2. /Users/cmunoz/Desktop/Website/supabase/migrations/20260209153000_csc_roles_claims.sql
  3. /Users/cmunoz/Desktop/Website/supabase/migrations/20260209154000_csc_policy_tweaks.sql

Then run seed SQL:

  • /Users/cmunoz/Desktop/Website/supabase/seed/csc_demo_users.sql

Expected auth emails already created in Supabase Auth:

  • nonrated@csc.org
  • novice@csc.org
  • junior@csc.org
  • senior@csc.org
  • dayleader@csc.org
  • excom@csc.org
  • admin@csc.org

Demo checklist (2 devices, 10 steps)

  1. Device A: open members login and sign in as dayleader@csc.org.
  2. Device B: open members login and sign in as nonrated@csc.org (or novice@csc.org).
  3. Device B: create a lesson request from Instructor Availability.
  4. Device A: verify request appears within 1–2 seconds in lesson requests.
  5. Device A: approve/deny; Device B sees live status update.
  6. Device A: create an announcement.
  7. Device B: verify announcement appears live without refresh.
  8. Device B: report a fleet issue.
  9. Device A: resolve issue; Device B sees fleet state update live.
  10. Device A: start manifest session, add/remove member, end session; ops views update live.

Manual verification and console checks

Run with npm run dev and verify:

  • curl -I http://127.0.0.1:5173/csc-dashboard-v6.preview.jsx returns Content-type: text/javascript.
  • In browser console on login/dashboard pages:
    • window.__CSC_ENV is defined.
    • window.CSCSupabaseClient && typeof window.CSCSupabaseClient.client === "function" is true.
    • window.CSCSupabaseClient && typeof window.CSCSupabaseClient.signIn === "function" is true.
  • On dashboard page:
    • no Cannot access ... before initialization errors.
    • no false Supabase not configured banner when config and Supabase script are present.
    • nav/profile dropdown click handlers open/close.

Key implementation notes

  • tools/dev_server.py serves .jsx as executable JS MIME and disables cache.
  • config.js now exports canonical window.__CSC_ENV plus compatibility aliases.
  • src/supabaseClient.js and /supabaseClient.js expose:
    • client()
    • getSession()
    • signIn(email, password)
    • signOut()
  • Dashboard auth gate now redirects to login if no session before mounting app.
  • QR scanner stops media tracks on close, unmount, page hide, hash/popstate changes, and tab hide.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages