How ayaennaani-cmyk/auto-ecole-app-stage works
This is a single Laravel 11 monolith for driving-school operations, with a Blade/Tailwind/Alpine frontend and a MySQL-backed domain model. The app is organized around four operational roles: administrator, assistante, moniteur, and candidat.
1. Core application boundary
The backend is a standard Laravel HTTP application: requests enter through public/index.php, are routed via routes/web.php and routes/auth.php, then handled by feature controllers in app/Http/Controllers. The UI is server-rendered with Blade views in resources/views.
2. Authentication and account lifecycle
Authentication is built with the Laravel Breeze-style stack. The Auth controllers cover login, registration, password reset, password confirmation, and email verification. LoginRequest and the profile request classes handle validation, while auth views live under resources/views/auth. A login notification email is also part of the flow.
3. Role-based access control
The project uses a dedicated role model in app/Enums/UserRole.php, a custom CheckRole middleware, and policies for sensitive resources (PaiementPolicy, ReservationPolicy, UserPolicy). This forms the main security boundary: users are authenticated first, then authorized by role and policy before reaching admin, staff, or candidate features.
4. Main domain entities
The domain is centered on driving-school operations:
• User for all authenticated accounts
• Candidat and Moniteur as role-specific profiles
• Formation for training programs/pricing
• Seance for driving sessions
• Reservation for session booking
• Paiement for payments and invoices
• ResultatExamen for exam outcomes
• Message for contact/admin communication
These models are persisted in separate migrations, which indicates a normalized relational schema rather than a document or event-based design.
5. Role-specific workflows
Each role has its own dashboard and controller set. The admin can manage users, formations, and reporting. The assistante handles scheduling, reservations, and payment tracking. The moniteur views assigned sessions and candidate lists. The candidat books sessions, follows payments, and checks progress. The dashboard views are split accordingly under resources/views/dashboard/*.
6. Reservation and planning flow
A key business flow is the scheduling pipeline: sessions are created and managed by staff, candidates reserve available sessions, and reservations are validated/monitored by admin or assistante. SeanceController and ReservationController are the main orchestration points, with separate admin-oriented and candidate-oriented views showing that the same data is presented differently by role.
7. Payment and billing flow
Payments are a separate subsystem with their own controller, policy, form views, success view, and invoice/PDF templates. The presence of facture.blade.php and pdf.blade.php suggests billing output is generated from server-side views. Candidates have a dedicated payment index, while staff likely manage or verify payment records.
8. Public-facing and contact surfaces
The app includes public pages such as welcome, apropos, and contact, handled by PublicController and ContactController. This is the external entry point for anonymous visitors before authentication, distinct from the authenticated dashboard area.
9. Reporting and export subsystem
Several modules include PDF views: users, sessions, payments, and formations. This indicates a reporting/export layer built from Blade templates rather than a separate reporting service. The admin experience likely depends on these exports for operational summaries and printable records.
10. Mail and notification boundary
There is a dedicated mail class for login notifications. This means the app emits transactional email as part of user activity, probably after authentication or account-related events. Mail transport settings are isolated in config/mail.php, so email is an external integration point, not embedded in domain logic.
11. Frontend and asset pipeline
The UI is traditional Blade rendering enhanced by Tailwind CSS and Alpine.js, with assets managed through Vite. The frontend is not a SPA; it is a multi-page server-rendered app with reusable Blade components and layout shells for app, guest, and public views.
12. Seeded operational data and setup
The repository includes migrations, seeders for formations and sessions, and a helper script create_db.php. This suggests the application expects prepopulated operational data for local/demo use, especially the role-based dashboards and test accounts listed in the README.
Overall architecture: a layered Laravel MVC application with role-aware access control, a shared relational domain model, server-rendered dashboards, and auxiliary flows for booking, payment, email, and PDF generation.
Main entry points: UserController.php Ops controllers · web.php Web routes · User.php User · Seance.php Operations
Components 21
HTTP & UI
Laravel entrypoints, routing, controllers, views, and frontend assets.
- Entry point · Web server entry into the Laravel application.
public/index.php - Web routes · Authenticated and public browser routes.
routes/web.php - Public pages · Public-facing pages and contact handling.
app/Http/Controllers/PublicController.php - Dashboard · Role-aware dashboard entry and summaries.
app/Http/Controllers/DashboardController.php - Ops controllers · Main feature controllers for users, formations, sessions, reservations, payments, exams, and messages.
app/Http/Controllers/UserController.php - Role dashboards · Admin, assistante, moniteur, and candidat dashboard views.
resources/views/dashboard/admin.blade.php - Business views · Blade screens for formations, reservations, payments, sessions, users, and messages.
resources/views/paiements/index.blade.php - Auth & public UI · Guest, auth, layout, and public-facing Blade views.
resources/views/welcome.blade.php - Frontend stack · Server-rendered UI styling and interactivity pipeline.
resources/js/app.js
Domain
Core driving-school entities and business rules.
- User · Authenticated account record.
app/Models/User.php - Profiles · Role-specific identity records for candidates and instructors.
app/Models/Candidat.php - Formation · Training programs and pricing.
app/Models/Formation.php - Operations · Scheduling, booking, payment, exam, and message records.
app/Models/Seance.php
Security
Authentication, roles, middleware, policies, and notifications.
- Auth routes · Login, registration, reset, and verification routes.
routes/auth.php - Auth flow · Login, registration, password reset, and email verification.
app/Http/Controllers/Auth/AuthenticatedSessionController.php - Role gate · Custom middleware enforcing role-based access.
app/Http/Middleware/CheckRole.php - User roles · Application role model for administrator, assistante, moniteur, and candidat.
app/Enums/UserRole.php - Policies · Resource-level authorization for users, reservations, and payments.
app/Policies/PaiementPolicy.php - Login mail · Transactional notification sent during login or account activity.
app/Mail/LoginNotificationMail.php
Data & Ops
Migrations, seeders, config, and deployment/runtime wiring.
Connections 28
- Entry point → Web routes: dispatches · Incoming web requests are routed through the web route file.
- Web routes → Public pages: public pages · Routes expose public pages and contact endpoints.
- Web routes → Dashboard: dashboards · Routes expose role-specific dashboards.
- Web routes → Ops controllers: features · Routes dispatch to the main business controllers.
- Web routes → Role gate: protects · Role checks guard privileged sections.
- Auth routes → Auth flow: auth actions · Auth routes map to login and account lifecycle controllers.
- Auth flow → User: authenticates · Auth actions operate on user accounts.
- Auth flow → Login mail: notifies · Transactional email is part of account or login flow.
- Role gate → User roles: uses · Middleware evaluates the role enum.
- Policies → User: authorizes · User policy governs account access and actions.
- Policies → Operations: authorizes · Reservation and payment policies protect operational records.
- Ops controllers → User: manages · User administration and profile management.
- Ops controllers → Profiles: uses · Controllers work with candidate and instructor profiles.
- Ops controllers → Formation: manages · Training programs are created and edited here.
- Ops controllers → Operations: orchestrates · Scheduling, reservations, payments, exams, and messages flow through these controllers.
- Ops controllers → Policies: checks · Sensitive operations are policy-protected.
- User → Schema: schema · Users are defined in the relational schema.
- Profiles → Schema: schema · Profile tables are created in migrations.
- Formation → Schema: schema · Formation records are backed by migrations.
- Operations → Schema: schema · Operational tables for seances, reservations, payments, results, and messages.
- Seed data → Formation: seeds · Seeders populate formation data.
- Seed data → Operations: seeds · Seeders populate session data.
- Auth & public UI → Frontend stack: renders with · Guest, auth, and public screens are styled by the shared frontend stack.
- Role dashboards → Frontend stack: renders with · Dashboard screens use the shared Blade/Tailwind stack.
- Business views → Frontend stack: renders with · Operational screens use the shared Blade/Tailwind stack.
- Public pages → Auth & public UI: returns · Public controllers render public and contact views.
- Dashboard → Role dashboards: returns · Dashboard controller renders role-specific dashboards.
- Ops controllers → Business views: returns · Business controllers render operational views and PDFs.