How caonguyen-tran/epm_spring works
Main Components
• Web Server / Dispatcher: At the core, there is the web container (Tomcat 9) running the Spring MVC application. The Dispatcher Servlet (configured in DispatcherServletInit.java) acts as the front controller.
• Controller Layer: Include all HTTP controllers (“controllers” package, e.g., AdminActivityController, ApiUserController, etc.) that handle incoming web requests.
• Service Layer: Represent the services (both interfaces and their implementations in “services” and “services/imp” packages) that contain business logic.
• Repository/DAO Layer: Represent the data access layer (repositories and their implementations) which interacts with the database.
• Domain Models: The “pojo” package contains the core entities like Activity, Student, User, etc.
• Configurations: There are numerous configurations (in the “configs” package) that configure Spring MVC, Spring Security, Hibernate, Firebase, Mail, Tiles, etc.
• Security Components: Highlight components such as JwtService, JwtAuthenticationTokenFilter, and the various Spring Security configurations.
• Persistence: Include the database (as indicated by the epmdb.sql file and databases.properties) used by Hibernate (configured via HibernateConfig.java and persistence.xml).
• Utility Components: These include utility packages for data conversion, timestamp conversion, and status handling.
Out Relationships and Data Flow
• From controllers, indicate the invocation of service methods to process business logic.
• From services, indicate calls to the repository layer for database CRUD operations.
• Flow from database queries returning data back through the repositories, services, and controllers to the client.
• Security intercepts: Show how incoming requests pass through security filters (JWT filters and access handlers) before reaching controllers.
• External integrations: For example, Firebase and Mail configurations should be shown as interactions from the backend components that need to contact external services.
Architectural Patterns
• MVC Pattern: Clearly distinguish between the Model (domain entities in “pojo”), View (JSP pages in the “WEB-INF/pages” directory and possibly ReactJS views if they are considered separately), and Controller (in “controllers”).
• Layered Architecture: Separate the application into Controller, Service, and Repository layers.
Relevant Technologies and Frameworks
• Spring MVC, Spring Security, Spring Beans/DI, Hibernate (with associated persistence.xml and configurations), and integration tools (Firebase, Mail).
• The front end is built with ReactJS and communicates via REST APIs provided by the Spring backend.
• Tomcat 9 is the deployment server.