# zerka30/bettergotify-ui architecture

> Architecture diagram of the GitHub repository zerka30/bettergotify-ui, 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/zerka30/bettergotify-ui
- Repository: https://github.com/zerka30/bettergotify-ui

## Overview

- Frontend Application UI – Represented by the React components found under the “src” directory (e.g., App.tsx, pages, components, layout, modals).
- Routing and Authentication – Highlight the special components such as PrivateRoute and ProtectedRoute, which indicate the handling of authenticated/protected views.
- Service Layer – Group together the API and service files (in “src/services”) that include functionalities for communicating with backend endpoints or handling business logic.
- Internationalization (i18n) – Illustrate the integration of localization via the “public/locales” folders as part of the UI.
- Configurations and Utilities – Include configuration files (like “src/config”, Tailwind config, ESLint config, tsconfig files) as a separate block that feeds into the overall functioning of the application.
- Deployment & Infrastructure – Represent Docker-related files (Dockerfile, docker-entrypoint.sh, compose.yml) and server configurations (nginx.conf) as components that manage building, containerizing, and serving the application.

##### Relationships and Interactions
- From UI components (pages and layout) towards the Service Layer for fetching, creating, or modifying data.
- From public/locales (i18n configuration) feeding into the UI for dynamic language switching.
- Dependency lines from the application’s configuration components (ESLint, Vite, Tailwind, etc.) to the build and runtime environments.

##### Architectural Patterns and Design Principles
- Component-Based Architecture – Emphasize how the “src/components” and “src/pages” directories form the building blocks, ensuring reusability and separation of concerns.
- Micro-configuration Implementation – Although this is primarily a React frontend, the detailed configuration files (Docker, ESLint, Vite) indicate a modular approach to setting up and managing environment-specific settings.

##### Relevant Technologies and Libraries
- Frontend: React, TypeScript, Vite, Tailwind CSS.
- Code Quality & Build: ESLint (with plugins like react-x and react-dom), Babel/SWC (via Vite plugins for Fast Refresh).
- Deployment: Docker, Docker Compose; also show the role of NGINX (based on nginx.conf) as a reverse proxy or static file server.
- Internationalization: Indicate the use of i18n practices with directories for language-specific JSON files.

- Main UI Layer: Represent “Pages” and “Components” blocks and show navigation via route components (Login, Dashboard, Applications, etc.).
- Service Layer: Illustrate how the “src/services” modules connect to external (or future) APIs.
- Deployment: Create a section for Docker, Docker Compose, and NGINX configuration showing how the application is containerized and served.
- Internationalization: Represent the “public/locales” feature and connect it to the UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Configurations & Utilities"
        E1["Config Directory"]:::config
        E2["Tailwind Config"]:::config
        E3["ESLint Config"]:::config
        E4["Vite Config"]:::config
        E5["TS Configs (tsconfig files)"]:::config
        E6["Utilities"]:::config
    end

    subgraph "Internationalization"
        D["Internationalization & i18n"]:::i18n
    end

    subgraph "Frontend Application UI"
        A["React Components - UI"]:::frontend
        subgraph "Routing & Authentication"
            B1["PrivateRoute"]:::routing
            B2["ProtectedRoute"]:::routing
            B3["Login Page"]:::routing
        end
    end

    C["Service Layer for API Calls"]:::service

    subgraph "Deployment & Infrastructure"
        F1["Dockerfile"]:::infra
        F2["Compose File"]:::infra
        F3["Docker Entrypoint"]:::infra
        F4["Nginx Config"]:::infra
        F5["Gotify Config"]:::infra
    end

    %% Relationships
    E1 -->|"configures"| A
    E1 -->|"configures"| C
    D -->|"i18n-feed"| A
    A -->|"API-request"| C
    F1 -->|"deployed"| A
    F1 -->|"deployed"| C

    %% Click Events for Frontend Application UI
    click A "https://github.com/zerka30/bettergotify-ui/tree/main/src/"
    click B1 "https://github.com/zerka30/bettergotify-ui/blob/main/src/components/PrivateRoute.tsx"
    click B2 "https://github.com/zerka30/bettergotify-ui/blob/main/src/components/auth/ProtectedRoute.tsx"
    click B3 "https://github.com/zerka30/bettergotify-ui/blob/main/src/pages/auth/Login.tsx"

    %% Click Event for Service Layer
    click C "https://github.com/zerka30/bettergotify-ui/tree/main/src/services/"

    %% Click Event for Internationalization
    click D "https://github.com/zerka30/bettergotify-ui/tree/main/public/locales/"

    %% Click Events for Configurations & Utilities
    click E1 "https://github.com/zerka30/bettergotify-ui/tree/main/src/config/"
    click E2 "https://github.com/zerka30/bettergotify-ui/blob/main/tailwind.config.js"
    click E3 "https://github.com/zerka30/bettergotify-ui/blob/main/eslint.config.js"
    click E4 "https://github.com/zerka30/bettergotify-ui/blob/main/vite.config.ts"
    click E5 "https://github.com/zerka30/bettergotify-ui/blob/main/tsconfig.json"
    click E6 "https://github.com/zerka30/bettergotify-ui/tree/main/src/utils/"

    %% Click Events for Deployment & Infrastructure
    click F1 "https://github.com/zerka30/bettergotify-ui/tree/main/Dockerfile"
    click F2 "https://github.com/zerka30/bettergotify-ui/blob/main/compose.yml"
    click F3 "https://github.com/zerka30/bettergotify-ui/blob/main/docker-entrypoint.sh"
    click F4 "https://github.com/zerka30/bettergotify-ui/blob/main/nginx.conf"
    click F5 "https://github.com/zerka30/bettergotify-ui/blob/main/configs/gotify.yml"

    %% Styles
    classDef frontend fill:#FFCC00,stroke:#333,stroke-width:2px
    classDef routing fill:#33CCCC,stroke:#333,stroke-width:2px
    classDef service fill:#FF6666,stroke:#333,stroke-width:2px
    classDef config fill:#66CC66,stroke:#333,stroke-width:2px
    classDef infra fill:#9966FF,stroke:#333,stroke-width:2px
    classDef i18n fill:#FF9966,stroke:#333,stroke-width:2px
```
