This PR addresses issues #23#24#25 and #26 and rearranges the component library
Reviewed-on: #62
Reviewed-by: Jacob Reinikainen Lindström <jacob@dsv.su.se>
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: nenzen <nenzen@dsv.su.se>
Co-committed-by: nenzen <nenzen@dsv.su.se>
This PR adds Checkstyle and Prettier configuration to BFF. It also adds a gitea action to run these.
Reviewed-on: #65
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: nenzen <nenzen@dsv.su.se>
Co-committed-by: nenzen <nenzen@dsv.su.se>
This PR
- Reorganizes BFF codebase into a cleaner layered architecture with separate packages for config, controller, dto/response, and service
- Upgrades Spring Boot from 3.4.4 to 4.0.1 (includes Spring Security 7 and Jackson 3)
- Enables CSRF protection for the SPA frontend
- Adds Accept-Language header support in frontend
Package restructuring:
- Move configuration classes (BackendApiConfiguration, FrontendConfiguration) to bff.config
- Move controllers (ProfileController, TestController) to bff.controller
- Move DTOs to bff.dto.response and rename Profile to ProfileResponse
- Extract ProfileService into new bff.service package
- Extract security configuration from main class into dedicated SecurityConfiguration
Security improvements:
- Enable CSRF protection with csrf.spa() for Single Page Application support
- Add PUT and DELETE to allowed CORS methods
- Add X-XSRF-TOKEN to allowed headers
Frontend middleware:
- Add includeCsrfToken middleware to automatically include CSRF tokens in POST/PUT/DELETE requests
- Add includeAcceptLanguage middleware to send browser language preferences (uses navigator language before profile is fetched)
Other:
- Minor code formatting improvements (checkstyle will be separate PR)
Reviewed-on: #64
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: nenzen <nenzen@dsv.su.se>
Co-committed-by: nenzen <nenzen@dsv.su.se>
Reviewed-on: #12
Reviewed-by: Stefan Nenzén <nenzen@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
It's a standard Spring Boot web application so far. Has automatic OpenTelemetry tracing to help debug and spot potential performance issues. Uses [Apimposter](https://gitea.dsv.su.se/DMC/apimposter) to mock out backend API dependencies.
Reviewed-on: #1
Reviewed-by: Stefan Nenzén <nenzen@dsv.su.se>