How aa846301/negativeproverb works
Main Components
• Frontend/API Layer – Represented by the NegativeProverb folder which holds controllers (LoginController, PostController, TagController, UserClockController, UserinfoController) along with startup (Program.cs) and configuration files.
• Business Logic Layer – Represented by the BusinessRule folder. It includes business services (LoginService, PostService, TagService, UserClockService, UserinfoService) and interfaces (e.g., IPostService.cs). This layer encapsulates application-specific rules and operations.
• Data Access Layer – Represented by the DataAccess folder. This includes:
• Business models for different domain operations (Login, Post, UserClock, Userinfo, etc.).
• The EF Core setup (ProjectContext and entity files such as Post_Post, Post_PostTag, etc.).
• LINQ-based data queries are used between the DataAccess layer and EF Core.
• Common Utilities – Represented by the Common folder. This contains elements like utility classes (EncryptionHelper, MailHelper, RandomHelper), attributes (ServiceAttribute), and extension helpers (ServiceCollectionExtension), which can be used across the other components.
• External Dependencies – Include MsSQL (as defined in the README) and potential external integrations indicated for future features like social sharing and notifications.
Relationships and Interactions
• The API Layer (controllers) interacts with the Business Logic Layer (services) to process user requests. For example, the LoginController calls the LoginService for handling user registration or login functionality.
• The Business Layer encapsulates core business rules and communicates with the Data Access Layer to perform CRUD operations against the database.
• The DataAccess layer uses Entity Framework Core to map business models to the underlying database (MsSQL) and to perform LINQ queries.
• Common components support various layers by providing utility functions, helper methods, and extension methods that standardize aspects of application behavior.
Architectural Patterns/Principles
• Layered Architecture: Separate concerns into API, Business, and Data Access Layers.
• Dependency Injection: Evident by the use of ServiceCollectionExtension in the Common folder.
• Separation of Concerns: Distinct projects/layers handling business rules, data access, and common utilities.
• Modular Design: The project is split into multiple components making it easier to extend (e.g., future features such as social sharing, multi-language support).
• Use of Interfaces: For abstraction of services (e.g., IPostService) which promotes loose coupling.