How serlesen/fullstack-jwt works
Project type and purpose
• This is a full-stack web application demonstrating JWT authentication.
• Frontend: Angular SPA that handles user login, stores a JWT, and accesses protected resources.
• Backend: Spring Boot REST API that issues and validates JWTs, manages users, and serves protected endpoints.
File structure
• Top-level directories:
• backend (Java/Spring Boot source, config, controllers, services, repos)
• frontend (Angular source, components, routing, service for HTTP calls)
• backend follows a layered MVC pattern:
• config (security filters, exception handlers, WebConfig)
• controllers (AuthController, MessagesController)
• services (UserService)
• repositories (UserRepository)
• dtos and mappers for data transfer
• frontend is component-based:
• login-form, header, content, welcome-content, auth-content, buttons
• axios.service.ts handles HTTP and attaches JWT header
• Key config files:
• backend/src/main/resources/application.yml (DB, JWT secret)
• frontend/angular.json, package.json, tsconfig.json
README for additional insights
• Purpose: Show end-to-end JWT flow
• Workflow: Angular sends credentials → Spring issues JWT → Angular saves token → Angular calls protected API
• No external services beyond DB and JWT logic
Elements
• Blue for frontend components
• Green for backend controllers/services
• Orange for security/filter components
• Gray for external systems (Database)