How mehdilaghrissi/gestion_des_notifications_clients works
Project Type and Purpose
• This is a full-stack notification management system (“Système de Gestion des Notifications Clients”) comprising:
• Frontend: Angular 17 SPA for user interface (port 4200).
• Backend: Spring Boot 3.5.3 REST API (port 8080).
• Database: MySQL 8.0 as persistent storage.
• Purpose: centralize and automate multi-channel client notifications (Email, SMS, physical mail, calls, web) with templating, scheduling, bulk imports, PDF generation, and real-time dashboards.
File Structure Analysis
• Top-level:
• notif_backend/ — Spring Boot service
• notification/ — Angular application
• README.md
• Backend layers (src/main/java/com/example/notif_backend):
• controller/ — REST endpoints
• service/ — business logic (including factory for multi-channel senders, PDF, email, scheduler)
• repository/ — Spring Data JPA interfaces
• model/ — JPA entities
• dto/ — request/response payloads
• config/, util/ — CORS setup, template engine
• resources/db/migration/ — Flyway SQL scripts
• Frontend structure (per README; not shown in file tree):
• src/app/pages/ — UI views
• src/app/services/ — HTTP + domain services
• src/app/models/ — TypeScript interfaces
• Deployment/config files:
• application.properties / application.yaml
• environment.ts (frontend)
• pom.xml, angular.json, package.json
README Insights
• Tech stack and design patterns: Factory, Dependency Injection, Repository, DTO, Scheduler, PDF engine, CORS.
• Workflow: template creation → recipient import → notification crafting → grouped send → scheduling → dashboard.
a. Main Components
1. Angular Frontend
2. Spring Boot Backend
• REST Controllers
• Service Layer (Email/SMS/PDF/Scheduler)
• Repository Layer
• Template Engine Utility
3. MySQL Database
4. External Services
• SMTP Server (Email)
• SMS Gateway
• PDF Generation (Flying Saucer)
b. Relationships & Data Flows
• User actions in Angular → HTTP(S) JSON calls to Backend /api endpoints.
• Controllers delegate to Services → Services invoke Repositories (JPA/Hibernate) → SQL queries to MySQL.
• Scheduler component in backend polls pending jobs and triggers Service factories to send via appropriate channel.
• PDF Service calls template engine → Flying Saucer → generates PDF stored or returned.
• Backend pushes status updates to Dashboard (polled or WebSocket).
• Import CSV/JSON files uploaded to backend (uploads folder), parsed by Service → persisted.
c. Architectural Patterns
• Layered (Controller → Service → Repository)
• Factory Pattern for EnvoiSender (multi-canal)
• DTO for decoupling API payloads from internal entities
• Scheduler as asynchronous job runner
• CORS Config for frontend-backend security
d. Technologies & Frameworks
• Angular, RxJS, PrimeNG
• Spring Boot, Spring Data JPA, Spring Security, Spring Scheduler
• Flyway for DB migration; MySQL 8.0
• JavaMailSender, Flying Saucer