How anagonbu/tfg_daw_shiftmanager works
Project Type & Purpose
• This is a full‑stack web application (“TFG_DAW_ShiftManager”) composed of:
• An Angular frontend (calendar UI, forms, components)
• A Spring Boot backend (REST API, service layer, JPA repositories)
• A relational database (SQL scripts in BackEnd/BBDD)
• Purpose: let employees and admins view/modify work shifts, swap turns, calculate hours, enforce roles.
File Structure
• FrontEnd: Angular CLI app under FrontEnd/src/app
• Components, pages, services, validators
• Third‑party libs: FullCalendar, SweetAlert2, RxJS
• BackEnd: Spring Boot under BackEnd/shift_manager/src
• restcontroller packages expose endpoints
• service packages handle business logic
• repository packages handle data access via Spring Data JPA
• entity classes map to DB tables
• SQL scripts in BackEnd/BBDD initialize schema and test data
• Deployment: Despliegue contains deployment instructions.
Core Architectural Patterns
• MVC (Controller → Service → Repository)
• Layered separation: Presentation (Angular) → API layer → Business layer → Data layer
• Role‑based access (user vs. admin), stateless HTTP requests
Main Components & Their Interactions
• User’s Browser (Angular UI)
↔ (HTTP/JSON)
• Spring Boot REST API
• Controllers handle incoming requests
• Services implement business rules (shift swapping, hour calculation)
• Repositories perform CRUD operations on the DB
• Relational DB (MySQL/PostgreSQL…)
• Optional: Deployment Server / CI‑CD (per Despliegue instructions)
a. Components
• Browser / Angular App
• REST API Gateway (Spring Boot)
• Business Services
• Data Repositories
• Database
• External libraries (FullCalendar, SweetAlert2) – annotate in UI layer
b. Relationships & Data Flow
• Browser sends HTTP calls to REST endpoints (/empleados, /grupos, /cambios, etc.)
• Controllers delegate to Services
• Services call Repositories
• Repositories execute SQL on the Database
• Database returns result sets → map to Entities → DTOs → JSON → Browser
c. Architectural Patterns
• MVC layers inside the backend
• RESTful API design
• Client‑side component hierarchy (pages, shared services, validators)
d. Key Technologies
• Angular (TypeScript)
• Spring Boot, Spring Data JPA
• JPA Entities, DTO mapping
• Relational DB (SQL scripts)
• Maven build