How elvificent/ticket works
Project Type and Purpose
• This is a full-stack ticket-support application.
• Front-end: React SPA (Vite) providing pages for login, ticket creation, viewing, chatbot, resources, etc.
• Back-end: Spring Boot REST API managing users, tickets, sessions, products, authentication/authorization via JWT.
• Database: Relational (initialized via schema.sql).
File Structure Analysis
• Top-level: frontend/, backend/, documentation files (API_DOCUMENTATION.md, GUIDE.md).
• backend: Standard Maven/Spring Boot layout.
• config (security, JWT, data initializer)
• controller (REST endpoints)
• service (business logic)
• repository (JPA interfaces)
• model (entities, enums)
• security (filters, token provider, user details)
• resources: application.properties, schema.sql
• frontend: Vite + React.
• src/Components (Header, Footer)
• src/Pages (multiple page folders)
• main.jsx bootstraps the app, uses React Router and Axios for API calls.
Key Insights from README
• Back-end: Oracle JDK, Maven, runs via mvn spring-boot:run.
• Front-end: Node & npm, npm run dev to start.
• Dependencies: react-router-dom, axios, FontAwesome.
Main Components
a. Front-end (React SPA)
b. API Gateway / Back-end (Spring Boot)
c. Auth subsystem (JWT token provider, filters)
d. Service layer (business logic services per entity)
e. Persistence layer (Spring Data JPA repositories)
f. Database (e.g., PostgreSQL/MySQL)
g. DataInitializer (initial seed data)
h. External (optional) Chatbot or 3rd-party resources (if any)
Relationships & Data Flows
• React UI → HTTP/HTTPS → Spring Boot Controllers
• Controllers → Service layer → Repository → Database
• On login: AuthController ↔ JwtTokenProvider → HTTP response with JWT
• Protected endpoints: JwtRequestFilter intercepts requests, validates JWT via CustomUserDetailsService
• DataInitializer runs at startup to seed reference data
• Front-end Axios calls include JWT in Authorization header
Architectural Patterns & Design Principles
• Layered architecture (Controller → Service → Repository → Database)
• Dependency Injection via Spring
• Stateless authentication with JWT
• Front-end single-page application using client-side routing
• DTOs for API responses
Detailed Elements to Capture
• Front-end modules/pages (Login, CreateTicket, TicketInformation, Chatbot)
• API controllers (AuthController, TicketController, UserController, etc.)
• Auth flow: AuthController → JwtTokenProvider, JwtAuthenticationFilter
• Service layer classes corresponding to each domain entity
• Repository interfaces connecting to the database
• Database with seeded data (via DataInitializer + schema.sql)
Final Advice
• Don’t over-complicate: reflect the three major tiers and their sub-components.
• Every REST endpoint class is represented under the API layer.
• Security checks as a middleware/filter between UI and controllers.