# hctynch/trackhounds architecture

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

- Interactive diagram: https://gitdiagram.com/hctynch/trackhounds
- Repository: https://github.com/hctynch/trackhounds

## Overview

##### Major Components
- Frontend Application: Located in the “frontend” directory built using React with Vite. This part comprises the UI views (using multiple components such as Navbar, Home, Add Dogs, Score Entry, etc.), service layers (using Axios to make API calls to the backend), and client-side logic.
- Backend Application: Found under the “trackhounds” directory. It’s a Spring Boot application built according to the MVC (Model-View-Controller) pattern. The structure shows Controllers (like DogController, HuntController, JudgeController), Services (business logic), Repositories (data access), Entities, DTOs, and Exception handling components.
- Infrastructure/Containers: Docker is utilized for both the frontend and backend (as evidenced by the Dockerfiles and docker-compose.yml). Indicate containerized deployment and orchestration via Docker Compose.
- CI/CD Pipelines: GitHub Actions configurations (e.g., backend tests and release workflows) help automate testing and build processes, so include a component showing integration with your version control and continuous integration processes.

##### Architectural Patterns and Technologies
- Frontend: Highlight that it’s a React application structured with components for major views (e.g., Home, Dogs, Judges, Score Entry, Scratch Sheet, Reports) and service files that manage API requests.
- Backend: Emphasize the layered MVC architecture along with clearly separated concerns — Controllers handle HTTP requests, Services encapsulate business logic, and Repositories manage data persistence with Entities and DTOs defining the domain model.
- Containerization: Note that both frontend and backend are containerized via Docker, and the system is orchestrated with docker-compose.
- Additional Tools: Show supporting technologies like GitHub Actions (for CI/CD), ESLint (for frontend code quality), and Vite (for frontend bundling).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    A["User/Browser"]:::user

    %% Frontend Application Subgraph
    subgraph "Frontend Application (React/Vite)"
        FUI["UI Components"]:::frontend
        FAPI["API Services (Axios)"]:::frontend
        FUI -->|"Triggers"| FAPI
    end

    %% Backend Application Subgraph
    subgraph "Backend Application (Spring Boot)"
        BCTL["Controllers (Dog,Hunt,Judge)"]:::backend
        BSER["Services"]:::backend
        BREPO["Repositories"]:::backend
        BCTL -->|"Invoke"| BSER
        BSER -->|"Invoke"| BREPO
    end

    D["Database (MariaDB)"]:::db

    %% Infrastructure/Containers and CI/CD Nodes
    DC["Docker Compose"]:::container
    CI["CI/CD (GitHub Actions)"]:::cicd

    %% Docker Deployment Files Subgraph
    subgraph "Container Deployment Files"
        FD["Frontend Dockerfile"]:::container
        BD["Backend Dockerfile"]:::container
        TC["TrackHounds Compose"]:::container
        DC -->|"DeployFile"| FD
        DC -->|"DeployFile"| BD
        DC -->|"DeployFile"| TC
    end

    %% Connections between major components
    A -->|"HTTP/Web"| FUI
    FAPI -->|"API_Calls/REST"| BCTL
    BREPO -->|"JDBC/ORM"| D

    %% Connections with Infrastructure and CI/CD
    DC ---|"Containerizes"| FUI
    DC ---|"Containerizes"| BCTL
    CI -->|"AutomatedBuildDeploy"| DC

    %% Click Events
    click FUI "https://github.com/hctynch/trackhounds/tree/main/frontend/src/components"
    click FAPI "https://github.com/hctynch/trackhounds/tree/main/frontend/src/services"
    click BCTL "https://github.com/hctynch/trackhounds/tree/main/trackhounds/src/main/java/com/trackhounds/trackhounds/Controller"
    click BSER "https://github.com/hctynch/trackhounds/tree/main/trackhounds/src/main/java/com/trackhounds/trackhounds/Service"
    click BREPO "https://github.com/hctynch/trackhounds/tree/main/trackhounds/src/main/java/com/trackhounds/trackhounds/Repository"
    click D "https://github.com/hctynch/trackhounds/blob/main/trackhounds/src/main/resources/application.properties"
    click DC "https://github.com/hctynch/trackhounds/blob/main/docker-compose.yml"
    click CI "https://github.com/hctynch/trackhounds/blob/main/.github"
    click FD "https://github.com/hctynch/trackhounds/tree/main/frontend/Dockerfile"
    click BD "https://github.com/hctynch/trackhounds/tree/main/trackhounds/Dockerfile"
    click TC "https://github.com/hctynch/trackhounds/blob/main/trackhounds/compose.yml"

    %% Styles
    classDef user fill:#f5f5f5,stroke:#9e9e9e,stroke-width:2px;
    classDef frontend fill:#bbdefb,stroke:#1e88e5,stroke-width:2px;
    classDef backend fill:#c8e6c9,stroke:#43a047,stroke-width:2px;
    classDef db fill:#ffe082,stroke:#f9a825,stroke-width:2px;
    classDef container fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px;
    classDef cicd fill:#ffccbc,stroke:#f4511e,stroke-width:2px;
```
