How khalidlh/fssm-new-app works
1. System type and runtime
- This is a Laravel monolith for managing university enrollment requests.
- The app is server-rendered with Blade views and uses Livewire for interactive multi-step forms and dashboards.
- Persistence is via Laravel’s database layer; the repo strongly implies a relational DB such as MySQL/MariaDB through the standard Laravel config/database.php setup.
2. Core business domain
- The central domain object is the demande (enrollment request).
- Around it are supporting entities for student identity, school background, requested program, uploaded documents, validation status, announcements, complaints, and reference data such as years, semesters, cities, countries, institutions, baccalaureate series/mentions, and demand types.
3. Main user-facing subsystems
- There are four distinct application areas:
- Étudiant: submits a request and tracks its status.
- Scolarité: handles requests from new baccalaureate students.
- Coordinateur de filière: reviews higher-education-related requests such as equivalence, transfer, and international cases.
- Administrateur: manages users, settings, announcements, and global reporting.
- Each area has its own layout and view set under resources/views/layout/... and corresponding controllers/components.
4. Request submission flow
- The student journey is driven by a multi-step registration/request form implemented with Livewire (app/Livewire/Forminscription.php and step views under resources/views/livewire/forminscription-parties).
- Input is validated by dedicated Laravel Form Requests such as UserRequest, InfopersonnelRequest, InfoscolaireRequest, AnneesRequest, and SemestresRequest.
- Submitted data is persisted into the users, demandes, and related profile/reference tables, with file uploads stored under Laravel’s storage layer.
5. Document and file handling boundary
- Supporting documents are first-class in the architecture:
- documents, documentfiles, and document_type_demandes model the file catalog and the per-demand attachments.
- The public storage directory is used for uploaded files, while the ImageController, DocumentdemandeController, and PDFDownlodController expose retrieval/export actions.
- This is a key boundary between the browser-facing form workflow and back-office validation workflows.
6. Validation and decision workflow
- Requests move through status states represented by models such as Etat_validation and the demand-specific status fields.
- Operational controllers are split by role:
- app/Http/Controllers/Coordonateur/* for faculty coordinators.
- app/Http/Controllers/Admin/* for administrative processing.
- Livewire dashboard components under app/Livewire/admin and app/Livewire/coordonateur provide filtered queues such as new requests, favorable requests, incomplete requests, and refusals.
7. Authentication and role boundaries
- Authentication is role-aware and enforced with custom middleware:
- loginadmin, logincoordonateur, loginscolarite, and loginuser.
- Additional middleware handles locale selection, registration date constraints, and UI behavior like statistics cookies.
- The repo also includes authorization policy support (AdminPolicy) and standard Laravel auth controllers for activation, password reset, and language switching.
8. Admin and coordination back office
- The admin area is not just CRUD; it acts as a supervisory control plane:
- user management, coordinator management, announcements, reclamation management, parameter/configuration screens, and exports.
- Coordinator and admin dashboards both rely on Livewire components and dedicated controllers/services, but operate on different subsets of the request pipeline and different permission scopes.
9. Service layer as business orchestration
- The app/Services directory is the main business-logic boundary between controllers/components and persistence.
- Notable service groups include:
- DemandeService and role-specific demand data services.
- ReclamationService for complaint handling.
- UserRegistrationService for onboarding and activation.
- GestionAdminsServive / GestionCoordonateursService for role management.
- This suggests the controllers are mostly thin orchestration layers, with the services doing the actual domain work.
10. Communication and notifications
- Email is used for activation, contact handling, password recovery, and demand-status updates via classes in app/Mail.
- The messages views indicate templated mail content for these notifications.
- This creates an asynchronous user-feedback loop around important state changes like account activation and request decisions.
11. Reporting and exports
- The app supports downloadable reports through export classes in app/Exports.
- There is explicit support for CSV/PDF-style administrative reporting in the README and controller/view structure.
- config/dompdf.php and the PDF controller indicate server-side document generation for printable request summaries or exports.
12. Reference data and seeding
- The application depends on a rich catalog of reference tables: filières, years, semesters, cities, countries, institutions, bac series/mentions, demand types, and validation states.
- Seeders populate this baseline data, which is important because the request forms and filtering logic depend on these lookup tables being present.
13. Front-end structure
- The UI is organized into multiple theme bundles under public/assets for homepage, admin, student, and form flows.
- The application is Blade-first, but the interactive request builder and dashboards rely on Livewire rather than a separate SPA frontend.
- resources/js/livewire-custom.js and vite.config.js suggest standard Laravel asset bundling.
14. Operational data flow in one line
- Browser request → role-based middleware/auth → controller or Livewire component → validation request/service layer → database + file storage → optional email/PDF/export side effect → updated dashboard/status views.
15. Architecture diagram boundaries to show
- A good diagram should separate:
- Presentation layer: public site, student portal, coordinator portal, admin portal.
- Application layer: controllers, Livewire components, services, requests, middleware.
- Domain/persistence layer: models, migrations, seeders, storage.
- Outbound services: email, PDF generation, exports/downloads.
- The key architectural concept is a role-separated monolith centered on the request lifecycle.
Main entry points: web.php Routes · DemandeService.php Services · InscriptionController.php Inscription · Forminscription.php Form wizard
Components 24
Presentation
Blade layouts, Livewire screens, and role-specific portals.
- Homepage · Public landing pages and announcement entry points.
resources/views/layout/layout-homepage/homepage.blade.php - Étudiant · Student-facing profile, validation, reclamation, and request tracking screens.
resources/views/layout/layout-etudiant/etudiant.blade.php - Request form · Multi-step enrollment request UI and step partials.
resources/views/livewire/forminscription.blade.php - Coordonateur · Coordinator dashboard and request review screens.
resources/views/layout/layout-cordonateur-filiere/coordonateur.blade.php - Admin portal · Administrative dashboard, user management, parameters, and reclamation screens.
resources/views/layout/layout-admin/admin.blade.php - Auth screens · Login, activation, password reset, and inscription views.
resources/views/layout/authentification/auth.blade.php
Application
Controllers, middleware, form requests, Livewire components, and services.
- Role gates · Role-aware login, locale, registration-date, and UI-state guards.
app/Http/Middleware/loginuser.php - Auth flow · Authentication, activation, language switching, and password recovery endpoints.
app/Http/Controllers/Auth/AuthentificationController.php - Inscription · Student registration and request submission orchestration.
app/Http/Controllers/InscriptionController.php - Admin ops · Admin request queues, users, announcements, parameters, and reclamations.
app/Http/Controllers/Admin/AdminController.php - Coord ops · Coordinator request processing endpoints.
app/Http/Controllers/Coordonateur/CoordonateurController.php - Form wizard · Interactive enrollment form wizard and step management.
app/Livewire/Forminscription.php - Dashboards · Filtered request queues and role dashboards for admin and coordinator.
app/Livewire/admin/Newdemande.php - Form requests · Dedicated Laravel request validators for student and school form steps.
app/Http/Requests/UserRequest.php - Services · Domain services for demandes, users, admins, coordinators, and reclamations.
app/Services/DemandeService.php
Domain
Core models, migrations, seeders, and stored documents.
- Models · Core entities for demandes, users, documents, validation states, and reference data.
app/Models/demande.php - Schema & seeds · Migrations and seeders for request lifecycle, lookup tables, and roles.
database/migrations/2024_03_26_135118_create_demandes_table.php - File storage · Persistent storage for demand attachments and generated assets.
storage/app/public/.gitignore
Outbound
Mail, PDF generation, exports, and file delivery.
- Mailers · Activation, contact, password reset, and demande-status email messages.
app/Mail/DemandeEtatMail.php - Exports & PDF · CSV/PDF exports and downloadable request summaries.
app/Exports/DemandesExport.php - Docs download · Document, image, and PDF retrieval/export endpoints.
app/Http/Controllers/DocumentdemandeController.php
Infrastructure
Routes, config, frontend assets, and framework bootstrap.
Connections 28
- Routes → Auth flow: auth endpoints
- Routes → Inscription: request flow
- Routes → Admin ops: admin routes
- Routes → Coord ops: coord routes
- Routes → Docs download: download routes
- Routes → Request form: livewire pages
- Role gates → Auth flow: gates access
- Auth screens → Auth flow: renders actions
- Request form → Form wizard: drives wizard
- Form wizard → Form requests: validates steps
- Form wizard → Services: persists request
- Inscription → Form requests: validates input
- Inscription → Services: orchestrates
- Admin ops → Dashboards: feeds queues
- Coord ops → Dashboards: reviews queues
- Services → Models: writes domain
- Models → Schema & seeds: schema mapping
- Schema & seeds → Config: database setup
- Services → File storage: stores uploads
- Docs download → File storage: serves files
- Services → Mailers: sends notifications
- Services → Exports & PDF: generates reports
- Admin portal → Admin ops: admin UI
- Coordonateur → Coord ops: coord UI
- Étudiant → Inscription: submits demandes
- Homepage → Routes: navigation
- Assets → Request form: styles ui
- Assets → Admin portal: styles ui