A React + TypeScript + Tailwind CSS single-page app for CSE Premier League (CPL) at PSTU. It includes a public site with dynamic sections and a simple role-based authentication demo with protected Admin and Player dashboards.
- React 18 + TypeScript
- Vite
- Tailwind CSS + shadcn/ui components (Radix UI)
- React Router v6
- TanStack Query (ready for data fetching)
- Public pages
- Home: Hero, About, Stats (count), Tournament teaser, Gallery (video + image), Testimonials, Sponsors, FAQ, Contact, Footer
- About, Team, Tournament, Gallery, Contact
- Auth and roles (mock/demo)
- Login (no role selection; admin inferred by email)
- Registration (always Player)
- Role-based protected routes
- Admin Dashboard and Player Dashboard
- Hidden Auction page (admin-only, not in navbar)
/Home/about,/team,/tournament,/gallery,/contact/authAuth (Login/Register tabs)/login-> redirects to/auth?tab=login/register-> redirects to/auth?tab=register/dashboardPlayer Dashboard (protected)/adminAdmin Dashboard (admin-only)/admin/auctionAuction (admin-only, hidden from navbar)
- Install dependencies (npm, pnpm, yarn, or bun):
# using npm
npm install
# or using bun
bun install- Start the dev server:
npm run dev- Open the app at the printed local URL (typically http://localhost:5173).
This project ships with a lightweight, client-side mock auth:
Role access:
- Admin is determined by allowed admin emails (see
src/config/auth.ts) or your backend logic.
Two modes are supported:
- Simple client-only mode (no backend):
- Configure env vars in your
.envfile:VITE_ADMIN_EMAILS(comma-separated) orVITE_ADMIN_EMAILVITE_ADMIN_PASSWORD(shared admin password)
- When
VITE_ADMIN_PASSWORDis set, the app bypasses Supabase and stores sessions in localStorage. - Login: users enter email/password; if email is admin and password matches
VITE_ADMIN_PASSWORD, role is admin; otherwise player.
- Supabase mode:
- Set
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEY. - Email/password auth with profile upsert and optional avatar upload to
avatarsbucket.
Role access:
- Player: can open
/dashboard - Add forms and flows for team registration and tournament management.
- Add tests and CI.
MIT 2.0