How prodbyfarid/study-club-web-lab-booking works
This is a Next.js lab-room booking starter. Users sign up or log in, browse active rooms, submit a booking, and view or cancel their own bookings. Booking actions validate input and write through Supabase; the database enforces row-level access and rejects overlapping bookings. The graph preserves the documented session-proxy and database-security layers. SQL capabilities and some page wiring are documented or indexed rather than fully excerpted, so those relationships cite the README or are omitted where not established.
Main entry points: server.ts Server Supabase client · auth.ts User and profile lookup · bookings/page.tsx My bookings page · new/page.tsx New booking page
Components 22
Web interface
- App layout
src/app/layout.tsx - Home page
src/app/page.tsx - Login and signup pages
src/app/login/page.tsx - Auth form
src/components/AuthForm.tsx - Navigation
src/components/Navbar.tsx
Identity and sessions
- Auth actions
src/actions/auth.ts - User and profile lookup
src/lib/auth.ts - Request proxy
src/proxy.ts - Session refresh and redirects
src/lib/supabase/proxy.ts
Booking workflow
- Room listing
src/app/rooms/page.tsx - New booking page
src/app/bookings/new/page.tsx - Booking form
src/components/BookingForm.tsx - Booking actions
src/actions/bookings.ts - My bookings page
src/app/bookings/page.tsx - Status badge
src/components/StatusBadge.tsx
Supabase data
- Server Supabase client
src/lib/supabase/server.ts - Browser Supabase client
src/lib/supabase/client.ts - Schema, RLS, overlap constraint
supabase/01_schema.sql - Initial room data
supabase/02_seed.sql
Other components
- Visitor
- Supabase Auth
- Supabase Postgres
Connections 37
- Visitor → App layout: opens app
src/app/layout.tsx - App layout → Navigation: renders
src/app/layout.tsx - Visitor → Login and signup pages: chooses auth
README.md - Login and signup pages → Auth form: renders
README.md - Auth form → Auth actions: submits to
src/components/AuthForm.tsx - Auth actions → Server Supabase client: creates client
src/actions/auth.ts - Auth actions → Supabase Auth: signs in or up
src/actions/auth.ts - Navigation → User and profile lookup: loads profile
src/components/Navbar.tsx - Navigation → Auth actions: submits logout
src/components/Navbar.tsx - Request proxy → Session refresh and redirects: delegates
src/proxy.ts - Session refresh and redirects → Supabase Auth: refreshes session
README.md - Visitor → Room listing: browses rooms
README.md - Room listing → User and profile lookup: requires user
src/app/rooms/page.tsx - Room listing → Server Supabase client: creates client
src/app/rooms/page.tsx - Room listing → Supabase Postgres: reads active rooms
src/app/rooms/page.tsx - Visitor → New booking page: starts booking
README.md - New booking page → User and profile lookup: requires user
src/app/bookings/new/page.tsx - New booking page → Server Supabase client: creates client
src/app/bookings/new/page.tsx - New booking page → Supabase Postgres: loads room choices
src/app/bookings/new/page.tsx - New booking page → Booking form: renders
src/app/bookings/new/page.tsx - Booking form → Booking actions: submits to
src/components/BookingForm.tsx - Booking actions → User and profile lookup: requires user
src/actions/bookings.ts - Booking actions → Server Supabase client: creates client
src/actions/bookings.ts - Booking actions → Supabase Postgres: inserts or updates
src/actions/bookings.ts - Supabase Postgres → Schema, RLS, overlap constraint: enforces RLS and overlap
README.md - Visitor → My bookings page: views bookings
README.md - My bookings page → User and profile lookup: requires user
src/app/bookings/page.tsx - My bookings page → Server Supabase client: creates client
src/app/bookings/page.tsx - My bookings page → Supabase Postgres: reads own bookings
src/app/bookings/page.tsx - My bookings page → Booking actions: submits cancellation
src/app/bookings/page.tsx - My bookings page → Status badge: renders status
src/app/bookings/page.tsx - Initial room data → Supabase Postgres: seeds room data
README.md - User and profile lookup → Server Supabase client: creates client
src/lib/auth.ts - User and profile lookup → Supabase Auth: checks claims
README.md - Server Supabase client → Supabase Postgres: connects to
src/lib/supabase/server.ts - Server Supabase client → Supabase Auth: uses session cookies
README.md - Browser Supabase client → Supabase Auth: supports browser auth