# ayushchoudhary6/biomarine-ai architecture

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

- Interactive diagram: https://gitdiagram.com/ayushchoudhary6/biomarine-ai
- Repository: https://github.com/ayushchoudhary6/biomarine-ai

## Overview

##### Project type and purpose
- This is a single‐page web application (SPA) built with React and Vite.
- Purpose: provide a UI for exploring AI models (classification), uploading data, viewing otolith galleries, and displaying maps—all in the browser.

##### File structure
- Top level:
- package.json, vite.config.js, tailwind.config.js → build & styling configuration
- index.html → SPA entry point
- public/models/classification → pre-trained AI model artifacts (JSON weights, metadata)
- src/
- main.jsx, App.jsx → React app bootstrap & root component
- components/layout → Navigation & Footer (global layout)
- components/ui → reusable UI widgets (Map, Spinner, ThemeToggle)
- pages → route‐level views (Home, AIModels, DataUpload, Dashboard, etc.)
- contexts → ThemeContext for global theming state
- utils → aiModel.js & modelDownloader.js for client-side AI model loading/inference
- No backend folder, so all logic—including AI inference—runs in the browser.

##### README insights
- Uses Vite for fast dev/production builds with HMR
- ESLint and Tailwind for code quality and styling

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        VITE["Vite Dev Server & Build"]:::build
        PKG["package.json"]:::build
        ESLINT["eslint.config.js"]:::build
        TAILWIND["tailwind.config.js"]:::build
    end

    %% Static Hosting & Model Storage
    subgraph "Static Hosting"
        direction TB
        HOST["Static File Server (Netlify/GitHub Pages)"]:::host
    end
    subgraph "AI Model Storage"
        direction TB
        STORAGE["public/models/classification"]:::storage
    end

    %% Browser SPA
    subgraph "Browser (React SPA)" 
        direction TB
        INDEX["index.html"]:::frontend
        MAIN["src/main.jsx"]:::frontend
        APP["src/App.jsx"]:::frontend

        subgraph "App Shell"
            direction TB
            NAV["Navigation"]:::frontend
            FOOTER["Footer"]:::frontend
        end

        subgraph "Pages"
            direction TB
            HOME["Home"]:::frontend
            AIMODELS["AI Models"]:::frontend
            UPLOAD["Data Upload"]:::frontend
            GALLERY["Otolith Gallery"]:::frontend
            DASH["Dashboard"]:::frontend
            ABOUT["About"]:::frontend
            CONTACT["Contact"]:::frontend
            RESEARCH["Research"]:::frontend
        end

        subgraph "UI Components"
            direction TB
            MAP["Map"]:::frontend
            SPINNER["Spinner"]:::frontend
            THEME["Theme Toggle"]:::frontend
        end

        subgraph "Contexts"
            direction TB
            THEMECTX["ThemeContext"]:::frontend
        end

        subgraph "Services / Utils"
            direction TB
            DOWNLOADER["modelDownloader.js"]:::service
            AIMDL["aiModel.js"]:::service
        end
    end

    %% Connections
    VITE -->|"bundles & minifies"| HOST
    HOST -->|"serves index.html & bundles"| INDEX
    INDEX -->|"loads bootstrap"| MAIN
    MAIN -->|"renders root"| APP
    APP -->|"initializes"| THEMECTX
    APP -->|"renders"| NAV
    APP -->|"renders"| FOOTER
    APP -->|"routes to"| HOME
    APP -->|"routes to"| AIMODELS
    APP -->|"routes to"| UPLOAD
    APP -->|"routes to"| GALLERY
    APP -->|"routes to"| DASH
    APP -->|"routes to"| ABOUT
    APP -->|"routes to"| CONTACT
    APP -->|"routes to"| RESEARCH
    AIMODELS -->|"on load"| DOWNLOADER
    DOWNLOADER -->|"fetch model JSON"| STORAGE
    DOWNLOADER -->|"passes data to"| AIMDL
    AIMDL -->|"returns predictions"| AIMODELS
    UI_UPDATE["UI Update"]:::frontend
    AIMODELS -->|"updates"| UI_UPDATE

    %% Click Events
    click VITE "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/vite.config.js"
    click PKG "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/package.json"
    click ESLINT "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/eslint.config.js"
    click TAILWIND "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/tailwind.config.js"
    click STORAGE "https://github.com/ayushchoudhary6/biomarine-ai/tree/my-changes-branch/public/models/classification"
    click INDEX "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/index.html"
    click MAIN "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/main.jsx"
    click APP "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/App.jsx"
    click NAV "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/components/layout/Navigation.jsx"
    click FOOTER "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/components/layout/Footer.jsx"
    click MAP "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/components/ui/IndianOceanMap.jsx"
    click SPINNER "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/components/ui/LoadingSpinner.jsx"
    click THEME "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/components/ui/ThemeToggle.jsx"
    click HOME "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/Home.jsx"
    click AIMODELS "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/AIModels.jsx"
    click UPLOAD "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/DataUpload.jsx"
    click GALLERY "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/OtolithGallery.jsx"
    click DASH "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/Dashboard.jsx"
    click ABOUT "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/About.jsx"
    click CONTACT "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/Contact.jsx"
    click RESEARCH "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/pages/Research.jsx"
    click THEMECTX "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/contexts/ThemeContext.jsx"
    click DOWNLOADER "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/utils/modelDownloader.js"
    click AIMDL "https://github.com/ayushchoudhary6/biomarine-ai/blob/my-changes-branch/src/utils/aiModel.js"

    %% Styles
    classDef build fill:#d3d3d3,stroke:#999,stroke-width:1px
    classDef host fill:#bbbbbb,stroke:#777,stroke-width:1px
    classDef storage fill:#c6efce,stroke:#2e7d32,stroke-width:1px
    classDef frontend fill:#bbdefb,stroke:#0d47a1,stroke-width:1px
    classDef service fill:#ffe0b2,stroke:#ef6c00,stroke-width:1px
```
