How jeetpitale/classflow works
1. Overall shape: ClassFlow is a two-tier LMS with a React/Vite frontend and a PHP/MySQL backend. The frontend is a single-page app for student, teacher, and admin roles; the backend exposes a REST-style API and owns persistence, authentication, uploads, and notification logic.
2. Frontend shell: src/main.jsx boots the app, src/App.jsx wires routing, and src/pages/* contains the role-specific screens. The UI is built from shared components in src/components/*, especially the dashboard layout shell (DashboardLayout, Header, Sidebar) plus many reusable shadcn/radix-style primitives.
3. Role-based application areas: The page structure is strongly partitioned by user type:
- src/pages/student/* for dashboards, quizzes, assignments, materials, marks, startup, schedule
- src/pages/teacher/* for dashboards, quizzes, assignments, syllabus, materials, feedback
- src/pages/admin/* for dashboards, announcements, performance, schedules, startups, syllabus tracking, user management
This is a clear architectural boundary for authorization and navigation.
4. Frontend state and API access: src/contexts/AuthContext.jsx centralizes authentication state, while src/services/api.js is the main HTTP boundary to the backend. The frontend also includes lightweight utility layers such as src/hooks/*, src/lib/utils.js, and src/types/*. React Query is mentioned in the README, so the app likely treats server data as cached remote state rather than local application state.
5. Backend entry and request flow: The backend is organized as a classic PHP API with backend/index.php as the entry point, then controller classes in backend/controllers/*, domain models in backend/models/*, and shared utilities in backend/utils/*. Requests flow from the browser to the API endpoint, through a controller, into a model/database operation, and then back as standardized JSON responses.
6. Backend domain modules: The codebase is split by business capability rather than generic CRUD:
- AuthController, ProfileController, DashboardController
- content and learning modules: AnnouncementController, AssignmentController, MaterialController, QuizController, SyllabusController
- role/admin management: StudentController, TeacherController, StartupController
- messaging/alerts: NotificationController
Matching model classes mirror those domains, which makes the backend fairly modular.
7. Security and cross-cutting services: backend/utils/JWTHandler.php suggests token-based auth, RateLimiter.php adds API throttling, and Response.php likely standardizes API payloads and error handling. NotificationHelper.php encapsulates notification generation/publishing logic, so notifications are treated as a shared service rather than duplicated in each controller.
8. Data layer: Persistence is MySQL, configured in backend/config/database.php with environment-driven settings and optional SSL CA support (backend/config/certs/*). Schema evolution is handled through SQL scripts in backend/database/* plus additional migrations in backend/migrations/*, indicating the project uses direct SQL migrations rather than a heavyweight ORM.
9. File and artifact storage: User-generated content is stored outside the database in upload directories such as backend/uploads/ and top-level uploads/, with subfolders for assignments and profiles. This is an important boundary: the DB tracks metadata, while physical files live on disk and are served separately.
10. Deployment/runtime concerns: The repository contains multiple hosting artifacts: backend/nginx.conf, backend/.htaccess, backend/startup.sh, backend/.azure/config, .github/workflows/*, and vercel.json. That suggests the app can be deployed with a PHP server behind Nginx/Apache, with CI/CD automation and Azure-related configuration for the backend, while the frontend is built and served as a static Vite app.
11. Operational configuration: The README and file tree show environment-sensitive setup for local vs production endpoints. The frontend points at an API base URL in src/services/api.js, and the backend reads DB and SSL settings from env/config files, so the architecture expects the frontend and backend to be independently deployable and configurable.
12. Primary end-to-end flow: A typical interaction is: user signs in through the React app → auth state is stored in the frontend context → the app calls the PHP API via api.js → controller validates/authorizes via JWT/rate limiting → model reads/writes MySQL and possibly stores files → the API returns JSON → the frontend renders role-specific dashboard and list/detail views.
Main entry points: App.jsx Router · controllers Controllers · api.js API Client · models Models
Components 19
Frontend
React/Vite single-page app and shared UI
- Entry · Bootstraps the React app
src/main.jsx - Router · Wires top-level routing and app structure
src/App.jsx - Auth State · Centralizes login state and user session
src/contexts/AuthContext.jsx - API Client · Primary frontend wrapper for backend requests
src/services/api.js - Dashboard Shell · Shared dashboard chrome for role-based screens
src/components/layout/DashboardLayout.jsx - Student Area · Student dashboards, learning, and assessments
src/pages/student - Teacher Area · Teacher dashboards, content, and grading tools
src/pages/teacher - Admin Area · Admin dashboards, governance, and management screens
src/pages/admin - UI Primitives · Reusable forms, tables, dialogs, and other shared widgets
src/components/ui
Backend
PHP API, persistence, and domain logic
- API Entry · Main backend request entry point
backend/index.php - Controllers · Request handlers organized by domain
backend/controllers - Models · Persistence-facing domain objects
backend/models - Core Utils · Auth, responses, throttling, and notification helpers
backend/utils - DB Config · Environment-driven database connection settings
backend/config/database.php - Schema/Migrations · Database schema and incremental SQL changes
backend/database - File Storage · On-disk uploads for assignments and profiles
backend/uploads
Deployment
Hosting, CI, and runtime configuration
- Deploy Config · Nginx, Apache, startup, and cloud deployment files
backend/nginx.conf - CI/CD · GitHub Actions and hosting configuration
.github/workflows/main_classflow-backend-jeet.yml - Static Build · Frontend build and static hosting configuration
vercel.json
Connections 21
- Entry → Router: starts · Application bootstraps routing and UI shell
- Router → Auth State: uses · Routes and screens depend on auth state
- Router → Dashboard Shell: wraps · Role pages render inside shared dashboard shell
- Router → Student Area: routes · Student screens are mounted through app routing
- Router → Teacher Area: routes · Teacher screens are mounted through app routing
- Router → Admin Area: routes · Admin screens are mounted through app routing
- Student Area → API Client: fetches · Student features load remote data through the API client
- Teacher Area → API Client: fetches · Teacher features load remote data through the API client
- Admin Area → API Client: fetches · Admin features load remote data through the API client
- Dashboard Shell → UI Primitives: composes · Shell is built from shared UI primitives
- API Client → API Entry: calls · Frontend requests hit the PHP API entry point
- API Entry → Controllers: dispatches · Requests are routed to domain controllers
- Controllers → Core Utils: uses · Controllers rely on auth, response, and throttling helpers
- Controllers → Models: persists · Controllers delegate domain reads and writes to models
- Models → DB Config: connects · Models use the configured MySQL connection
- Models → Schema/Migrations: migrated by · Database structure is defined by SQL schema and migration scripts
- Controllers → File Storage: stores files · Content controllers write uploaded artifacts to disk
- Core Utils → File Storage: references · Shared helpers may coordinate file-related notifications or paths
- Deploy Config → API Entry: serves · Runtime config hosts the backend API
- CI/CD → Deploy Config: deploys · Workflow and cloud config automate backend delivery
- Static Build → Router: serves · Static frontend build serves the React app