# hoangvu1420/petcaresystem architecture

> Architecture diagram of the GitHub repository hoangvu1420/petcaresystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hoangvu1420/petcaresystem
- Repository: https://github.com/hoangvu1420/petcaresystem

## Overview

##### Main Components
- Frontend: Located in the “PCS_front_end” directory, this part is built with modern JavaScript frameworks (using Vite and React), utilizes Tailwind CSS, and hosts various pages, components, and services. It handles customer login/registration, admin functions, pet management, bookings, and payment interfaces.
- Backend: The “PetCareSystem” folder shows an ASP.NET Core backend. It contains Controllers (e.g., AuthController, GroomingController, RoomBookingController), Models (like AppUser, Pet, Room, MedicalRecord, etc.), DataContext (ApplicationDbContext using Entity Framework Core), Services, and Repositories. The clear layered structure (Controllers → Services → Repositories) follows common enterprise patterns.
- Testing: There’s a “PetCareSystem.Test” project, which is useful to note for a complete picture of quality assurance.
- CI/CD/Deployment: The .github/workflows folder and deployment scripts (like netlify.toml in the frontend, and PublishProfiles in the backend) indicate continuous integration and deployment pipelines.

##### Relationships and Interactions
- The Backend’s Controllers receive requests, then pass them through business logic in Services, which in turn call Repository methods to interact with the Database.
- Communication flows should also be represented from the Backend back to the Frontend for responses and error messages.
- Optionally, show testing as peripheral components that interact with these layers.

##### Architectural Patterns and Technologies
- Layered Architecture: Start with Controllers, followed by Services, and then Repositories/Database.
- Separation of Concerns: A clear delineation between the UI (React) and API (ASP.NET Core).
- Use of Dependency Injection in the backend for service/repository management.
- The frontend uses component-based architecture with dedicated pages and components (for admin pages, login, pet management, etc.).

##### Relevant Technologies and Frameworks
- Frontend: Vite, React, Tailwind CSS, possibly ESLint and PostCSS.
- Backend: .NET 8 (or latest ASP.NET Core), Entity Framework Core, C# language, and corresponding testing frameworks (xUnit or similar as seen in the testing project).
- Development and Deployment: GitHub Actions workflows, Netlify for frontend deployment, and Web Deploy profiles for backend.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Frontend (PCS_front_end)"]:::frontend
        FE_CI["CI/CD: Frontend Deployment"]:::cicd
    end

    %% CI/CD Pipeline (Backend)
    subgraph "CI/CD Pipeline"
        BACK_CI["CI/CD: Backend Pipeline"]:::cicd
    end

    %% Backend API Layer
    subgraph "Backend API (PetCareSystem)"
        CONT["Controllers (API Endpoints)"]:::backend
        SERV["Business Logic / Services"]:::backend
        REPO["Repositories (Data Access)"]:::backend
        DB["Database (ApplicationDbContext)"]:::database
    end

    %% Testing Component
    TEST["Testing (PetCareSystem.Test)"]:::testing

    %% Relationships and Flows
    FE -->|"HTTP_API_Call"| CONT
    CONT -->|"calls"| SERV
    SERV -->|"invokes"| REPO
    REPO -->|"queries"| DB
    TEST -.->|"tests"| CONT

    %% CI/CD Deployment connections
    FE_CI --> FE
    BACK_CI --> SERV

    %% Click Events
    click FE "https://github.com/hoangvu1420/petcaresystem/tree/master/PCS_front_end/"
    click FE_CI "https://github.com/hoangvu1420/petcaresystem/blob/master/PCS_front_end/netlify.toml"
    click BACK_CI "https://github.com/hoangvu1420/petcaresystem/blob/master/.github/workflows/deploy.yml"
    click CONT "https://github.com/hoangvu1420/petcaresystem/tree/master/PetCareSystem/PetCareSystem/Controllers/"
    click SERV "https://github.com/hoangvu1420/petcaresystem/tree/master/PetCareSystem/PetCareSystem/Services/Implementations/"
    click REPO "https://github.com/hoangvu1420/petcaresystem/tree/master/PetCareSystem/PetCareSystem/Repositories/Implementations/"
    click DB "https://github.com/hoangvu1420/petcaresystem/blob/master/PetCareSystem/PetCareSystem/Infrastructure/DataContext/ApplicationDbContext.cs"
    click TEST "https://github.com/hoangvu1420/petcaresystem/tree/master/PetCareSystem/PetCareSystem.Test/"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef database fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef cicd fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef testing fill:#FFFF99,stroke:#333,stroke-width:2px;
```
