# miireiatorras/hc-sferic-terrassa architecture

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

- Interactive diagram: https://gitdiagram.com/miireiatorras/hc-sferic-terrassa
- Repository: https://github.com/miireiatorras/hc-sferic-terrassa

## Overview

This project is a front-end application built using React, TypeScript, and Vite. It’s structured as a component-based UI library with clearly divided feature and UI modules, along with configurations, utilities, and even a Storybook setup for visual testing and component development.

##### Main Components
- Core Application Entry Point: Include the main HTML files (index.html in the root and public/index.html) and the React entry point (src/main.tsx) that renders the App component (src/App.tsx).
- Application Layers:
- Pages: These are high-level views (e.g., src/pages/botiga, src/pages/el-club, src/pages/equips, etc.), each representing a route/view.
- Features: These components encapsulate specific functionality (e.g., src/features/horari, src/features/map, src/features/footer, etc.). They might be used both in pages and as standalone UI pieces.
- Configuration & Assets:
- The public folder contains static assets, fonts, and logos.
- Utilities: Found in src/utils, encapsulating helper functions, style definitions, and className utilities.
- Type Declarations: The typescript-complements file (global.d.ts) sets up global types used throughout the project.
- Supporting Tools:
- Storybook: The .storybook directory contains configuration files for Storybook, which provides interactive documentation and component visual testing.
- Build & Lint: Vite config (vite.config.ts), ESLint configuration (eslint.config.js), and TypeScript configurations (tsconfig.json) facilitate building, testing, and ensuring code quality.

##### Relationships and Interactions
- The Application Entry Point (src/main.tsx) boots up the React application by rendering the App component.
- The App component ties together different pages (via React routing or similar mechanisms) and embeds multiple feature components.
- Each Page brings together various UI components (from src/ui) and domain-specific features (from src/features) to display cohesive views.
- Storybook is an external but closely linked module that visualizes UI components and their states in isolation.

##### Architectural Patterns and Design Principles
- Reusability and Composability: Reusable UI components are centralized in the src/ui directory, making them easily shared and extended across pages and features.
- Configuration Driven Development: The existence of configuration files for ESLint, Vite, and Storybook indicates an emphasis on maintainability and development experience.

##### Relevant Technologies, Frameworks, and Libraries
- React for UI composition.
- TypeScript for static type checking.
- Vite as the build tool for fast module reloading and HMR.
- ESLint for code quality; optionally extended with react-x and react-dom plugins.
- Storybook for interactive UI component development.
- SCSS for styling across components.
- Babel/SWC as part of Vite’s React plugin configuration to facilitate Fast Refresh.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Entry Points"
        EntryIndexRoot["index.html (Root)"]:::entry
        EntryIndexPublic["public/index.html"]:::entry
    end

    MainEntry["React Entry (src/main.tsx)"]:::entry
    AppComponent["App Component (src/App.tsx)"]:::entry

    EntryIndexRoot --> MainEntry
    EntryIndexPublic --> MainEntry
    MainEntry --> AppComponent

    subgraph "Application Layers"
        Pages["Pages"]:::application
        Features["Features"]:::application
        UILibrary["UI Library"]:::ui
        ConfigAssets["Config & Assets"]:::config
        Utilities["Utilities"]:::config
        GlobalTypes["Global Types"]:::config
    end

    AppComponent --> Pages
    Pages --> Features
    Pages --> UILibrary
    AppComponent --> ConfigAssets
    AppComponent --> Utilities
    AppComponent --> GlobalTypes

    subgraph "Supporting Tools"
        Storybook["Storybook"]:::support
        ViteConfig["Vite Config"]:::support
        ESLintConfig["ESLint Config"]:::support
        TSConfig["TS Config"]:::support
    end

    UILibrary --> Storybook
    ConfigAssets --> ViteConfig
    ConfigAssets --> ESLintConfig
    ConfigAssets --> TSConfig

    click EntryIndexRoot "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/index.html"
    click EntryIndexPublic "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/public/index.html"
    click MainEntry "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/src/main.tsx"
    click AppComponent "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/src/App.tsx"
    click Pages "https://github.com/miireiatorras/hc-sferic-terrassa/tree/main/src/pages"
    click Features "https://github.com/miireiatorras/hc-sferic-terrassa/tree/main/src/features"
    click UILibrary "https://github.com/miireiatorras/hc-sferic-terrassa/tree/main/src/ui"
    click ConfigAssets "https://github.com/miireiatorras/hc-sferic-terrassa/tree/main/src/config"
    click Utilities "https://github.com/miireiatorras/hc-sferic-terrassa/tree/main/src/utils"
    click GlobalTypes "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/src/typescript-complements/global.d.ts"
    click Storybook "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/.storybook"
    click ViteConfig "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/vite.config.ts"
    click ESLintConfig "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/eslint.config.js"
    click TSConfig "https://github.com/miireiatorras/hc-sferic-terrassa/blob/main/tsconfig.json"

    classDef entry fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef application fill:#ABEBC6,stroke:#1E8449,stroke-width:2px;
    classDef ui fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef config fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef support fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
```
