How rafyhossain/classradar works
Purpose and Runtime
This is a client-side React application for a class/school dashboard experience: public landing content, authentication screens, and an authenticated dashboard with class schedule, announcements, and quick actions. It runs as a Vite SPA with React HMR/build tooling; no backend, API client, persistence layer, or external service integration is present in the tree.
Entry/bootstrap points:
• index.html
• src/main.jsx
• src/App.jsx
Application Shell and Routing
src/main.jsx mounts the React application, while src/App.jsx provides the top-level application shell. Route definitions are centralized in:
• src/routes/route.jsx
The router is the primary control boundary: it maps public/authenticated-facing page routes to page components and handles the unmatched route through:
• src/pages/NotFound.jsx
No server-side routing or authentication enforcement boundary is evident; auth pages are currently presentation-level routes.
Layout Segmentation
Layouts separate route families and own persistent page chrome:
• src/layouts/MainLayout.jsx
• src/layouts/AuthLayout.jsx
• src/layouts/DashboardLayout.jsx
MainLayout supports the public landing experience, AuthLayout frames login/register pages, and DashboardLayout establishes the dashboard navigation structure. Shared navigation and footer primitives live under:
• src/components/common/Navbar.jsx
• src/components/common/BottomNavbar.jsx
• src/components/common/Footer.jsx
This is the main composition boundary between route content and reusable application chrome.
Public and Authentication Experiences
The public entry experience is composed from focused landing sections:
• src/pages/Landing/LandingPage.jsx
• src/pages/Landing/sections/HeroSection.jsx
• src/pages/Landing/sections/FeaturesSection.jsx
Authentication is represented by distinct login and registration screens:
• src/pages/Auth/Login.jsx
• src/pages/Auth/Register.jsx
These pages do not have corresponding state management, API, token, or identity-provider modules in the repository, so they should be treated as UI flows until backend integration is added.
Dashboard Feature Composition
Dashboard routes provide the core product UI:
• src/pages/Dashboard/DashboardHome.jsx
• src/pages/Dashboard/Schedule.jsx
DashboardHome is assembled from domain-oriented cards for summary information, upcoming classes, announcements, and actions:
• src/components/dashboard/SummaryCard.jsx
• src/components/dashboard/UpcomingClassCard.jsx
• src/components/dashboard/RecentAnnouncements.jsx
The dashboard’s component layer is largely presentational and receives or embeds display data rather than querying a data source.
Schedule Data and Derived Status
The schedule feature has a local data boundary:
• src/constants/weeklySchedule.js
• src/pages/Dashboard/Schedule.jsx
Schedule rendering derives user-facing class state and time display through:
• src/utils/getClassStatus.js
• src/utils/formatTime.js
Thus, the current primary data flow is static schedule data → schedule page/card rendering → derived status/time labels. Replacing weeklySchedule.js with API-backed data is the natural integration point, while preserving these derivation utilities as view-model logic.
UI System and Styling
Reusable UI primitives form a lightweight design-system boundary:
• src/components/ui/button.jsx
• src/components/ui/navigation-menu.jsx
• src/components/ui/sheet.jsx
Shared layout primitives are in src/components/ui/Container.jsx and src/components/ui/Section.jsx. Global and app-level styling is handled by:
• src/index.css
• src/App.css
Utility class composition is centralized in src/lib/utils.js, supporting consistent styling behavior across component layers.
Main entry points: route.jsx Route definitions · button.jsx UI primitives · App.jsx Application shell · MainLayout.jsx Route family layouts
Components 18
Runtime
- Vite SPA · Client-side React development and build runtime.
index.html - React bootstrap
src/main.jsx
Application Structure
- Application shell
src/App.jsx - Route definitions · Primary control boundary for public, auth, and dashboard routes.
src/routes/route.jsx - Route family layouts · Public, auth, and dashboard chrome are segmented here.
src/layouts/MainLayout.jsx - Shared navigation and footer
src/components/common/Navbar.jsx
Route Experiences
- Landing experience · Composes public hero and feature sections.
src/pages/Landing/LandingPage.jsx - Landing sections · Hero and features content.
src/pages/Landing/sections/HeroSection.jsx - Login and registration · Presentation-only authentication flows.
src/pages/Auth/Login.jsx - Not found page
src/pages/NotFound.jsx
Dashboard Feature
- Dashboard home · Core class summary and activity view.
src/pages/Dashboard/DashboardHome.jsx - Dashboard cards · Summary, upcoming class, announcements, and action UI.
src/components/dashboard/SummaryCard.jsx - Schedule page · Renders local weekly classes with derived display state.
src/pages/Dashboard/Schedule.jsx - Weekly schedule · Natural replacement point for future API-backed schedule data.
src/constants/weeklySchedule.js - Schedule view-model utilities · Derives class status and formatted time labels.
src/utils/getClassStatus.js
UI System
- UI primitives · Buttons, navigation menus, sheets, containers, and sections.
src/components/ui/button.jsx - Global styles · App and global CSS foundation.
src/index.css - Class composition
src/lib/utils.js
Connections 20
- Vite SPA → React bootstrap: loads
- React bootstrap → Application shell: mounts
- Application shell → Route definitions: uses
- Route definitions → Route family layouts: selects layout
- Route definitions → Landing experience: public route
- Route definitions → Login and registration: auth routes
- Route definitions → Dashboard home: dashboard route
- Route definitions → Schedule page: schedule route
- Route definitions → Not found page: unmatched route
- Route family layouts → Shared navigation and footer: owns chrome
- Landing experience → Landing sections: composes
- Dashboard home → Dashboard cards: composes
- Weekly schedule → Schedule page: static classes
- Schedule view-model utilities → Schedule page: status and time labels
- UI primitives → Route family layouts: layout building blocks
- UI primitives → Landing experience: reusable controls
- UI primitives → Login and registration: reusable controls
- UI primitives → Dashboard home: reusable controls
- Class composition → UI primitives: composes classes
- Global styles → Application shell: global presentation