How longnt08/nhom6-financial-management-system works
Project Overview and Type
• This is a full-stack enterprise application designed for financial management (accounting, auditing, budget, investment). The backend is built with Java EE using EJB for business logic and deployed on WildFly, while the frontend is a modern JavaScript client (built with React/Vite). The application also integrates with MongoDB as its primary data store.
Main Components
a. Frontend Client:
• Located in the “client” directory.
• Built using React with Vite configuration. It includes components/pages (e.g., AccountingPage, AuditPage) and service modules (AccountingService, AuditService) to interact with backend APIs.
• It handles user interactions and displays views (including forms and reports).
b. Backend Server:
• The core server-side code is under the “src” directory.
• Organized using Java EE conventions with layered patterns. Key packages include:
• Controller: Handles incoming API requests (e.g., AccountingController, AuditController).
• Service / Business Logic: Contains EJB components and local business services (e.g., AccountingRecordService, AuditServiceLocal).
• Repository/Data Access: Provides interfaces to MongoDB (e.g., AccountingRecordRepository, AuditRepository).
• Model: Defines domain entities (e.g., AccountingRecord, Audit, User).
• API & Utils: Contains shared interfaces, utilities for parsing JSON, JWT authentication, and MongoDB connections.
• Servlet and Web Layers: Handles legacy or JSP-based presentation (e.g., AccountingRecordServlet, various JSP pages under src/main/webapp) which may be used alongside RESTful API endpoints.
• Configuration files such as pom.xml, MongoDBConfig, ApplicationConfig help set up the environment and dependencies.
c. Infrastructure & External Services:
• WildFly: The Java EE application server used to run the backend services.
• MongoDB: The NoSQL database where financial data, user data, and other entities are stored.
• Maven: Build and dependency management tool ensuring proper packaging and deployment of the application.
• RESTful API Layer: Acts as the communication bridge between the frontend client and backend services.
Relationships and Interactions
• The backend interacts with MongoDB using specially configured utilities (MongoDBUtil, MongoDBConfig) and repository classes. Mark this connection clearly.
• Deployment process on WildFly, showing how the packaged application (WAR/EAR) is deployed, and how WildFly manages the application lifecycle.
Architectural Patterns and Design Principles
• Layered Architecture: Separate presentation (both web and REST), business logic (EJB services), and data access (repositories).
• MVC-ish for the web part: Controllers/Servlets as “C”, JSP pages as “V”, and business services as “M” (with additional separation in the service layer).
• RESTful API: The client’s service calls are routed to the backend controllers.
• Dependency Injection and modular design provided by Java EE and EJB.
Detailed Component Breakdown
• Backend: Detail the “src/main/java/org/example” package segmentation: highlight the “controller”, “service”, “impl”, “repository”, “model”, “servlet”, and “utils” directories. This demonstrates a well-organized layered approach.
• Infrastructure: Mark out WildFly for deployment and MongoDB for persistent storage.