# aniket04bit/rebin-iitm architecture

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

- Interactive diagram: https://gitdiagram.com/aniket04bit/rebin-iitm
- Repository: https://github.com/aniket04bit/rebin-iitm

## Overview

##### Project type and purpose
- This is a full-stack web application built with React (TSX + Vite + Tailwind), which provides a toolkit of recyclability, functional utility indicators, and value estimators for various waste streams.
- It uses Supabase for backend services—database, auth, and serverless functions (e.g., send-email)—and EmailJS for transactional emails.

##### File structure
- Top-level: package.json, Vite & Tailwind configs, Supabase config.
- public/: static assets (robots.txt, index.html).
- src/: the React app’s source
- pages/: route components (Home, Toolkit, ContactUs, etc.)
- components/: shared UI (ui/) and domain components (toolkit/, layout/)
- hooks/, lib/: reusable logic/utilities
- config/: EmailJS config
- integrations/supabase/: Supabase client & types
- main.tsx & index.css: app entry
- supabase/:
- config.toml: Supabase project settings
- migrations/: SQL schema dumps
- functions/send-email/: serverless Typescript function

##### README for additional insights
- (Empty here.) Entire architectural detail must be inferred from the code structure and configs.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client: React SPA"
        direction TB
        User["User"]:::external --> Browser["Browser"]:::frontend
        Browser --> ReactSPA["React SPA"]:::frontend

        ReactSPA --> Main
        Main["main.tsx"]:::frontend
        click Main "https://github.com/aniket04bit/rebin-iitm/blob/main/src/main.tsx"

        ReactSPA --> App
        App["App.tsx"]:::frontend
        click App "https://github.com/aniket04bit/rebin-iitm/blob/main/src/App.tsx"

        ReactSPA --> CSS
        CSS["index.css"]:::frontend
        click CSS "https://github.com/aniket04bit/rebin-iitm/blob/main/src/index.css"

        subgraph "Pages (src/pages)"
            direction TB
            Pages["Pages"]:::frontend
        end
        click Pages "https://github.com/aniket04bit/rebin-iitm/tree/main/src/pages"

        subgraph "Layout Components (src/components/layout)"
            direction TB
            Header["Header.tsx"]:::frontend
            Footer["Footer.tsx"]:::frontend
        end
        click Header "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/layout/Header.tsx"
        click Footer "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/layout/Footer.tsx"

        subgraph "Toolkit Domain Components (src/components/toolkit)"
            direction TB
            FUI["FunctionalUtilityIndicator.tsx"]:::frontend
            PRI["PileRecyclabilityIndex.tsx"]:::frontend
            PVE["PileValueEstimator.tsx"]:::frontend
            RI["RecyclabilityIndex.tsx"]:::frontend
            RepI["RepurposabilityIndex.tsx"]:::frontend
        end
        click FUI "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/toolkit/FunctionalUtilityIndicator.tsx"
        click PRI "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/toolkit/PileRecyclabilityIndex.tsx"
        click PVE "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/toolkit/PileValueEstimator.tsx"
        click RI "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/toolkit/RecyclabilityIndex.tsx"
        click RepI "https://github.com/aniket04bit/rebin-iitm/blob/main/src/components/toolkit/RepurposabilityIndex.tsx"

        subgraph "Atomic UI Components (src/components/ui)"
            direction TB
            UI["UI Components"]:::frontend
        end
        click UI "https://github.com/aniket04bit/rebin-iitm/tree/main/src/components/ui"

        subgraph "Custom Hooks (src/hooks)"
            direction TB
            ToastHook["use-toast.ts"]:::frontend
            MobileHook["use-mobile.tsx"]:::frontend
        end
        click ToastHook "https://github.com/aniket04bit/rebin-iitm/blob/main/src/hooks/use-toast.ts"
        click MobileHook "https://github.com/aniket04bit/rebin-iitm/blob/main/src/hooks/use-mobile.tsx"

        Lib["Utils (src/lib/utils.ts)"]:::frontend
        click Lib "https://github.com/aniket04bit/rebin-iitm/blob/main/src/lib/utils.ts"

        ConfigEmail["emailjs.ts"]:::frontend
        click ConfigEmail "https://github.com/aniket04bit/rebin-iitm/blob/main/src/config/emailjs.ts"

        ReactSPA --> Pages
        ReactSPA --> Header
        ReactSPA --> FUI
        ReactSPA --> UI
        ReactSPA --> ToastHook
        ReactSPA --> Lib
        ReactSPA --> ConfigEmail
        ReactSPA --> SupabaseClient
        ReactSPA --> SupabaseTypes
    end

    %% Integration Layer
    subgraph "Integration: Supabase Client"
        direction TB
        SupabaseClient["client.ts"]:::backend
        click SupabaseClient "https://github.com/aniket04bit/rebin-iitm/blob/main/src/integrations/supabase/client.ts"
        SupabaseTypes["types.ts"]:::backend
        click SupabaseTypes "https://github.com/aniket04bit/rebin-iitm/blob/main/src/integrations/supabase/types.ts"
    end

    %% Backend Services
    subgraph "Backend Services: Supabase"
        direction TB
        AuthDB["Auth & PostgreSQL"]:::database
        Migrations["DB Migrations"]:::database
        click Migrations "https://github.com/aniket04bit/rebin-iitm/blob/main/supabase/migrations/20251116101205_remix_migration_from_pg_dump.sql"
        ConfigToml["config.toml"]:::backend
        click ConfigToml "https://github.com/aniket04bit/rebin-iitm/blob/main/supabase/config.toml"
    end

    SupabaseClient --> AuthDB
    SupabaseClient -->|migrations| Migrations

    %% Serverless Functions
    subgraph "Serverless Functions"
        direction TB
        EdgeEmail["send-email"]:::function
        click EdgeEmail "https://github.com/aniket04bit/rebin-iitm/blob/main/supabase/functions/send-email/index.ts"
    end

    ReactSPA -->|invoke| EdgeEmail
    EdgeEmail -->|send via| EmailService

    %% External Service
    EmailService["EmailJS Service"]:::external

    %% Styles
    classDef frontend fill:#cceeff,stroke:#0366d6,color:#000;
    classDef backend fill:#e8f0ff,stroke:#1f78b4,color:#000;
    classDef database fill:#ccffcc,stroke:#28a745,color:#000;
    classDef function fill:#ffe4b5,stroke:#ff8c00,color:#000;
    classDef external fill:#e0e0e0,stroke:#666,color:#000;
```
