The Admin Dashboard is the central control plane for e-board members of the Beta Alpha Psi Beta Tau Chapter. It lives at theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/asubap/website/llms.txt
Use this file to discover all available pages before exploring further.
/admin route and is exclusively accessible to authenticated users whose role field equals "e-board" — any other role is implicitly excluded by the route guard. On mount, the page fires four parallel fetches: GET /users/summary (twice, split into admin and member lists), GET /sponsors/, and GET /announcements. All state is held inside the Admin component; child sections receive sliced props and callback functions rather than managing their own top-level data. The page renders a full-width Navbar (with role-aware nav links), then a two-column md:grid-cols-2 grid containing the eight dashboard sections described below, and ends with a Footer. All destructive and mutating actions are wrapped in either a ConfirmDialog (reusable, centralized) or a component-local ConfirmationModal, keeping confirmation logic consistent across the entire surface.
Layout
The dashboard uses a responsive CSS grid defined inAdmin.tsx:
order-N classes that control mobile vs. desktop stacking. The Resource Management and Eboard Management sections span the full two-column width (col-span-1 md:col-span-2) because they contain complex, accordion-style UIs that would be too cramped in a single column.
Dashboard Sections
Announcements
Create, view, edit, and delete rich-text announcements. Sorted pinned-first then newest-first. Uses TinyMCE for authoring new announcements.
Admin Users
List of current e-board email addresses. Add new admins by email; remove them with a single click backed by
/users/delete-user.Sponsors
Full CRUD for sponsor companies. Tier management (platinum → bronze), profile bio and links, passcode. See the dedicated Sponsors page.
General Members
Active
general-member roster with search, rank filter, inline archive, and full profile edit. See the Members page.Archived Members
Soft-deleted members. Restore with a single click; they re-appear in the active list immediately.
Alumni Members
Read-only list pulled from
GET /member-info/alumni/summary. Search only — no editing from this panel.Resource Management
Two-level hierarchy: categories (firm or chapter) containing file resources. Uploads go to Vercel Blob for files >4.5 MB.
Eboard Management
Create and edit eboard role entries with display rank ordering, role email, and member email linkage. See the Eboard page.
Access Control
The role check happens at the Supabase JWT level on the backend. The frontend readsrole from useAuth():
Global Confirm Dialog
All mutating actions inAdmin.tsx funnel through a single ConfirmDialog managed by the confirmDialogInfo state object:
showConfirmationDialog(title, message, onConfirmAction, confirmText?, cancelText?) sets this state and is passed down to child components (e.g., SponsorList) that need to trigger confirmations but don’t own the dialog themselves.
Data Flow Summary
Announcements
Announcements are fetched fromGET /announcements and sorted with pinned items first, then by created_at descending. The AnnouncementListShort component renders the list inline with Edit / View / Delete icon buttons per row.
| Action | Endpoint | Method |
|---|---|---|
| Create | /announcements/add-announcement | POST |
| Edit | /announcements/edit-announcement | POST |
| Delete | /announcements/delete-announcement | POST |
CreateAnnouncementModal uses TinyMCE (keyed by VITE_TINY_MCE_KEY) for rich-text description authoring. The EditAnnouncementModal uses a plain <textarea> for editing and persists draft edits to localStorage under the key modal-announcement-edit-{id}. On successful save or deliberate discard, that key is cleared.
Admin Users
The Admin Users panel re-uses theEmailList component with userType="admin" and clickable={false}. The add flow launches AddUserModal with role="e-board". Deletion calls POST /users/delete-user with { user_email } and immediately filters the email out of local state.
The same
handleDelete function removes emails from all three lists (admins, sponsors, members) in one call. Ensure the email only appears in the intended list to avoid cross-contamination.Resource Management
Resource Management is a self-containedResourceManagement component that spans the full grid width. It organizes content into two levels:
- Categories — each has a
name,description, andresourceType("firm"|"chapter") - Resources — belong to a category; have
name,description,file_key,mime_type, and asigned_urlfor preview/download
@vercel/blob/client’s upload() function with the server-side handler at /blob-upload/resources/:categoryId. Smaller files are posted as multipart/form-data directly to /resources/:categoryId/resources.