Spring Boot Layers
The essencium-backend in a Spring Boot project encapsulates a multi-layered architecture that organizes the application into several logical components. These layers promote separation of concerns and modular design, leading to more maintainable and scalable applications.
configuration
The configuration layer is not really a full application layer. It contains some default configurations (web security, scheduling, password strength, LDAP and OAuth2 configurations, …) as well as some default initializers that ensure that users, roles, rights and translations are loaded correctly at application startup. Most of these configurations and initializers can be extended on the application side to meet individual project requirements.
controller
The controller layer is responsible for processing incoming HTTP requests and returning responses. It is the entry point for client requests and delegates the requests to lower layers (service layer) for processing. User requests are also checked in the controller layer on the basis of a role and rights concept. Essencium offers ready-made implementations for processing user, role, rights and translation entities. Various abstract controller implementations are also available, which make it easier to set up additional controllers. Complex authorization concepts can be implemented quickly and clearly using Essencium’s own annotations.
model
The model level represents the domain objects or entities in the application. These are the classes that are mapped to the database and define the structure of the data that the application will process. By using DTOs (Data Transfer Objects) for inbound and outbound data transfer, Essencium makes it possible to use your own representations and thus, for example, validate incoming data or enrich outgoing data with additional information.
repository
The repository layer is responsible for providing a mechanism to perform database operations (usually CRUD operations, CRUD = create, read, update, delete). Essencium backend uses Spring Data JPA to provide an interface to the database. All major relational database systems are supported.
security
The security package contains a variety of configurations relating to authentication and authorization. The handling of JWT refresh and access tokens as well as the connection of external authentication providers such as LDAP or OAuth providers are defined here.
service
The service layer contains the business logic of the application. It processes requests from the controller, interacts with the repository layer to persist data and handles the linking and enrichment of data.
util
The util (or utility) layer typically contains various utility classes and helper functions that are used throughout the application. In Essencium, auxiliary functions for validating content, stream processing and processing configuration files can be found in the util package.
This layered structure of the essencium-backend follows the typical architecture of a Spring Boot application, promoting good design principles like separation of concerns and modular design, making the application easier to develop, maintain, and scale.