This is the official repository for student union kwara state university site
# KWASU Students' Union Platform - Developer Documentation
Welcome to the official developer documentation for the Kwara State University Students' Union (KWASU SU) platform. This application is a comprehensive portal for student news, events, executive profiles, and essential services.
## π Tech Stack
- **Frontend:** React 18 with TypeScript
- **Build Tool:** Vite
- **Styling:** Tailwind CSS + shadcn/ui (Radix UI primitives)
- **Routing:** React Router DOM v6
- **Backend/Database:** Supabase (PostgreSQL, Auth, Storage)
- **Icons:** Lucide React
- **State Management:** React Hooks + TanStack Query (for caching/fetching)
- **Media Handling:** Cloudinary (via Supabase Edge Functions)
## π Project Structure
```text
apps/
βββ admin/ # Admin-specific control panel (React/Vite)
β βββ src/pages/ # Admin dashboard and management views
β βββ ...
βββ web/ # Public Student Union website (React/Vite)
βββ src/pages/ # Public-facing views (Home, News, Events, etc)
βββ ...
packages/
βββ shared/ # Shared logic and UI between admin and web
βββ src/components/ # Reusable UI components
β βββ admin/ # Admin-specific shared UI components
β βββ ui/ # shadcn/ui base components
βββ src/lib/ # Core logic, API wrappers, Supabase client
βββ src/types/ # TypeScript interfaces and types
βββ src/utils/ # Helper functions (auth, formatting, etc.)
public/ # Global static assets (images, fonts)
supabase/
βββ functions/ # Deno-based Edge Functions (Cloudinary bridge)
```
## π οΈ Core Modules
### 1. Authentication
The app uses Supabase Auth. The `SessionContextProvider` wraps the application to provide real-time auth state.
- **Admin Access:** Restricted to users with the `admin` role (managed via the `profiles` table).
- **Login:** Located at `/admin/login`.
### 2. API Layer (`src/lib/api/`)
The API is modularized by feature. Each module handles communication with Supabase tables: β¦