$ show bfwg/angular-spring-starter
This is a full-stack web application starter kit combining Angular (frontend) and Spring Boot (backend) with JWT-based authentication. The system provides user registration, login, role-based access control (USER/ADMIN), and protected API endpoints. The frontend communicates with the backend via RESTful APIs, with authentication handled through JWT tokens stored in cookies. The architecture follows a standard client-server pattern with clear separation of concerns: Angular handles UI presentation and user interactions, while Spring Boot manages business logic, data persistence, and security. Key features include route guards for client-side protection, custom JWT filters for server-side authentication, and centralized service layers for API communication.
The LLM identified 3 files worth highlighting for reuse:
Provides a generic HTTP service wrapper around Angular's HttpClient with automatic parameter serialization, proper error handling (including 401 responses), and RxJS operator usage. Demonstrates clean separation of concerns by isolating HTTP communication logic, making it easily extractable to any Angular project requiring REST API communication with minimal configuration changes.
Complete implementation of JWT token generation, validation, and extraction that supports both header and cookie-based token storage. Includes token refresh functionality and proper expiration handling. This self-contained component could be dropped into any Spring Boot project requiring JWT authentication with only configuration changes needed for secret key and expiration settings.
Custom Spring Security filter that handles JWT authentication by extracting tokens from requests, validating them via TokenHelper, and establishing security context. Features intelligent path skipping for static resources and login/logout endpoints. Demonstrates proper integration with Spring Security's filter chain and could be reused in other Spring Security configurations with minimal adaptation.