# santoshsomu/trinethra_foundation architecture

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

- Interactive diagram: https://gitdiagram.com/santoshsomu/trinethra_foundation
- Repository: https://github.com/santoshsomu/trinethra_foundation

## Overview

##### Project type and purpose
- This is a single-page React application built with Vite, TypeScript, Tailwind CSS, and shadcn-ui.
- Its purpose is to present a marketing/campaign site (with pages like Home, About, Donate, Contact, Programs, PrivacyPolicy) and collect donations via Razorpay.

##### File structure
- Top-level config & lock files (`package.json`, `pnpm-lock.yaml`, `vite.config.ts`, `tailwind.config.ts`, `tsconfig.json`): define build, lint, TypeScript, and CSS pipeline.
- public/: static assets and metadata (`robots.txt`, `index.html`).
- src/main.tsx + src/index.css: application entry point and global styling.
- src/App.tsx + src/App.css: root component and styles.
- src/pages/: route views (Index, About, Donate, Contact, Programs, PrivacyPolicy, NotFound).
- src/components/: reusable UI building blocks
- layout/: global Navbar, Footer
- sections/: page-specific content (Hero, Mission, StatsCounter, TestimonialCarousel, DonateForm)
- ui/: atomic and molecular components (buttons, cards, dialogs, form controls)
- src/api/razorpay.ts + src/lib/payments.ts: client-side payment integration and utility functions.
- src/hooks/: custom React hooks.

##### README for additional insights
- Confirms tech stack (Vite, React, TypeScript, shadcn-ui, Tailwind CSS).
- Development flow is local (`npm run dev`) or via Lovable platform; deployment is a one-click static publish with custom domain support.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment & Configuration
    subgraph "Developer Environment & Configuration" 
        direction TB
        pkg["package.json"]:::dev
        lock["pnpm-lock.yaml"]:::dev
        tsconfig["tsconfig.json"]:::dev
        tsapp["tsconfig.app.json"]:::dev
        tsnode["tsconfig.node.json"]:::dev
        vitecfg["vite.config.ts"]:::dev
        tailwindcfg["tailwind.config.ts"]:::dev
        postcss["postcss.config.js"]:::dev
    end

    %% Build System
    subgraph "Build System (Vite & Tailwind CSS)" 
        direction TB
        vitebuild["Vite Bundler"]:::build
        postcssbuild["PostCSS Processor"]:::build
        tailwindbuild["Tailwind CSS"]:::build
    end

    %% Deployment & Hosting
    deploy["Static Hosting & CDN (Lovable)"]:::external

    %% Browser & SPA
    subgraph "Browser"
        direction TB
        SPA["React SPA"]:::frontend

        subgraph "SPA Structure"
            direction TB
            entry["Entry Point\n(src/main.tsx,\nsrc/index.css)"]:::frontend
            approot["App Component\n(src/App.tsx,\nsrc/App.css)"]:::frontend

            subgraph "Routing Layer (Pages)" 
                direction TB
                pages["src/pages/*.tsx"]:::frontend
            end

            subgraph "Layout Components"
                direction TB
                layout["src/components/layout"]:::frontend
            end

            subgraph "Section Components"
                direction TB
                sections["src/components/sections"]:::frontend
            end

            subgraph "UI Library (shadcn-ui)"
                direction TB
                uilib["src/components/ui"]:::frontend
            end

            subgraph "API & Utilities"
                direction TB
                api["src/api/razorpay.ts"]:::frontend
                utils["src/lib/payments.ts"]:::frontend
            end

            subgraph "Custom Hooks"
                direction TB
                hooks["src/hooks"]:::frontend
            end
        end
    end

    %% External Service
    razorpay["Razorpay Payment Gateway"]:::external

    %% Static Assets
    static["Static Assets\n(public/, src/assets)"]:::static

    %% Connections
    pkg --> vitebuild
    lock --> vitebuild
    tsconfig --> vitebuild
    vitecfg --> vitebuild
    postcss --> postcssbuild
    tailwindcfg --> tailwindbuild

    vitebuild --> deploy
    postcssbuild --> deploy
    tailwindbuild --> deploy

    deploy -->|Serves| SPA

    SPA -->|Renders| entry
    entry --> approot
    approot --> pages
    approot --> layout
    approot --> sections
    approot --> uilib
    approot --> api
    approot --> hooks

    sections --> api
    api -->|"REST calls"| razorpay
    razorpay -->|"callback"| api

    deploy --> static
    SPA --> static

    %% Click Events
    click pkg "https://github.com/santoshsomu/trinethra_foundation/blob/main/package.json"
    click lock "https://github.com/santoshsomu/trinethra_foundation/blob/main/pnpm-lock.yaml"
    click tsconfig "https://github.com/santoshsomu/trinethra_foundation/blob/main/tsconfig.json"
    click tsapp "https://github.com/santoshsomu/trinethra_foundation/blob/main/tsconfig.app.json"
    click tsnode "https://github.com/santoshsomu/trinethra_foundation/blob/main/tsconfig.node.json"
    click vitecfg "https://github.com/santoshsomu/trinethra_foundation/blob/main/vite.config.ts"
    click tailwindcfg "https://github.com/santoshsomu/trinethra_foundation/blob/main/tailwind.config.ts"
    click postcss "https://github.com/santoshsomu/trinethra_foundation/blob/main/postcss.config.js"
    click entry "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/main.tsx"
    click entry "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/index.css"
    click approot "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/App.tsx"
    click approot "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/App.css"
    click pages "https://github.com/santoshsomu/trinethra_foundation/tree/main/src/pages"
    click layout "https://github.com/santoshsomu/trinethra_foundation/tree/main/src/components/layout"
    click sections "https://github.com/santoshsomu/trinethra_foundation/tree/main/src/components/sections"
    click uilib "https://github.com/santoshsomu/trinethra_foundation/tree/main/src/components/ui"
    click api "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/api/razorpay.ts"
    click utils "https://github.com/santoshsomu/trinethra_foundation/blob/main/src/lib/payments.ts"
    click hooks "https://github.com/santoshsomu/trinethra_foundation/tree/main/src/hooks"

    %% Styles
    classDef dev fill:#f5f5f5,stroke:#999,stroke-width:1px;
    classDef build fill:#ffd699,stroke:#cc8400,stroke-width:1px;
    classDef frontend fill:#cce5ff,stroke:#3399ff,stroke-width:1px;
    classDef external fill:#e0ccff,stroke:#9966cc,stroke-width:1px;
    classDef static fill:#d5f5e3,stroke:#1abc9c,stroke-width:1px;
```
