# muditarya7/pharma-site architecture

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

- Interactive diagram: https://gitdiagram.com/muditarya7/pharma-site
- Repository: https://github.com/muditarya7/pharma-site

## Overview

##### Project Type and Purpose
- This is a single-page application (SPA) front-end project built with React, TypeScript, and Vite.
- There is no dedicated backend service or database; the app is statically hosted (e.g., via Netlify) and may consume static data files or external APIs.

##### File Structure Analysis
- Top Level
- public/
– index.html, Netlify config, static images
- src/
– App.tsx, main.tsx (entry points)
– assets/ (UI components, hooks, data files)
– pages/ (route components)
– lib/ (utility functions)
– types/ (TypeScript type definitions)
- Build & Tooling
- vite.config.ts (build config, HMR)
- eslint.config.js (lint rules)
- tsconfig*.json (TS compiler options)

##### Relevant Architectural Patterns
- Component-based architecture: reusable UI components under src/assets/ui, page components under src/pages.
- SPA routing (likely React Router or similar) handled in App.tsx.
- Static hosting with CDN for public assets.
- Build pipeline managed by Vite: TS → JSX/TSX → bundle → dist.

##### Main Components
a. Developer Environment
– VS Code (or IDE)
– Git (version control)
– ESLint + Prettier (code quality)
– TypeScript compiler
– Vite (dev server + bundler)
b. Build & Deployment
– Vite build → dist folder
– Netlify (or any static host)
– CDN (serving public assets)
c. Runtime (Browser)
– index.html (root)
– React App (App.tsx → component tree)
- pages/ (routes: home, news, projects, etc.)
- assets/ UI components (buttons, cards, sliders)
- lib/utils (shared utilities)
- hooks (e.g., use-toast)
- data files (publications.tsx)
– External Services (optional)
- REST/GraphQL APIs or headless CMS (if integrated later)

##### Relationships & Data Flow
- Developer edits code → Lint/TS check → Vite dev server hot-reloads in browser.
- On build: Vite bundles JS/CSS/images → deploy to Netlify → CDN edge nodes.
- Browser requests index.html → loads bundled JS → React hydrates app → user navigates pages.
- Components fetch static data or call external APIs → render UI.

