How ngocthong37/hair-salon-management-system works
Main Architectural Components
• API/Controller Layer: Representing the front door of the application, this layer exposes various REST endpoints. Components include controllers like AppointmentController, AuthenticationController, ProductController, SalonController, etc.
• Service Layer: This layer contains the business logic. Key components include AppointmentService, AuthenticationService, ProductService, EmailSendService, and others. It acts as a bridge between the controllers and repositories.
• Repository/Data Access Layer: Comprising repository interfaces (e.g., AppointmentRepository, ProductRepository) and their implementations (EmailServiceRepositoryImp, RevenueRepositoryImp), these interact directly with the database.
• Domain/Entity Layer: Includes all the entities (for instance, Appointment, Order, User, Salon) and models that represent the business data.
• Security Layer: Contains classes under the security package such as SecurityConfiguration, JwtAuthenticationFilter, and JwtService to enforce JWT-based authentication.
• External/Utility Components: Email notification functionality is supported by FreeMarker templates (in resources/templates) and might interact with external SMTP/email services.
Relationships and Flow
• Requests go to Controllers, which validate the inputs and delegate to the Service layer.
• The Services process business logic and interact with the Repository layer for database operations.
• The Security component (JWT authentication) interjects in the request pipeline to secure endpoints.
• Email notifications are triggered from services (like EmailSendService) and make use of FreeMarker templates.
• The database (MySQL based on README instructions) supports persistent storage for entities.
Architectural Patterns and Design Principles
• Layered (n-tier) Architecture: The clear separation into controllers, services, and repositories.
• Security as a Cross-Cutting Concern: Integrated via Spring Security and JWT.
• Separation of Concerns: Each package (controller, service, repository, security) has focused responsibilities.
• Use of MVC for handling web requests and FreeMarker for email templating.
Relevant Technologies and Frameworks
• Spring Boot (including built-in REST support).
• Spring Security with JWT for authentication.
• Maven for build and dependency management.
• MySQL (as indicated by the “managementsalon” database creation needed).
• FreeMarker for rendering email templates.
• Docker (a Dockerfile is present, suggesting containerized deployment).
Instructing the Principal Software Engineer
• That every component’s role is clearly labeled.
• To capture cross-cutting concerns (like security) and middleware (email, templating) explicitly.
This detailed representation should provide the principal software engineer with a comprehensive blueprint of the project’s system architecture, ensuring that all essential components and their interactions are visible and well-organized.