SESC Events Portal is a Next.js + Supabase web app for publishing student events, managing registrations, and handling attendance workflows for SESC-SLIIT.
- Public event discovery and event detail pages
- Registration flow with capacity checks
- My Events dashboard with generated QR ticket previews
- Admin panel for creating/editing events
- Admin registrant list with attendance toggling
- Admin QR check-in page route (scanner UI placeholder currently)
- Supabase Auth with server-side session refresh through proxy
- Profile completion flow for non-admin users
- Optional registration confirmation emails via Resend
- Next.js (App Router)
- React 19 + TypeScript
- Tailwind CSS + shadcn/ui primitives
- Supabase (
@supabase/ssr,@supabase/supabase-js) - QR generation via
qrcode - Transactional email via
resend
/home page/eventspublished events listing/events/[slug]event details + registration/my-eventsregistered events + ticket QR preview/auth/login,/auth/sign-up,/auth/forgot-password,/auth/update-password/complete-profilerequired for non-admin users withoutstudent_id
/admin/eventsevent list/admin/events/newcreate event/admin/events/[id]/editedit event/admin/events/[id]/registrantsregistrant management + attendance toggle/admin/events/[id]/scanQR check-in page (placeholder)
- Supabase Auth session is refreshed in proxy middleware.
- Non-authenticated users are redirected from protected routes to
/auth/login. - OAuth callback currently allows only emails ending with
@my.sliit.lk. - Non-admin users without a profile
student_idare redirected to/complete-profile. - Admin routes validate
profiles.is_adminbefore rendering.
Create a .env.local in project root:
NEXT_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=YOUR_SUPABASE_PUBLISHABLE_OR_ANON_KEY
# Optional fallback for legacy code paths
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
# Optional: for links inside transactional emails
NEXT_PUBLIC_SITE_URL=http://localhost:3000
# Optional: enable registration email sending
RESEND_API_KEY=YOUR_RESEND_API_KEY
RESEND_FROM_EMAIL="SESC Events <[email protected]>"Notes:
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYis the primary key variable used by this project.NEXT_PUBLIC_SUPABASE_ANON_KEYis only kept as compatibility fallback in some files.
This repository currently does not include migration files. Ensure your Supabase project has these resources.
Suggested columns:
iduuid primary key referencesauth.users(id)emailtextfull_nametextstudent_idtextis_adminboolean default false
Useful constraints:
- unique(
student_id) for non-null values
Suggested columns:
iduuid primary keyslugtext uniquetitletextdescriptiontexttypetext (onsiteorvirtual)locationtext nullablemeeting_urltext nullablestart_attimestamptzend_attimestamptzcapacityinteger nullablestatustext (draft,published,archived)flyer_image_urltext nullablecolor_codetext nullablecreated_byuuid nullable referencesauth.users(id)
Suggested columns:
iduuid primary keyevent_iduuid referencesevents(id)user_iduuid referencesauth.users(id)statustext (usesregisteredin current code)attendedboolean default falsecreated_attimestamptz default now()
Useful constraints:
- unique(
event_id,user_id) to prevent duplicate registrations
Suggested columns:
iduuid primary keyadmin_iduuid referencesauth.users(id)action_descriptiontextcreated_attimestamptz default now()
- Bucket name:
event-flyers - Used for event flyer uploads from the admin event form
- Must allow uploads and public URL access according to your policy model
Apply Row Level Security policies appropriate for your org. At minimum:
profiles: users can read/update their own row; admins may read broader data if neededevents: public can readpublished; admins can create/update/deleteevent_registrations: users can create/read their own registrations; admins can read all and update attendanceaudit_logs: insert/read limited to admins
- Install dependencies:
npm install-
Add
.env.localvalues (see above). -
Run development server:
npm run devnpm run devstart dev servernpm run buildproduction buildnpm run startrun built appnpm run lintrun ESLint
- Admin QR scanner page exists, but camera/scanner logic is not implemented yet.
- Database schema is documented here but not versioned as SQL migrations in the repo.
- Audit logs utility exists, but no dedicated admin UI page is currently wired.
app/(public)public event browsing and registrationapp/(user)user-specific views like My Eventsapp/(admin)admin dashboard and management workflowsapp/authauth pages and callback routelib/supabasebrowser/server/proxy Supabase clientslib/email.tsregistration email sender (Resend)lib/tickets.tsticket payload and QR generation
Built for SESC-SLIIT event operations and student engagement workflows.