# dlinrt-eu/website architecture

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

- Interactive diagram: https://gitdiagram.com/dlinrt-eu/website
- Repository: https://github.com/dlinrt-eu/website

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built with React, TypeScript, Vite, and Tailwind CSS.
- Its goal is to present and filter information about deep‐learning radiotherapy products, using static JSON data and custom analytics tracking.

##### File structure
- Top‐level:
- public/ – static assets (PDF roadmap, logos, robots.txt, sitemap.xml)
- src/ – application source, subdivided into pages, components, hooks, services, data, providers, utils, config, types
- config: ESLint, PostCSS, Tailwind, Vite, TypeScript
- CI/CD: .github/workflows/deploy.yml
- src/pages: defines routes (Index, Products, ProductDetails, Dashboard, News, etc.)
- src/components: reusable UI, feature UI (product cards, filters, dashboards, revision charts)
- src/services: DataService reads local JSON; AnalyticsTracker logs page views to localStorage or remote endpoint
- src/data: static product, news, initiative datasets
- Providers & hooks implement context and data‐fetching patterns

##### README for additional insights
- Confirms tech stack (Vite, TypeScript, React, Tailwind CSS)
- Encourages contributions to data files under src/data and config/tags.ts
- No external backend: all product data is shipped in JSON

##### Main components and interactions
a. Frontend (browser)
- index.html → main.tsx → App.tsx
- React Router (in App.tsx) dispatches to page components in src/pages
- Page components invoke hooks (useInitiativeFilters, useChartData, etc.)
- Hooks call services (DataService.getProducts(), AnalyticsTracker.trackPage())
- Components render UI, styled via Tailwind and custom components/ui library
b. Static Data Layer
- JSON files under src/data loaded by DataService at build time or runtime
c. Analytics
- AnalyticsProvider wraps App → injects context
- AnalyticsTracker writes to localStorage or posts to an analytics endpoint (if configured)
d. Build & Deploy
- Vite compiles TSX, bundles CSS, outputs to dist/
- GitHub Actions (.github/workflows/deploy.yml) runs on push → builds & deploys to hosting (e.g., GitHub Pages or Netlify)
e. CI/CD & Repo Management
- .github/ISSUE_TEMPLATE encourages bug/feature reporting
- CONTRIBUTING.md, CODE_OF_CONDUCT, SECURITY.md guide maintainers and contributors

##### Architectural patterns and design principles
- Component‐based UI with a clear separation: pages vs. feature components vs. shared UI primitives
- Hooks for encapsulating data fetching and side effects
- Service layer (DataService, AnalyticsTracker) abstracts data sources and tracking logic
- Provider pattern for global state (analytics context)
- Static site generation approach: local JSON as “data store,” no runtime backend

