How phuhoang07/esms_api works
Main components of the system
• ESMS API (Presentation/API Layer):
• Contains API controllers (Admin, Auth, Email, Exam, Lecturer, Staff, Student, User) that serve as the HTTP entry points for client requests.
• Hosts the Web API project (ESMS API.csproj) and includes configurations such as appsettings and launchSettings files.
• Business Layer:
• Implements the core business logic.
• Organized into a Services folder with distinct service classes (AuthService, EmailService, ExamService, LecturerService, StaffService, StudentService, UserService) along with their respective interfaces.
• May also contain utility functions aiding the business logic.
• Data Layer:
• Handles persistence and data mapping.
• Contains entities, models, and the database context (ESMSContext.cs) that defines tables such as Users, Exams, ExamSchedules, Participations, Registrations, and more.
• Repository pattern is used with implementations in subdirectories like ExamRepository, ExamScheduleRepository, UserRepository, etc.
• Holds definitions for data transfer objects and request/response models.
• Database:
Relationships and interactions
• The ESMS API (Controller layer) receives HTTP requests, routes them to the appropriate controllers.
• Controllers call methods in the Business services, delegating the business logic.
• Business services utilize the Data layer’s repositories to query and update the database.
• The repositories encapsulate data access logic, ensuring separation of concerns.
• There is a pipeline flow: External client → API Controllers → Business Logic → Data Repositories → Database.
• In addition, elements such as the Swagger UI interface for API documentation and the CI/CD pipelines (as evident from the GitHub Actions workflows) should be included as auxiliary components.
Important architectural patterns and principles
• Layered Architecture:
• Clear separation between presentation (API), business logic, and data access.
• Repository Pattern:
• Detailed repository implementations for different data models ensure decoupling between business logic and the underlying datastore.
• Dependency Injection:
• Likely used since there are service interfaces for each implemented service class, making the architecture modular and testable.
• Service-Oriented Approach:
• Each domain (User, Exam, Email, etc.) is managed by dedicated services in the Business layer, encapsulating business rules.
• CI/CD Integration:
• Incorporates automated build and deployment pipelines as seen in the .github/workflows configuration for Azure Web App deployment.
Relevant technologies, frameworks, or libraries
• ASP.NET Core for Web API development.
• Entity Framework for ORM and data persistence.
• C# as the programing language (based on .cs files and .csproj files).
• Swagger for API documentation.
• GitHub Actions for CI/CD.
• Likely SQL-based database given EF Core context usage and structured entities (e.g., Users, ExamSchedules).