# tahmidyouthlink/youthlink-tech architecture

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

- Interactive diagram: https://gitdiagram.com/tahmidyouthlink/youthlink-tech
- Repository: https://github.com/tahmidyouthlink/youthlink-tech

## Overview

##### Project type and purpose
- This is a full‐stack web application built with Next.js on the front end and Firebase for authentication and data storage. It provides a public‐facing marketing site (About Us, Our Work, Services, Contact Us) alongside an authenticated admin dashboard (CRUD interfaces for blogs, careers, work items, users, etc.).

##### File structure
- Top‐level: configuration files (.env, next.config.mjs, Tailwind, ESLint, Prettier) and package.json for dependency management.
- public/: all static assets (images, videos, Lottie animations, JSON metadata).
- src/app/: Next.js “app” directory containing routing folders. Under (withLayout) live public pages; under dashboard live protected admin pages.
- src/components/: reusable React components (layout, navigation, forms, tables, loading spinners).
- src/hooks/: custom React hooks for data‐fetching and state (useBlogs, useJobs, useAuth, etc.).
- src/utils/Provider/: context providers and route‐guards (AuthProvider, AdminRoute, PrivateRoute, ReactTanstackProvider).
- src/Firebase/: Firebase configuration file.

##### README for additional insights
- Bootstrapped via create-next-app, deployed on Vercel.
- Uses next/font for optimization and Tailwind for styling.
- No custom API routes—data calls go directly from the client (via custom hooks) to Firebase’s SDK.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser
    Browser["User Browser"]:::browser

    %% Vercel & Next.js Application
    subgraph "Vercel Host & Next.js App" 
        direction TB
        NextApp["Next.js Application"]:::backend

        %% Providers Layer
        subgraph "Providers" 
            direction TB
            TanstackP["ReactTanstackProvider"]:::provider
            AuthP["AuthProvider"]:::provider
            AdminR["AdminRoute & PrivateRoute"]:::provider
        end

        %% App Router Layer
        subgraph "App Router"
            direction TB
            subgraph "Public Site (SSG)" 
                direction TB
                Home["Home Page"]:::frontend
                About["About Us Page"]:::frontend
                OurWork["Our Work Page"]:::frontend
                Services["Services Page"]:::frontend
                Contact["Contact Us Page"]:::frontend
            end
            subgraph "Admin Dashboard (CSR/SSR)" 
                direction TB
                DashLayout["Dashboard Layout"]:::frontend
                DashHome["Dashboard Home"]:::frontend
                AddBlog["Add Blog Page"]:::frontend
                AllBlog["All Blogs Page"]:::frontend
                BlogDetails["Blog Details Page"]:::frontend
            end
        end
    end

    %% Components & Hooks
    subgraph "Components & Data Layer"
        direction TB
        subgraph "UI Components" 
            direction TB
            Header["Header"]:::frontend
            Footer["Footer"]:::frontend
            SideNav["SideNavbar"]:::frontend
            DashNav["DashboardNavbar"]:::frontend
            BlogTable["BlogTable"]:::frontend
        end
        subgraph "Custom Hooks (Data Access)" 
            direction TB
            useAuth["useAuth"]:::data
            useBlogs["useBlogs"]:::data
            useJobs["useJobs"]:::data
            useWorks["useWorks"]:::data
        end
    end

    %% External Services & CDN
    subgraph "Firebase Services" 
        direction TB
        AuthSvc["Firebase Auth"]:::external
        Firestore["Firestore DB"]:::external
    end
    CDN["Static Assets CDN (public/)"]:::static

    %% Connections
    Browser -->|"HTTP(S) GET/SSR/CSR"| NextApp
    NextApp -->|"Serve Static Assets"| CDN
    Browser -->|"Fetch Static Assets"| CDN

    NextApp -->|wraps| TanstackP -->|wraps| AuthP -->|wraps| AdminR
    AdminR -->|guards| DashLayout

    Home -->|"SSG render"| NextApp
    About -->|"SSG render"| NextApp
    OurWork -->|"SSG render"| NextApp
    Services -->|"SSG render"| NextApp
    Contact -->|"SSG render"| NextApp

    DashLayout --> DashHome
    DashHome --> AddBlog
    DashHome --> AllBlog
    AllBlog --> BlogDetails

    %% Client-side Data Flow
    Home -->|"uses hook"| useBlogs
    AllBlog -->|"uses hook"| useBlogs
    AddBlog -->|"uses hook"| useBlogs
    BlogDetails -->|"uses hook"| useBlogs

    useAuth -->|"SDK call"| AuthSvc
    useBlogs -->|"SDK call"| Firestore
    useJobs -->|"SDK call"| Firestore
    useWorks -->|"SDK call"| Firestore

    %% Components Integration
    Home --> Header & Footer & Sidebar
    DashHome --> DashNav & BlogTable

    %% Click Events
    click NextApp "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/next.config.mjs"
    click AuthSvc "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/Firebase/Firebase.config.js"
    click Home "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/(withLayout)/page.js"
    click About "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/(withLayout)/about-us/page.js"
    click OurWork "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/(withLayout)/our-work/page.js"
    click Services "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/(withLayout)/services/page.js"
    click Contact "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/(withLayout)/contact-us/page.js"
    click DashLayout "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/dashboard/layout.js"
    click DashHome "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/dashboard/page.js"
    click AddBlog "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/dashboard/addBlog/page.js"
    click AllBlog "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/dashboard/allBlog/page.js"
    click BlogDetails "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/app/dashboard/blogDetails/[id]/page.js"
    click useAuth "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/hooks/useAuth.jsx"
    click useBlogs "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/hooks/useBlogs.js"
    click useJobs "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/hooks/useJobs.js"
    click useWorks "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/hooks/useWorks.js"
    click TanstackP "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/utils/Provider/ReactTanstackProvider.js"
    click AuthP "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/utils/Provider/AuthProvider.js"
    click AdminR "https://github.com/tahmidyouthlink/youthlink-tech/blob/main/src/utils/Provider/AdminRoute.js"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef backend fill:#e2e3e5,stroke:#6c757d,color:#383d41
    classDef provider fill:#d4edda,stroke:#155724,color:#155724
    classDef data fill:#d1ecf1,stroke:#0c5460,color:#0c5460
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef static fill:#e2e3e5,stroke:#6c757d,color:#383d41
    classDef browser fill:#f8d7da,stroke:#721c24,color:#721c24
```
