How hoangphuc91dtt/java2-jwt works
Project type and purpose
• This is a backend REST API built with Spring Boot that implements JWT‑based authentication and authorization.
• The README title “spring-jwt” and the presence of SecurityConfig, JwtService, JwtAuthFilter, controllers, services, repositories, and an H2 embedded database confirm its role as a secure user‑management API.
File structure
• Top‑level files: pom.xml (Maven build), mvnw scripts, README.md, /data folder holding the embedded H2 database files.
• src/main/java/com/example/jwtbuoi7:
• config: SecurityConfig.java (HTTP security rules, filter registration)
• filter: JwtAuthFilter.java (inspect and validate tokens on each request)
• controller: UserController.java (endpoints for login, user operations)
• service: JwtService.java (token generation/validation), CustomUserDetailsService.java (load user details), UserInfoService.java (business logic)
• repository: UserInfoRepository.java (JPA interface to H2 DB)
• entity: AuthRequest.java (login payload), UserInfo.java (user model mapped to H2)
• src/main/resources/application.properties: H2 and server configuration.