How avaibhav54/examportalspringboot works
Project type and purpose
• From the README and file tree, this is a full-stack Exam Portal application. It uses:
• Angular for the frontend UI (mentioned in README, not in Java code tree)
• Spring Boot for the backend REST API (src/main/java/com/exam/…)
• MySQL for persistence (entities and Spring Data JPA repositories)
• JWT for authentication/authorization
File structure
• Top-level:
• .mvn, mvnw, pom.xml → Maven wrapper and build config
• src/main/java/com/exam/... → backend code by package:
– config (JWT filter, entry point, security config, utilities)
– controller (REST endpoints by resource: Authenticate, Category, Quiz, Question, Result, User)
– model (domain objects: User/Role/Authority, DTOs for JWT, exam entities under model/exams, userRole)
– repo (Spring Data JPA interfaces for persistence)
– services & services/implement (service interfaces and their @Service implementations)
• src/main/resources/application.properties → Spring Boot config (DB URL, JWT secrets, etc.)
• src/test/java/... → unit/integration tests
• The “bin” directory duplicates the Maven project—this can be ignored or treated as sample/demo.
Key architectural patterns & design principles
• Layered (Controller → Service → Repository → Database)
• MVC-style separation for HTTP handling and business logic
• JWT-based stateless authentication filter inserted in the security filter chain
• Use of Spring Data JPA for ORM, reducing boilerplate DAOs
Main components and relationships
a. Components to include:
1) Angular Frontend (Browser SPA)
• UI modules: Admin portal, Student portal
• HTTP client for calling REST endpoints
2) Spring Boot Backend
• Controllers (REST API layer)
• Security Layer (JWTAuthenticationFilter, JWTAuthenticationEntryPoint, mySecurityConfig)
• Service Layer (CategoryService, QuizService, QuestionService, ResultService, UserService, UserDetailsService)
• Repository Layer (CategoryRepository, QuizRepository, QuestionRepository, ResultRepository, RoleRepository, UserRepository)
3) MySQL Database
4) External components (optional):
• Token Store (in-memory or DB for revoked tokens)
• CDN or File Storage (for any media attachments in questions)
b. Interactions and data flows:
• User interacts with Angular UI → Angular issues HTTP requests (with JWT in header) →
• Spring Security filter chain intercepts → JWTAuthenticationFilter validates token →
• Controller receives authenticated request → delegates to Service → Service calls Repository →
• Repository queries/upserts MySQL → Service returns domain to Controller →
• Controller serializes JSON back to Angular → Angular updates the UI
c. Architectural patterns:
• Layered design (API, business logic, persistence)
• Stateless authentication with JWT (no session)
• Use of DTOs (JWTRequest, JWTResponse) for decoupling domain entities from REST payloads
d. Technologies/Frameworks:
• Angular (TypeScript, RxJS, Angular Router)
• Spring Boot (Spring MVC, Spring Security, Spring Data JPA, Jackson)
• MySQL (InnoDB)
• Maven (build), JWT (jjwt or spring-security-oauth)
Detail without overcomplicating
• Tier (UI, API, BL, persistence) distinctly
• JWT flow in the security layer
• Avoid drawing every single method; group by package/layer