- How JSON under src/data flows into the UI via DataService
- Provider/Hooks/Service relationship for analytics
- CI/CD workflow as an independent component that triggers on repo events
- Relevant configuration files (vite.config.ts, tailwind.config.ts) alongside the build tool
- Major technologies (React, TypeScript, Tailwind, Vite, GitHub Actions) are called out

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Browser"
        UB["User"]:::external
    end

    subgraph "Frontend Runtime"
        HTML["index.html"]:::artifact
        Main["main.tsx"]:::frontend
        App["App.tsx"]:::frontend
        Router["React Router"]:::frontend
        subgraph "Pages"
            PagesIndex["Index.tsx"]:::frontend
            ProductsPage["Products.tsx"]:::frontend
            ProductDetailsPage["ProductDetails.tsx"]:::frontend
            DashboardPage["Dashboard.tsx"]:::frontend
            NewsPage["News.tsx"]:::frontend
            NewsDetailPage["NewsDetail.tsx"]:::frontend
            InitiativesPage["Initiatives.tsx"]:::frontend
            CompaniesPage["Companies.tsx"]:::frontend
            DonatePage["Donate.tsx"]:::frontend
            MaintenancePage["MaintenanceTeam.tsx"]:::frontend
            NotFoundPage["NotFound.tsx"]:::frontend
            RevisionStatsPage["RevisionStats.tsx"]:::frontend
            SupportPage["Support.tsx"]:::frontend
        end
        subgraph "Components"
            ComponentsRoot["src/components"]:::component
            ProdCard["ProductCard.tsx"]:::component
            ProdGrid["ProductGrid.tsx"]:::component
            ProdDetailsComp["ProductDetails.tsx"]:::component
            FilterBar["FilterBar.tsx"]:::component
            HeaderComp["Header.tsx"]:::component
            NewsSection["NewsSection.tsx"]:::component
        end
        subgraph "Hooks & Services"
            subgraph "Hooks"
                HF1["useInitiativeFilters.ts"]:::service
                HF2["useChartData.ts"]:::service
                HF3["useFilters.ts"]:::service
                HF4["useCompanyData.ts"]:::service
                HF5["usePageTracking.ts"]:::service
            end
            subgraph "Services"
                DataService["DataService.ts"]:::service
                AnalyticsTracker["AnalyticsTracker.ts"]:::service
            end
        end
        subgraph "Provider"
            AnalyticsProvider["AnalyticsProvider.tsx"]:::service
        end
    end

    subgraph "Data Layer"
        DataIndex["index.ts"]:::database
        CompaniesData["companies.ts"]:::database
        NewsData["news.ts & project-launch.ts"]:::database
        InitiativesData["initiatives/index.ts + subfiles"]:::database
        ProductsData["products/index + subfiles"]:::database
    end

    subgraph "Build & Config"
        Vite["Vite (vite.config.ts)"]:::build
        Tailwind["Tailwind CSS (tailwind.config.ts)"]:::build
        PostCSS["PostCSS (postcss.config.js)"]:::build
        ESLint["ESLint (eslint.config.js)"]:::build
        TS["TypeScript (tsconfig.json)"]:::build
    end

    subgraph "CI/CD & Repo"
        RepoEvents["GitHub Repo Events"]:::build
        GHWorkflow[".github/workflows/deploy.yml"]:::build
        Issues[".github/ISSUE_TEMPLATE"]:::build
        Contributing["CONTRIBUTING.md"]:::build
        CodeConduct["CODE_OF_CONDUCT.md"]:::build
        Security["SECURITY.md"]:::build
        Readme["README.md"]:::build
        License["LICENSE"]:::build
    end

    LocalStorage["LocalStorage"]:::database
    ExternalAnalytics("External Analytics Endpoint"):::external

    UB -->|"loads"| HTML
    HTML --> Main
    Main --> App
    App --> Router
    Router --> PagesIndex
    Router --> ProductsPage
    Router --> ProductDetailsPage
    Router --> DashboardPage
    Router --> NewsPage
    Router --> NewsDetailPage
    Router --> InitiativesPage
    Router --> CompaniesPage
    Router --> DonatePage
    Router --> MaintenancePage
    Router --> NotFoundPage
    Router --> RevisionStatsPage
    Router --> SupportPage

    PagesIndex --> HF1
    ProductsPage --> HF3
    ProductDetailsPage --> HF4
    DashboardPage --> HF2
    NewsPage --> HF5
    InitiativesPage --> HF1
    CompaniesPage --> HF4

    HF1 --> DataService
    HF2 --> DataService
    HF3 --> DataService
    HF4 --> DataService
    HF5 --> AnalyticsTracker

    DataService --> DataIndex
    DataService --> CompaniesData
    DataService --> NewsData
    DataService --> InitiativesData
    DataService --> ProductsData

    App --> AnalyticsProvider
    AnalyticsProvider --> AnalyticsTracker
    AnalyticsTracker --> LocalStorage
    AnalyticsTracker -->|optional| ExternalAnalytics

    Vite -->|uses| TS
    Vite -->|uses| Tailwind
    Vite -->|uses| PostCSS
    Vite -->|uses| ESLint

    RepoEvents --> GHWorkflow
    GHWorkflow --> Vite

    classDef frontend fill:#89CFF0,stroke:#333,stroke-width:1px
    classDef component fill:#add8e6,stroke:#333,stroke-width:1px
    classDef service fill:#f9f871,stroke:#333,stroke-width:1px
    classDef database fill:#90ee90,stroke:#333,stroke-width:1px
    classDef build fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef external stroke:#f00,stroke-dasharray:5 5

    click HTML "https://github.com/dlinrt-eu/website/blob/main/index.html"
    click Main "https://github.com/dlinrt-eu/website/blob/main/src/main.tsx"
    click App "https://github.com/dlinrt-eu/website/blob/main/src/App.tsx"
    click PagesIndex "https://github.com/dlinrt-eu/website/blob/main/src/pages/Index.tsx"
    click ProductsPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Products.tsx"
    click ProductDetailsPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/ProductDetails.tsx"
    click DashboardPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Dashboard.tsx"
    click NewsPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/News.tsx"
    click NewsDetailPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/NewsDetail.tsx"
    click InitiativesPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Initiatives.tsx"
    click CompaniesPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Companies.tsx"
    click DonatePage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Donate.tsx"
    click MaintenancePage "https://github.com/dlinrt-eu/website/blob/main/src/pages/MaintenanceTeam.tsx"
    click NotFoundPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/NotFound.tsx"
    click RevisionStatsPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/RevisionStats.tsx"
    click SupportPage "https://github.com/dlinrt-eu/website/blob/main/src/pages/Support.tsx"

    click ComponentsRoot "https://github.com/dlinrt-eu/website/tree/main/src/components"
    click ProdCard "https://github.com/dlinrt-eu/website/blob/main/src/components/ProductCard.tsx"
    click ProdGrid "https://github.com/dlinrt-eu/website/blob/main/src/components/ProductGrid.tsx"
    click ProdDetailsComp "https://github.com/dlinrt-eu/website/blob/main/src/components/ProductDetails.tsx"
    click FilterBar "https://github.com/dlinrt-eu/website/blob/main/src/components/FilterBar.tsx"
    click HeaderComp "https://github.com/dlinrt-eu/website/blob/main/src/components/Header.tsx"
    click NewsSection "https://github.com/dlinrt-eu/website/blob/main/src/components/NewsSection.tsx"

    click HF1 "https://github.com/dlinrt-eu/website/blob/main/src/hooks/useInitiativeFilters.ts"
    click HF2 "https://github.com/dlinrt-eu/website/blob/main/src/hooks/useChartData.ts"
    click HF3 "https://github.com/dlinrt-eu/website/blob/main/src/hooks/useFilters.ts"
    click HF4 "https://github.com/dlinrt-eu/website/blob/main/src/hooks/useCompanyData.ts"
    click HF5 "https://github.com/dlinrt-eu/website/blob/main/src/services/analytics/hooks/usePageTracking.ts"

    click DataService "https://github.com/dlinrt-eu/website/blob/main/src/services/DataService.ts"
    click AnalyticsTracker "https://github.com/dlinrt-eu/website/blob/main/src/services/analytics/AnalyticsTracker.ts"
    click AnalyticsProvider "https://github.com/dlinrt-eu/website/blob/main/src/providers/AnalyticsProvider.tsx"

    click DataIndex "https://github.com/dlinrt-eu/website/blob/main/src/data/index.ts"
    click CompaniesData "https://github.com/dlinrt-eu/website/blob/main/src/data/companies.ts"
    click NewsData "https://github.com/dlinrt-eu/website/blob/main/src/data/news.ts"
    click InitiativesData "https://github.com/dlinrt-eu/website/blob/main/src/data/initiatives/index.ts"
    click ProductsData "https://github.com/dlinrt-eu/website/blob/main/src/data/products/index.ts"

    click Vite "https://github.com/dlinrt-eu/website/blob/main/vite.config.ts"
    click Tailwind "https://github.com/dlinrt-eu/website/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/dlinrt-eu/website/blob/main/postcss.config.js"
    click ESLint "https://github.com/dlinrt-eu/website/blob/main/eslint.config.js"
    click TS "https://github.com/dlinrt-eu/website/blob/main/tsconfig.json"

    click GHWorkflow "https://github.com/dlinrt-eu/website/blob/main/.github/workflows/deploy.yml"
    click Issues "https://github.com/dlinrt-eu/website/tree/main/.github/ISSUE_TEMPLATE"
    click Contributing "https://github.com/dlinrt-eu/website/blob/main/CONTRIBUTING.md"
    click CodeConduct "https://github.com/dlinrt-eu/website/blob/main/CODE_OF_CONDUCT.md"
    click Security "https://github.com/dlinrt-eu/website/blob/main/SECURITY.md"
    click Readme "https://github.com/dlinrt-eu/website/blob/main/README.md"
    click License "https://github.com/dlinrt-eu/website/tree/main/LICENSE"
```
