How mlakshmipriya0601/campus-flow works
CampusFlow is a role-based, single-page campus operations demo. A user enters through login and guarded navigation, opens a role-appropriate dashboard or workflow, and the page calls Promise-based services backed by browser localStorage; custom collection events refresh views. The main domain areas are gate passes, events, complaints, bookings, latecomers, and classrooms, with reporting and campus administration alongside them. The README documents capabilities beyond the sampled code; those branches are included, but their internal call links are not inferred where source evidence is missing.
Main entry points: App.tsx App router · index.ts Service registry · EventDetailPage.tsx Event workflow · events.ts Event service
Components 32
Application shell
- App router
src/App.tsx - Authentication state
src/context/AuthContext.tsx - Role guards
src/routes/guards.tsx - Role navigation
src/routes/navigation.ts - Application shell
src/layouts/AppLayout.tsx - Role dashboards
src/pages/dashboard/DashboardPage.tsx
Campus workflows
- Gate pass workflow
src/pages/GatePassPage.tsx - Event workflow
src/pages/EventDetailPage.tsx - Complaint workflow
src/pages/ComplaintsPage.tsx - Hall bookings
src/pages/HallBookingPage.tsx - Latecomer tracking
src/pages/LatecomersPage.tsx - Classroom directory
src/pages/ClassroomsPage.tsx - Campus administration
src/pages/UsersPage.tsx
Services and data
- Gate pass service
src/services/gatePass.ts - Event service
src/services/events.ts - Complaint service
src/services/complaints.ts - Reactive collection hook
src/hooks/useCollection.ts - Service registry
src/services/index.ts - Collection storage
src/services/collection.ts - Demo seed data
src/data/seed.ts
Shared capabilities
- Operational reports
src/pages/ReportsPage.tsx - Notifications
src/pages/NotificationsPage.tsx - Shared UI components
src/components/ui/ui.tsx - Data table
src/components/ui/DataTable.tsx - Modal dialogs
src/components/ui/Modal.tsx - Permission rules
src/utils/permissions.ts - Event rules
src/utils/events.ts - Complaint rules
src/utils/complaints.ts - Date utilities
src/utils/date.ts - Toast feedback
src/context/ToastContext.tsx
Other components
- Campus user
- Browser localStorage
Connections 42
- Campus user → App router: opens
src/App.tsx - App router → Authentication state: requires
src/App.tsx - App router → Role guards: guards routes
src/App.tsx - App router → Application shell: renders
src/App.tsx - App router → Role dashboards: routes to
src/App.tsx - App router → Gate pass workflow: routes to
src/App.tsx - App router → Event workflow: routes to
src/App.tsx - App router → Complaint workflow: routes to
src/App.tsx - App router → Hall bookings: routes to
src/App.tsx - App router → Latecomer tracking: routes to
src/App.tsx - App router → Classroom directory: routes to
src/App.tsx - App router → Campus administration: routes to
src/App.tsx - App router → Operational reports: routes to
src/App.tsx - App router → Notifications: routes to
src/App.tsx - Role guards → Role navigation: checks access
src/routes/guards.tsx - Application shell → Role navigation: builds menu
- Gate pass workflow → Gate pass service: requests and records
src/pages/GatePassPage.tsx - Event workflow → Event service: manages events
src/pages/EventDetailPage.tsx - Event workflow → Event rules: checks visibility
src/pages/EventDetailPage.tsx - Complaint workflow → Complaint service: manages complaints
README.md - Hall bookings → Service registry: uses bookings
- Latecomer tracking → Service registry: uses records
- Classroom directory → Service registry: uses rooms
- Campus administration → Service registry: manages users
- Operational reports → Service registry: reads operations
src/pages/ReportsPage.tsx - Notifications → Service registry: reads notifications
- Role dashboards → Reactive collection hook: loads summaries
src/pages/dashboard/DashboardPage.tsx - Reactive collection hook → Collection storage: lists and refreshes
src/hooks/useCollection.ts - Service registry → Collection storage: creates collections
src/services/index.ts - Service registry → Demo seed data: initializes from
src/services/index.ts - Collection storage → Browser localStorage: reads and writes
README.md - Event service → Service registry: notifies users
src/services/events.ts - Event service → Event rules: validates actions
src/services/events.ts - Event service → Date utilities: formats dates
src/services/events.ts - Complaint service → Complaint rules: applies rules
src/services/complaints.ts - Gate pass workflow → Permission rules: checks actions
src/pages/GatePassPage.tsx - Event workflow → Permission rules: checks actions
src/pages/EventDetailPage.tsx - Event workflow → Data table: renders participants
src/pages/EventDetailPage.tsx - Event workflow → Modal dialogs: opens dialogs
src/pages/EventDetailPage.tsx - Gate pass workflow → Data table: renders passes
src/pages/GatePassPage.tsx - App router → Shared UI components: uses interface
- Event service → Toast feedback: reports outcome
src/hooks/useEventAction.ts