# n4chocm/bioent architecture

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

- Interactive diagram: https://gitdiagram.com/n4chocm/bioent
- Repository: https://github.com/n4chocm/bioent

## Overview

##### Project Type and Purpose
- The application is a client-side SPA built with React.
- Its goal is to serve as the official website for Bioent, a training company geared toward endurance sports and cycling biomechanics.
- EmailJS integration is noted in the tech stack, suggesting that the site handles email functionality, likely for contact forms or inquiries.

##### Analyzing the File Structure
- Top-Level Structure:
- Configuration files (e.g., .eslintrc.cjs, package.json, vite.config.js, netlify.toml) indicate tooling and deployment configurations.
- index.html – the main HTML entry point.
- The “src” folder houses all our application logic.
- In “src”:
- Component hierarchy: The “components” folder is further segmented into sub-folders by functionality – navbar, banner, about, services, opinions, contact, map, footer, plus a “core” directory for reusable UI elements (cards, images, dividers).
- Page definitions: The “pages” folder includes route-based screens (HomeScreen, AboutScreen, ContactScreen, ErrorScreen, LegalWarningScreen) and dedicated subfolders for various service pages (biomechanics, fitness, personal training).
- State management: The “state” folder contains AppProvider and AppReducer, indicating a context or Redux-like pattern.
- Routing: The “routes” folder contains MainRoutes.jsx which defines page navigation.
- Assets folder: Stores CSS, images, and JSON files for textual content. This indicates data-driven components like “about”, “opinions”, and more are populated from static JSON.

##### Examining the README for Additional Insights
- The README provides an overview that the website is built for high-performance training, hinting that the content is specialized.
- The “Architecture” section is not fully defined in the README itself, but with the file tree we can infer that our design will focus on client-side logic, state management, routing, and clearly separated UI components.

a. Main Components:
- UI Layer: Break this down into a set of components such as Navbar, Banner, About, Services, Opinions, Contact, Map, and Footer.
- Pages: Represent individual screens (e.g., HomeScreen, AboutScreen, ContactScreen, ErrorScreen) and detail the service-specific pages.
- Core Components: Include reusable UI building blocks like cards, dividers, and image cards from the “core” folder.
- State Management: Show AppProvider and AppReducer handling global state.
- Routing: Illustrate the MainRoutes component as the navigator that connects pages.
- Assets/Static Content: Represent this as an independent module that supplies imagery and JSON-based content data.
b. Relationships and Interactions:
- Pages are composed of various UI components that fetch data from static assets (e.g., JSON files in “src/assets/text”).
- The AppProvider (likely wrapped around the top-level component) provides state to all child components, with AppReducer managing state transitions.
- The UI components interact with external APIs (EmailJS for form submissions).
c. Architectural Patterns and Design Principles:
- Component-Based Architecture: Emphasize that every UI piece is built as a React component to foster reusability.
- Single Source of State: Global state management via context/reducer, ensuring consistency throughout page transitions.
- Separation of Concerns: Distinct folders for components, pages, state, and assets illustrate modular design.
d. Relevant Technologies, Frameworks, and Libraries:
- React and JavaScript form the core foundation.
- EmailJS is used for external email operations.
- Vite is likely used as the build tool (noted by vite.config.js) for fast development iterations.
- CSS files associated with each component indicate a component-scoped styling approach.

##### Instructing the Principal Software Engineer
- A section for state management showing AppProvider wrapping down to child components with AppReducer handling actions.
- Detail the modular React component layout by grouping the “components” folder into visual blocks (Header, Banner, About, Services, etc.) that are combined in the Page views.
- “assets” folder as a separate module that not only supplies imagery but also JSON data used by corresponding components (e.g., about.json, gallery.json).
- Another for Core/Shared Components (green),
- A separate one for external services like EmailJS (orange),

