How arzak21st/role-manager works
Project Type and Purpose
• This is a monolithic, server-rendered full-stack web application built with Spring Boot.
• It provides role-based access control (RBAC) to manage user permissions (create, read, update, delete).
Key Components
a. Client Layer
• Web Browser: interacts over HTTP/HTTPS.
• Static Assets: CSS/JS/Images under src/main/resources/static/stisla*.
b. Web/Application Layer
• Spring MVC DispatcherServlet: entry point for all HTTP requests.
• Controllers (HomeController, LoginController, ManagerController): map URLs to actions.
c. Security Layer
• Spring Security Filter Chain (SecurityConfiguration): intercepts requests for authentication/authorization.
• MyUserDetailsService / MyUserDetails: loads user roles from database into Spring Security.
d. Service Layer
• HomeService, ManagerService: business logic, orchestrate between controllers and repositories.
e. Data Access Layer
• Spring Data JPA Repositories (UserRepository, RoleRepository): CRUD operations on User and Role entities.
f. Persistence Layer
• Relational Database (configured in application.properties): stores users & roles.
g. View Layer
• Thymeleaf Templates (home.html, login.html, manager.html): generate HTML.
Interactions and Data Flow
1. Browser → HTTP Request → DispatcherServlet
2. Security Filter Chain checks authentication/authorization
3. DispatcherServlet routes to appropriate Controller
4. Controller calls Service
5. Service calls Repository → Database
6. Service returns data to Controller
7. Controller selects Thymeleaf view + model data
8. DispatcherServlet returns rendered HTML + static assets → Browser
Architectural Patterns & Principles
• Layered (Web → Security → Controller → Service → Repository → DB)
• Separation of Concerns: distinct packages for models, controllers, services, repositories, security.
• Convention over Configuration: Spring Boot auto-configures MVC, JPA, Security.
• Template-based UI: No single-page-app framework; uses server-side rendering with Stisla theme.
Detailed Element Checklist
• Clear labels: e.g., “HomeController”, “ManagerService”, “RoleRepository”.
• Annotations: note “session-based auth” or “JWT (if used)”—here it’s form login with roles.
• External dependencies: Maven wrapper (.mvn/wrapper), but this can be omitted or shown as “Build Tool: Maven”.