How quasar-30/gestiondossiermedicalanimal-v1 works
Project Type and Purpose
• This is a full-stack monorepo containing:
• A Spring Boot backend (“gestionAnimaux”) exposing a JWT-secured REST API plus a WebSocket chat channel.
• A Flutter mobile frontend (“MonVeto”) for Android/Windows, used by two user roles (Propriétaire & Vétérinaire).
• Purpose: manage animal medical records, appointments, real-time chat, and push-style notifications.
File-Structure Highlights
• Top-level directories: BACKEND/gestionAnimaux and FRONTEND/MonVeto.
• Backend layers:
• controllers/ – REST endpoints
• service/ – business logic
• repository/ – Spring Data JPA / MySQL
• security/ – JWT auth, filters, WebSocket config
• Frontend layers:
• lib/models – DTOs mirroring backend entities
• lib/services – HTTP client wrappers
• lib/constants – API URLs, interceptors
• lib/screens – UI pages
• Deployment/config: Docker Compose for backend+MySQL, Maven wrapper, Flutter pubspec.
Key Architectural Patterns
• Layered (n-tier) Architecture in backend: Controllers → Services → Repositories → Database.
• JWT Authentication securing HTTP and WebSocket endpoints.
• WebSocket channel for real-time chat (ChatWebSocket).
• Flutter client-server pattern: UI screens call services via HTTP/WebSocket, map JSON ↔ Dart models.
Main Components to Illustrate
A. Flutter Mobile Client
• Screens/UI
• Services layer (HTTP client + AuthInterceptor)
• WebSocket client for chat
• Local storage (shared_preferences)
B. API Gateway / Load Balancer (optional for production)
C. Spring Boot Application
• REST Controllers (AnimalController, AuthController, …)
• Service Layer (AnimauxService, NotificationService, …)
• Repository Layer (Spring Data JPA interfaces)
• Security Layer (JwtUtil, AuthTokenFilter, WebSecurityConfig)
• WebSocket Config & Endpoint
D. MySQL Database (schema.sql)
E. Docker Compose environment ensuring backend + DB startup
Relationships & Data Flows
• Flutter → HTTP(S) → Spring Boot REST Controllers → Services → Repositories → MySQL
• Flutter → WebSocket → Spring Boot ChatWebSocket → broadcast subscribers
• JWT flow: Login → AuthController issues token → AuthInterceptor adds token to each request → WebSecurityConfig validates token
• Notifications: backend schedules reminders (e.g., via @Scheduled) → push via WebSocket or FCM (if integrated)
• Data-model consistency: DTO mapping between Entities ↔ Controllers ↔ Clients