##### Architectural Patterns & Principles
- Single Source of Truth: state/hooks live in React context or custom hooks.
- Separation of Concerns:
- UI components (assets/ui) vs. layout components (assets/Header, Footer) vs. pages.
- Utilities and types isolated in src/lib and src/types.
- Modularization: each feature in its own folder (e.g., data/publications, imageSlider).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        VSCode["VS Code"]:::devTools
        Git["Git (Version Control)"]:::devTools
        ESLint["ESLint + Prettier"]:::devTools
        TSC["TypeScript Compiler"]:::devTools
        ViteDev["Vite Dev Server & Bundler"]:::devTools
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        ViteBuild["Vite Build → dist"]:::build
        Netlify["Netlify (Deploy)"]:::hosting
        CDN["CDN (Public Assets)"]:::hosting
    end

    %% Runtime / Browser
    subgraph "Browser / Runtime"
        direction TB
        HTML["index.html"]:::runtime
        ReactApp["React App Root"]:::runtime
        subgraph "SPA Modules"
            direction TB
            subgraph "Page Routes"
                direction TB
                Home["home.tsx"]:::runtime
                News["news.tsx"]:::runtime
                NewsDetail["NewsDetail.tsx"]:::runtime
                Projects["projects.tsx"]:::runtime
                PublicationsPage["publications.tsx"]:::runtime
                Research["research.tsx"]:::runtime
                Innovations["innovations.tsx"]:::runtime
                About["about.tsx"]:::runtime
                NotFound["NotFound.tsx"]:::runtime
            end
            subgraph "UI Component Library"
                direction TB
                UIComp["src/assets/ui/"]:::runtime
            end
            subgraph "Layout Components"
                direction TB
                Header["Header.tsx"]:::runtime
                Footer["Footer.tsx"]:::runtime
            end
            subgraph "Feature Components"
                direction TB
                Card["Card.tsx"]:::runtime
                ImageSlider["ImageSlider.tsx"]:::runtime
                NewsCard["NewsCard.tsx"]:::runtime
                ThemeCard["Research-ThemeCard.tsx"]:::runtime
                Hero["Research-hero.tsx"]:::runtime
                StatCard["StatCard.tsx"]:::runtime
                Navigation["navigation.tsx"]:::runtime
                PubFilters["publication-filters.tsx"]:::runtime
                PubHero["publications-hero.tsx"]:::runtime
            end
            subgraph "Hooks, Data, Utils, Types, Styles"
                direction TB
                Hook["use-toast.tsx"]:::runtime
                DataFiles[(Static Data Files)]:::runtime
                Utils["utils.ts"]:::runtime
                Types["api.tsx / vite-env.d.ts"]:::runtime
                Styles["CSS & Images"]:::runtime
            end
        end
        ExternalAPI[(External APIs)]:::external
    end

    %% Project Metadata
    subgraph "Project Metadata"
        direction TB
        Package["package.json / package-lock.json"]:::meta
        Docs[".gitignore / README.md"]:::meta
    end

    %% Connections
    VSCode -->|edits code| ESLint
    ESLint -->|lint check| TSC
    TSC -->|compiles| ViteDev
    ViteDev -->|hot reload| HTML
    ViteDev -->|bundle| ViteBuild
    ViteBuild --> Netlify
    Netlify --> CDN
    CDN -->|serves| HTML
    HTML -->|loads| ReactApp
    ReactApp --> Home
    ReactApp --> News
    ReactApp --> Projects
    ReactApp --> PublicationsPage
    ReactApp --> Research
    ReactApp --> Innovations
    ReactApp --> About
    ReactApp --> NotFound
    ReactApp --> UIComp
    ReactApp --> Header
    ReactApp --> Footer
    ReactApp --> Card
    ReactApp --> ImageSlider
    ReactApp --> NewsCard
    ReactApp --> ThemeCard
    ReactApp --> Hero
    ReactApp --> StatCard
    ReactApp --> Navigation
    ReactApp --> PubFilters
    ReactApp --> PubHero
    ReactApp --> Hook
    ReactApp --> DataFiles
    ReactApp --> Utils
    ReactApp --> Types
    ReactApp --> Styles
    ReactApp --> ExternalAPI

    %% Click Events
    click ESLint "https://github.com/muditarya7/pharma-site/blob/main/eslint.config.js"
    click TSC "https://github.com/muditarya7/pharma-site/blob/main/tsconfig.json"
    click TSC "https://github.com/muditarya7/pharma-site/blob/main/tsconfig.app.json"
    click TSC "https://github.com/muditarya7/pharma-site/blob/main/tsconfig.node.json"
    click ViteDev "https://github.com/muditarya7/pharma-site/blob/main/vite.config.ts"
    click Netlify "https://github.com/muditarya7/pharma-site/blob/main/public/netlify.toml"
    click HTML "https://github.com/muditarya7/pharma-site/blob/main/index.html"
    click ReactApp "https://github.com/muditarya7/pharma-site/blob/main/src/main.tsx"
    click ReactApp "https://github.com/muditarya7/pharma-site/blob/main/src/App.tsx"
    click Home "https://github.com/muditarya7/pharma-site/blob/main/src/pages/home.tsx"
    click News "https://github.com/muditarya7/pharma-site/blob/main/src/pages/news.tsx"
    click NewsDetail "https://github.com/muditarya7/pharma-site/blob/main/src/pages/NewsDetail.tsx"
    click Projects "https://github.com/muditarya7/pharma-site/blob/main/src/pages/projects.tsx"
    click PublicationsPage "https://github.com/muditarya7/pharma-site/blob/main/src/pages/publications.tsx"
    click Research "https://github.com/muditarya7/pharma-site/blob/main/src/pages/research.tsx"
    click Innovations "https://github.com/muditarya7/pharma-site/blob/main/src/pages/innovations.tsx"
    click About "https://github.com/muditarya7/pharma-site/blob/main/src/pages/about.tsx"
    click NotFound "https://github.com/muditarya7/pharma-site/blob/main/src/pages/NotFound.tsx"
    click UIComp "https://github.com/muditarya7/pharma-site/tree/main/src/assets/ui/"
    click Header "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Header.tsx"
    click Footer "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Footer.tsx"
    click Card "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Card.tsx"
    click ImageSlider "https://github.com/muditarya7/pharma-site/blob/main/src/assets/ImageSlider.tsx"
    click NewsCard "https://github.com/muditarya7/pharma-site/blob/main/src/assets/NewsCard.tsx"
    click ThemeCard "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Research-ThemeCard.tsx"
    click Hero "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Research-hero.tsx"
    click StatCard "https://github.com/muditarya7/pharma-site/blob/main/src/assets/StatCard.tsx"
    click Navigation "https://github.com/muditarya7/pharma-site/blob/main/src/assets/navigation.tsx"
    click PubFilters "https://github.com/muditarya7/pharma-site/blob/main/src/assets/publication-filters.tsx"
    click PubHero "https://github.com/muditarya7/pharma-site/blob/main/src/assets/publications-hero.tsx"
    click Hook "https://github.com/muditarya7/pharma-site/blob/main/src/assets/hooks/use-toast.tsx"
    click DataFiles "https://github.com/muditarya7/pharma-site/blob/main/src/assets/data/publications.tsx"
    click Utils "https://github.com/muditarya7/pharma-site/blob/main/src/lib/utils.ts"
    click Types "https://github.com/muditarya7/pharma-site/blob/main/src/types/api.tsx"
    click Types "https://github.com/muditarya7/pharma-site/blob/main/src/vite-env.d.ts"

    %% Styles & Assets clicks
    click Styles "https://github.com/muditarya7/pharma-site/blob/main/src/assets/card.css"
    click Styles "https://github.com/muditarya7/pharma-site/blob/main/src/assets/imageSlider.css"
    click Styles "https://github.com/muditarya7/pharma-site/blob/main/src/assets/Header.module.css"
    click Styles "https://github.com/muditarya7/pharma-site/blob/main/src/index.css"
    click Styles "https://github.com/muditarya7/pharma-site/tree/main/public/images/"

    %% Metadata clicks
    click Package "https://github.com/muditarya7/pharma-site/blob/main/package.json"
    click Package "https://github.com/muditarya7/pharma-site/blob/main/package-lock.json"
    click Docs "https://github.com/muditarya7/pharma-site/blob/main/.gitignore"
    click Docs "https://github.com/muditarya7/pharma-site/blob/main/README.md"

    %% Class Definitions
    classDef devTools fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef build fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef hosting fill:#d4edda,stroke:#333,stroke-width:1px
    classDef runtime fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef external fill:#d6d8db,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef meta fill:#e2e2e2,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