##### Final Remarks
- Even if some sections in the README are “TO BE DEFINED”, rely on the file structure to infer those missing details.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Initialization
    subgraph "Entry & Setup"
        E1("index.html"):::entry
        E2("main.jsx"):::entry
    end

    %% State Management
    subgraph "State Management"
        SM1("AppProvider"):::state
        SM2("AppReducer"):::state
    end

    %% Routing
    subgraph "Routing"
        R1("MainRoutes.jsx"):::routes
    end

    %% Pages
    subgraph "Pages"
        P1("HomeScreen"):::pages
        P2("AboutScreen"):::pages
        P3("ContactScreen"):::pages
        P4("ErrorScreen"):::pages
        P5("LegalWarningScreen"):::pages
        subgraph "Service Pages"
            SP1("Biomechanics"):::pages
            SP2("Fitness"):::pages
            SP3("PersonalTraining"):::pages
        end
    end

    %% UI Layer Components
    subgraph "UI Layer"
        U1("Navbar"):::uiLayer
        U2("Banner"):::uiLayer
        U3("About"):::uiLayer
        U4("Services"):::uiLayer
        U5("Opinions"):::uiLayer
        U6("Contact"):::uiLayer
        U7("Map"):::uiLayer
        U8("Footer"):::uiLayer
    end

    %% Core Components
    subgraph "Core Components"
        C1("Core UI Elements"):::coreComp
    end

    %% Assets / Static Content
    subgraph "Assets"
        A1("Images"):::assets
        A2("Text & JSON"):::assets
    end

    %% External Services
    subgraph "External Services"
        X1("EmailJS"):::external
    end

    %% Connections
    E1 --> E2
    E2 --> SM1
    SM1 --> SM2
    SM1 --> R1
    R1 --> P1
    R1 --> P2
    R1 --> P3
    R1 --> P4
    R1 --> P5
    R1 --> SP1
    R1 --> SP2
    R1 --> SP3

    %% Pages use UI Layer Components
    P1 --> U1
    P1 --> U2
    P1 --> U3
    P1 --> U4
    P1 --> U5
    P1 --> U8

    P2 --> U1
    P2 --> U3
    P2 --> U8

    P3 --> U1
    P3 --> U6
    P3 --> U7
    P3 --> U8

    %% Other pages may also include common UI components
    P4 --> U1
    P4 --> U8
    P5 --> U1
    P5 --> U8

    %% UI Layer integration with Core and Assets
    U1 --- C1
    U2 --- C1
    U3 --- C1
    U4 --- C1
    U5 --- C1
    U6 --- C1
    U7 --- C1
    U8 --- C1

    A1 --> U2
    A2 --> U3

    %% Contact component communicates with External Service
    U6 -->|"sendsFormData"| X1

    %% UI Layer also uses State Management for dynamic data
    U1 --- SM1
    U2 --- SM1
    U3 --- SM1
    U4 --- SM1
    U5 --- SM1
    U6 --- SM1
    U7 --- SM1
    U8 --- SM1

    %% Click Events
    click U1 "https://github.com/n4chocm/bioent/blob/main/src/components/0-navbar/Navbar.jsx"
    click U2 "https://github.com/n4chocm/bioent/blob/main/src/components/1-banner/Banner.jsx"
    click U3 "https://github.com/n4chocm/bioent/blob/main/src/components/2-about/About.jsx"
    click U4 "https://github.com/n4chocm/bioent/blob/main/src/components/3-services/Services.jsx"
    click U5 "https://github.com/n4chocm/bioent/blob/main/src/components/4-opinions/Opinions.jsx"
    click U6 "https://github.com/n4chocm/bioent/blob/main/src/components/6-contact/Contact.jsx"
    click U7 "https://github.com/n4chocm/bioent/blob/main/src/components/7-map/Map.jsx"
    click U8 "https://github.com/n4chocm/bioent/blob/main/src/components/8-footer/Footer.jsx"
    click C1 "https://github.com/n4chocm/bioent/tree/main/src/components/core/"
    click P1 "https://github.com/n4chocm/bioent/blob/main/src/pages/HomeScreen.jsx"
    click P2 "https://github.com/n4chocm/bioent/blob/main/src/pages/AboutScreen.jsx"
    click P3 "https://github.com/n4chocm/bioent/blob/main/src/pages/ContactScreen.jsx"
    click P4 "https://github.com/n4chocm/bioent/blob/main/src/pages/ErrorScreen.jsx"
    click P5 "https://github.com/n4chocm/bioent/blob/main/src/pages/LegalWarningScreen.jsx"
    click SP1 "https://github.com/n4chocm/bioent/tree/main/src/pages/services/biomechanics/"
    click SP2 "https://github.com/n4chocm/bioent/tree/main/src/pages/services/fitness/"
    click SP3 "https://github.com/n4chocm/bioent/tree/main/src/pages/services/personal-training/"
    click SM1 "https://github.com/n4chocm/bioent/blob/main/src/state/AppProvider.jsx"
    click SM2 "https://github.com/n4chocm/bioent/blob/main/src/state/AppReducer.jsx"
    click R1 "https://github.com/n4chocm/bioent/blob/main/src/routes/MainRoutes.jsx"
    click A1 "https://github.com/n4chocm/bioent/tree/main/src/assets/img"
    click A2 "https://github.com/n4chocm/bioent/tree/main/src/assets/text/"

    %% Styles
    classDef entry fill:#d0d0d0,stroke:#808080,stroke-width:2px;
    classDef state fill:#fefbd8,stroke:#ffcc00,stroke-width:2px;
    classDef routes fill:#decbe4,stroke:#9e0059,stroke-width:2px;
    classDef pages fill:#fbb4ae,stroke:#fb9a99,stroke-width:2px;
    classDef uiLayer fill:#b3cde0,stroke:#03396c,stroke-width:2px;
    classDef coreComp fill:#ccebc5,stroke:#2b9348,stroke-width:2px;
    classDef assets fill:#ffffcc,stroke:#b58900,stroke-width:2px;
    classDef external fill:#ffcc99,stroke:#d94801,stroke-width:2px;
```
