How koventhanventhan/tit works
1. Purpose and deployable shape
This is a multi-tenant education-management SaaS: public marketing/registration plus role-specific student, teacher/admin, and super-admin portals. It combines a React/Vite SPA with a Laravel API/admin backend.
• Frontend bootstrap: src/main.jsx, src/App.jsx
• Laravel HTTP bootstrap and route surfaces: backend/public/index.php, backend/routes/api.php, backend/routes/web.php
• Container/deployment artifacts: Dockerfile.frontend, backend/Dockerfile, railway.json
2. Frontend application shell and role portals
The React app owns client routing, public pages, authentication presentation, settings/language context, and dashboard layouts. It separates role experiences rather than being only a marketing site.
• App shell/context: src/App.jsx, src/context/AuthModalContext.jsx, src/context/SettingsContext.jsx
• Student UI: src/components/student/StudentDashboardLayout.jsx, src/pages/student/StudentOverview.jsx
• Teacher/admin and platform UI: src/components/teacher/TeacherDashboardLayout.jsx, src/pages/admin/AdminOverview.jsx, src/pages/super-admin/SuperAdminOverview.jsx
3. API boundary, identity, and tenancy
Laravel controllers expose the application boundary for SPA clients. Authentication and access are constrained by role, registration state/session timeout, and institute tenancy; tenant scoping is also modeled at ORM level.
• Auth/registration endpoints: backend/app/Http/Controllers/AuthController.php, backend/app/Http/Controllers/RegistrationController.php
• Authorization/tenant boundary: backend/app/Http/Middleware/RoleMiddleware.php, backend/app/Http/Middleware/TenantMiddleware.php, backend/app/Scopes/InstituteScope.php
• Principal model and tenant association trait: backend/app/Models/User.php, backend/app/Models/Institute.php, backend/app/Traits/BelongsToInstitute.php
4. Core academic operations
The primary application flow is institute users managing students, teachers, subjects, teaching materials, assignments/submissions, attendance, timetables, Zoom sessions, and exam results. Role-specific API controllers feed corresponding React dashboards.
• Academic records: backend/app/Models/Assignment.php, backend/app/Models/AssignmentSubmission.php, backend/app/Models/LearningMaterial.php
• Scheduling/class delivery: backend/app/Models/Timetable.php, backend/app/Models/ZoomSchedule.php, backend/app/Models/Attendance.php
• Role APIs: backend/app/Http/Controllers/Api/StudentDashboardController.php, backend/app/Http/Controllers/Api/TeacherDashboardController.php, backend/app/Http/Controllers/Api/ExamResultController.php
5. SaaS administration, subscriptions, and payments
Super-admin functionality manages institutes, subscription plans, coupons, payments, activity visibility, announcements, and platform settings. Institute lifecycle and payment state likely gate tenant access through the shared identity/registration layer.
• Commercial domain: backend/app/Models/SubscriptionPlan.php, backend/app/Models/Payment.php, backend/app/Models/Coupon.php
• Service layer: backend/app/Services/SubscriptionService.php, backend/app/Services/PayHereService.php
• Filament platform back office: backend/app/Providers/Filament/SuperAdminPanelProvider.php, backend/app/Filament/SuperAdmin/Resources/InstituteResource.php, backend/app/Filament/SuperAdmin/Resources/PaymentResource.php
6. Communication and external integrations
The backend integrates payment processing, Zoom scheduling/synchronization, WhatsApp, Gemini translation, email notifications, and Laravel broadcasting. These sit behind services and are invoked through controllers, events, or scheduled commands.
• Integration services: backend/app/Services/ZoomService.php, backend/app/Services/WhatsAppService.php, backend/app/Services/GeminiTranslationService.php
• Notifications/realtime: backend/app/Events/NewMessageEvent.php, backend/app/Services/NotificationService.php, src/services/echo.js
• Recurring integration work: backend/app/Console/Commands/CheckPayments.php, backend/app/Console/Commands/SyncTimetableToZoom.php, backend/app/Console/Commands/SendZoomReminders.php
7. Persistence and operational boundaries
Laravel migrations define a relational persistence model spanning users, tenant ownership, academic entities, payments, notifications, and queued jobs. Uploaded learning assets are served from backend public storage paths. PHP/Laravel runs behind Nginx in Docker; the SPA is independently built and served.
• Schema evolution: backend/database/migrations/2026_02_07_053609_create_institutes_and_plans_tables.php, backend/database/migrations/2026_02_07_053611_add_institute_id_to_existing_tables.php
• Files/assets: backend/public/uploads, backend/config/filesystems.php
• Runtime web-server wiring: backend/docker/nginx.conf, nginx.frontend.conf.template, frontend_entrypoint.sh
The teste_herd/ and tit_website/ trees appear to be standalone minimal Laravel scaffolds, not part of the primary product runtime.
Main entry points: api.php API route surface · Assignment.php Academic operations · SubscriptionService.php Subscriptions & payments · App.jsx App shell & contexts
Components 19
React SPA
Public registration and role-specific portals.
- SPA bootstrap
src/main.jsx - App shell & contexts · Owns routing, auth presentation, settings, and language state.
src/App.jsx - Student portal
src/components/student/StudentDashboardLayout.jsx - Teacher, admin & super-admin portals
src/components/teacher/TeacherDashboardLayout.jsx - SPA runtime · Independently builds and serves the React application.
Dockerfile.frontend
Laravel application
API, tenancy, academic operations, and SaaS administration.
- API route surface · SPA-facing application endpoint boundary.
backend/routes/api.php - Auth & registration
backend/app/Http/Controllers/AuthController.php - Role & tenant enforcement · Constrains requests by role, registration state, and institute.
backend/app/Http/Middleware/RoleMiddleware.php - Users & institutes · Institute association is the tenancy root.
backend/app/Models/User.php - Academic role APIs · Serves student, teacher, and exam-result dashboard data.
backend/app/Http/Controllers/Api/StudentDashboardController.php - Academic operations · Assignments, materials, attendance, timetables, Zoom schedules, and results.
backend/app/Models/Assignment.php - Subscriptions & payments · Manages plan lifecycle and PayHere payment processing.
backend/app/Services/SubscriptionService.php - Platform back office · Super-admin manages institutes and payments.
backend/app/Providers/Filament/SuperAdminPanelProvider.php - Relational database · Stores tenants, academic records, payments, notifications, and jobs.
backend/database/migrations/2026_02_07_053609_create_institutes_and_plans_tables.php - Learning asset storage
backend/public/uploads - Laravel web runtime · Serves Laravel behind Nginx in Docker.
backend/docker/nginx.conf
Integrations & operations
External services and recurring backend work.
- Notifications & realtime · Broadcasts new messages and delivers notifications.
backend/app/Events/NewMessageEvent.php - External service adapters · Zoom, WhatsApp, Gemini translation, and PayHere integrations.
backend/app/Services/ZoomService.php - Scheduled integration jobs · Checks payments, syncs timetables to Zoom, and sends reminders.
backend/app/Console/Commands/SyncTimetableToZoom.php
Connections 22
- SPA bootstrap → App shell & contexts: mounts
- App shell & contexts → Student portal: routes to
- App shell & contexts → Teacher, admin & super-admin portals: routes to
- Student portal → API route surface: uses
- Teacher, admin & super-admin portals → API route surface: uses
- API route surface → Auth & registration: auth endpoints
- API route surface → Role & tenant enforcement: guarded by
- Role & tenant enforcement → Users & institutes: resolves tenant
- API route surface → Academic role APIs: dispatches
- Academic role APIs → Academic operations: manages
- Academic operations → Relational database: persists
- Academic operations → Learning asset storage: stores learning assets
- Auth & registration → Subscriptions & payments: applies access lifecycle
- Subscriptions & payments → Relational database: records plans and payments
- Platform back office → Users & institutes: manages institutes
- Platform back office → Subscriptions & payments: administers
- Academic operations → External service adapters: schedules Zoom
- Scheduled integration jobs → External service adapters: runs syncs and reminders
- Scheduled integration jobs → Subscriptions & payments: checks payments
- Academic role APIs → Notifications & realtime: emits updates
- SPA runtime → SPA bootstrap: builds and serves
- Laravel web runtime → API route surface: serves