How wuot-software-engineering-group/petshareapp works
Project Type and Purpose
• This is a backend API application that supports a pet-sharing platform. Its purpose is to expose endpoints for managing entities like pets, adopters, announcements, shelters, and applications.
• The system uses a code-first relational SQL database with Entity Framework Core and employs OAuth and JWT for authentication and authorization.
Main Components
a. Domain Layer:
• Contains core business entities (e.g., Address, Admin, Adopter, Announcement, Pet, Shelter, User, etc.) and repository abstraction interfaces.
• It as the “Business / Domain Model.” This is the foundation for business logic.
b. Data Persistence Layer:
• Includes the DbContext, migrations, and concrete Repository implementations. These components are responsible for interacting with the SQL database.
• Use of Entity Framework Core with the Code First approach.
c. Cross-Cutting Concerns:
• Consists of DTOs, enums, and utilities that support data transformation, mapping, and common features across layers.
• This as “DTOs and Shared Utilities.”
d. Services Layer:
• Contains business logic implementations like AdopterService, AnnouncementService, PetService, MailService, etc.
• Acts as the “Business Logic” layer that orchestrates operations between the domain and data persistence.
• Service Wrapper that aggregates individual service calls.
e. Presentation / API Layer:
• Consists of the ASP.NET Core web API (controllers in Petshare.Presentation and Petshare.WebAPI). This layer exposes the HTTP endpoints.
• It as “API / Web Interface.”
• That it integrates authentication/authorization configurations and routing.
f. CI/CD and DevOps:
• Although not part of the runtime system, the GitHub workflows (in .github/workflows) indicate continuous integration/deployment processes.
Relationships and Interactions
• Front-facing HTTP requests enter through the Presentation/API layer (controllers).
• Controllers call the Services Layer to execute business logic.
• Services use Domain entities and interact with the Data Persistence Layer (repositories) to fetch/store data.
• The Data Persistence Layer communicates with the relational SQL database using Entity Framework Core.
• Cross-cutting utilities (DTO mappings, enums, etc.) are used along each of these layers to ensure consistent data transformation and management.
• External integration points such as authentication (OAuth, JWT) should be noted as part of the API configuration.
• CI/CD flows show automated testing and deployment pipelines feeding into the application’s lifecycle.
Architectural Patterns
• Layered (n-tier) architecture: clearly separated concerns between API, Services, Domain, and Data Access.
• Use of the Repository pattern for data abstraction.
• Mapping configurations for converting between DTOs and domain models.
• Emphasis on testability with dedicated Unit Test projects.