# 2024-sandhya/blood-buddy architecture

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

- Interactive diagram: https://gitdiagram.com/2024-sandhya/blood-buddy
- Repository: https://github.com/2024-sandhya/blood-buddy

## Overview

##### Project Type & Purpose
- This is a front-end web project that serves as a blood donation portal. Its primary purpose is to allow users to register, add their address, locate nearby blood banks, and get updates.
- The project is entirely focused on client-side logic (HTML, CSS, and JavaScript) with static assets (e.g., video files) and does not include any server-side or backend code.

##### File Structure
- Top-level files include multiple HTML files: index.html (likely the landing or home page), Register.html, donate.html, and help.html.
- Each HTML page has its associated CSS file (like Register.css, donate.css, help.css, index.css) that styles the components on that page.
- JavaScript files like Register.js, scroll.js, and up.js provide interactivity. For example, Register.js is probably used for handling the registration form logic.
- The video directory (with a homevideo file) indicates that multimedia is used in the user interface, probably on the home page.
- The presence of .github, Code of Conduct, LICENSE, and README files indicate good open-source practices but are not directly part of the system operation.

##### Main Components
- Frontend Pages:
- Home Page (index.html): Acts as the landing page. It likely embeds the video (from the video folder) as a backdrop or promotional element.
- Registration Page (Register.html): Allows users to sign up. Register.js supports the behavior here.
- Donation Page (donate.html): Provides details on blood donation services.
- Help/Support Page (help.html): Offers guidance on using the website.
- Styling:
- CSS files (corresponding to each HTML) which ensure a consistent look and feel.
- Interactivity:
- JavaScript files (Register.js, scroll.js, up.js) that handle navigation behaviors, form submission, and dynamic actions on the pages.
- Static Assets:
- The video content and image assets that enhance the user experience.

##### Relationships & Interactions
- The Registration Page interacts with its own JavaScript (Register.js) to process user inputs.
- Global or shared scripts (scroll.js and up.js) may be invoked on multiple pages, indicating reused functionality (such as scrolling effects or “back to top” behavior).
- Multimedia components (like the home video) integrate into the Home Page, which impacts the visual presentation of the interface.

##### Key Architectural Patterns & Design Principles
- Separation of concerns: Distinct HTML, CSS, and JavaScript files for each functional page.
- Modular design: Each page is built as its own component, making it easier to maintain and update the site.
- Static website design: As a client-side application, the design is centered on the browser with no backend inter-service communications depicted.

##### Technologies & Frameworks Highlighted
- Core web technologies: HTML5, CSS3, and JavaScript.
- Although no libraries or frameworks are explicitly stated in the file tree, the use of standard web technologies suggests the design is straightforward.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Actor
    U("User"):::actor

    %% Home Page Subgraph
    subgraph "Home Page"
        direction TB
        HP_HTML("Page: Home"):::page
        HP_CSS("CSS: Home"):::cssnode
        HP_Video("Video: Home"):::video
    end

    %% Registration Page Subgraph
    subgraph "Registration Page"
        direction TB
        RP_HTML("Page: Registration"):::page
        RP_CSS("CSS: Registration"):::cssnode
        RP_JS("JS: Registration"):::jsnode
    end

    %% Donation Page Subgraph
    subgraph "Donation Page"
        direction TB
        DP_HTML("Page: Donation"):::page
        DP_CSS("CSS: Donation"):::cssnode
    end

    %% Help Page Subgraph
    subgraph "Help Page"
        direction TB
        HP_Help_HTML("Page: Help"):::page
        HP_Help_CSS("CSS: Help"):::cssnode
    end

    %% Shared Scripts and Assets
    SS_Scroll("JS: scroll.js"):::jsnode
    SS_Up("JS: up.js"):::jsnode
    SA_Images("Static Assets: Images"):::asset

    %% User navigation flow
    U -->|"navigates"| HP_HTML

    %% Navigation links from Home Page to other pages
    HP_HTML -->|"goes to"| RP_HTML
    HP_HTML -->|"goes to"| DP_HTML
    HP_HTML -->|"goes to"| HP_Help_HTML

    %% Intra-page relationships
    HP_HTML -->|"styled by"| HP_CSS
    HP_HTML -->|"displays"| HP_Video

    RP_HTML -->|"styled by"| RP_CSS
    RP_HTML -->|"processes input using"| RP_JS

    DP_HTML -->|"styled by"| DP_CSS

    HP_Help_HTML -->|"styled by"| HP_Help_CSS

    %% All pages use shared navigation scripts
    HP_HTML ---|"uses"| SS_Scroll
    RP_HTML ---|"uses"| SS_Scroll
    DP_HTML ---|"uses"| SS_Scroll
    HP_Help_HTML ---|"uses"| SS_Scroll

    HP_HTML ---|"uses"| SS_Up
    RP_HTML ---|"uses"| SS_Up
    DP_HTML ---|"uses"| SS_Up
    HP_Help_HTML ---|"uses"| SS_Up

    %% All pages can access common static images
    HP_HTML ---|"accesses"| SA_Images
    RP_HTML ---|"accesses"| SA_Images
    DP_HTML ---|"accesses"| SA_Images
    HP_Help_HTML ---|"accesses"| SA_Images

    %% Click Events for Home Page Component
    click HP_HTML "https://github.com/2024-sandhya/blood-buddy/blob/main/index.html"
    click HP_CSS "https://github.com/2024-sandhya/blood-buddy/blob/main/index.css"
    click HP_Video "https://github.com/2024-sandhya/blood-buddy/blob/main/video/homevideo1.mp4"

    %% Click Events for Registration Page Component
    click RP_HTML "https://github.com/2024-sandhya/blood-buddy/blob/main/Register.html"
    click RP_CSS "https://github.com/2024-sandhya/blood-buddy/blob/main/Register.css"
    click RP_JS "https://github.com/2024-sandhya/blood-buddy/blob/main/Register.js"

    %% Click Events for Donation Page Component
    click DP_HTML "https://github.com/2024-sandhya/blood-buddy/blob/main/donate.html"
    click DP_CSS "https://github.com/2024-sandhya/blood-buddy/blob/main/donate.css"

    %% Click Events for Help/Support Page Component
    click HP_Help_HTML "https://github.com/2024-sandhya/blood-buddy/blob/main/help.html"
    click HP_Help_CSS "https://github.com/2024-sandhya/blood-buddy/blob/main/help.css"

    %% Click Events for Shared Interactivity/Navigation Scripts and Assets
    click SS_Scroll "https://github.com/2024-sandhya/blood-buddy/blob/main/scroll.js"
    click SS_Up "https://github.com/2024-sandhya/blood-buddy/blob/main/up.js"
    click SA_Images "https://github.com/2024-sandhya/blood-buddy/tree/main/Images"

    %% Styles
    classDef actor fill:#f96,stroke:#333,stroke-width:2px;
    classDef page fill:#bbf,stroke:#333,stroke-width:2px;
    classDef cssnode fill:#ff9,stroke:#333,stroke-width:2px;
    classDef jsnode fill:#9f9,stroke:#333,stroke-width:2px;
    classDef video fill:#f99,stroke:#333,stroke-width:2px;
    classDef asset fill:#fc9,stroke:#333,stroke-width:2px;
```
