# garvit000/eco-bay architecture

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

- Interactive diagram: https://gitdiagram.com/garvit000/eco-bay
- Repository: https://github.com/garvit000/eco-bay

## Overview

##### Project type and purpose
- From the file tree and minimal README, this is a full-stack web application (“Eco-Bay”) built with Next.js (React + TypeScript) and Firebase.
- The frontend lives under src/app (Next.js 13 app router), and there’s a small “ecobaybackend” directory that encapsulates Firebase initialization, authentication logic (login.ts, useAuth.ts), and any server-side calls.

##### File structure
- Top-level tech/config files:
– next.config.ts, tsconfig.json, package.json, eslint.config.mjs, postcss.config.mjs
- Frontend:
– src/app/layout.tsx – Root layout
– src/app/page.tsx – Home page
– src/app/about/page.tsx, src/app/contact/page.tsx – Static pages
– src/app/login/page.tsx, src/app/register/page.tsx – Auth pages
– src/app/Components/* – Reusable React components (navbar.tsx, home.tsx, Req.tsx)
– globals.css – Global styles
- Backend helpers (ecobaybackend directory):
– lib/firebase.ts – Firebase SDK initialization
– login.ts – Server-side login logic (custom API or helper)
– useAuth.ts – React hook for client-side auth status

## Diagram (Mermaid)

```mermaid
graph TD
    Browser["User Web Browser"]:::external

    subgraph "Presentation Layer"
        Layout["Root Layout Component"]:::frontend
        HomePage["Home Page (Landing)"]:::frontend
        AboutPage["About Page"]:::frontend
        ContactPage["Contact Page"]:::frontend
        LoginPage["Login Page"]:::frontend
        RegisterPage["Register Page"]:::frontend
        Components["Reusable React Components"]:::frontend
        Navbar["Navbar Component"]:::frontend
        HomeComp["Home Section Component"]:::frontend
        ReqComp["Request Component"]:::frontend
        GlobalStyles["Global Stylesheet"]:::frontend
    end

    subgraph "Application Layer"
        NextServer["Next.js Server/API"]:::backend
        BackendHelpers["Backend Helpers Module"]:::backend
        FirebaseInit["Firebase SDK Initialization"]:::backend
        LoginLogic["Server-Side Login Logic"]:::backend
        UseAuth["Client-Side Auth Hook"]:::backend
    end

    subgraph "Configuration"
        NextConfig["Next.js Configuration"]:::deployment
        TSConfig["TypeScript Configuration"]:::deployment
        PackageJSON["Package Manifest"]:::deployment
        ESLintConfig["ESLint Configuration"]:::deployment
        PostCSSConfig["PostCSS Configuration"]:::deployment
    end

    subgraph "Data Layer"
        FirebaseAuth["Firebase Auth"]:::external
        Firestore["Firestore Database"]:::external
    end

    subgraph "Deployment"
        Hosting["Hosting / CDN"]:::deployment
        CICD["CI/CD Pipeline"]:::deployment
    end

    %% Connections
    Browser --> Layout
    Layout --> HomePage
    Layout --> AboutPage
    Layout --> ContactPage
    Layout --> LoginPage
    Layout --> RegisterPage
    Layout --> Components
    Layout --> GlobalStyles
    Components --> Navbar
    Components --> HomeComp
    Components --> ReqComp

    LoginPage --> UseAuth
    LoginPage --> LoginLogic
    UseAuth --> NextServer
    LoginLogic --> NextServer

    NextServer --> FirebaseInit
    FirebaseInit --> FirebaseAuth
    FirebaseInit --> Firestore
    NextServer --- Firestore

    NextServer --> Hosting
    Hosting --> Browser
    CICD --> NextServer
    CICD --> Hosting
    CICD --> FirebaseAuth
    CICD --> Firestore

    NextConfig --> NextServer
    TSConfig --> NextServer
    PackageJSON --> NextServer
    ESLintConfig --> NextServer
    PostCSSConfig --> NextServer

    %% Click Events
    click Layout "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/layout.tsx"
    click HomePage "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/page.tsx"
    click AboutPage "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/about/page.tsx"
    click ContactPage "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/contact/page.tsx"
    click LoginPage "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/login/page.tsx"
    click RegisterPage "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/register/page.tsx"
    click Components "https://github.com/garvit000/eco-bay/tree/master/ecobay/src/app/Components"
    click Navbar "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/Components/navbar.tsx"
    click HomeComp "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/Components/home.tsx"
    click ReqComp "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/Components/Req.tsx"
    click GlobalStyles "https://github.com/garvit000/eco-bay/blob/master/ecobay/src/app/globals.css"
    click BackendHelpers "https://github.com/garvit000/eco-bay/tree/master/ecobay/ecobaybackend"
    click FirebaseInit "https://github.com/garvit000/eco-bay/blob/master/ecobay/ecobaybackend/lib/firebase.ts"
    click LoginLogic "https://github.com/garvit000/eco-bay/blob/master/ecobay/ecobaybackend/login.ts"
    click UseAuth "https://github.com/garvit000/eco-bay/blob/master/ecobay/ecobaybackend/useAuth.ts"
    click NextConfig "https://github.com/garvit000/eco-bay/blob/master/ecobay/next.config.ts"
    click TSConfig "https://github.com/garvit000/eco-bay/blob/master/ecobay/tsconfig.json"
    click PackageJSON "https://github.com/garvit000/eco-bay/blob/master/ecobay/package.json"
    click ESLintConfig "https://github.com/garvit000/eco-bay/blob/master/ecobay/eslint.config.mjs"
    click PostCSSConfig "https://github.com/garvit000/eco-bay/blob/master/ecobay/postcss.config.mjs"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef backend fill:#D0F0C0,stroke:#22863a,color:#22863a
    classDef external fill:#FFE0B2,stroke:#D69E2E,color:#B9770E
    classDef deployment fill:#E0E0E0,stroke:#586069,color:#586069
```
