# arqam365/grabbix architecture

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

- Interactive diagram: https://gitdiagram.com/arqam365/grabbix
- Repository: https://github.com/arqam365/grabbix

## Overview

##### Main Components

a. Client-Side Layer:
- Pages (Home, About, Products, Contact, Admin)
- Client-side Components (MobileNav)
- Static Assets (public directory)

b. Next.js Framework Layer:
- App Router (new Next.js 13+ feature)
- Server Components
- Client Components
- API Routes

c. Backend Services:
- Firebase Integration (shown by firebase.ts)
- Email Service (indicated by api/send-email)

d. Build & Optimization Layer:
- Build tools and configurations:
- Tailwind CSS
- TypeScript
- PostCSS

##### Component Relationships

- Client requests → App Router → Server Components
- API Routes → External Services (Firebase, Email)
- Build Tools → Output Bundle
- Static Assets → CDN

##### Specific Implementation Details

- Blue: Next.js components
- Orange: Firebase services
- Green: API routes
- Purple: Build tools
- Grey: Static assets

**┌─────────────────────────────────────┐**
- Client Layer             │
- ┤
- Next.js App Router          │
- ┤
- Server Components  │  API Routes  │
- ┤
- External Services (Firebase/Email) │
- ┘

##### Important Elements to Highlight

- App Router Architecture:
- Hierarchical routing structure (/about, /products, /contact, /admin)
- Api/send-email route
- Server vs. client components

- Integration Points:
- Firebase connection
- Email service integration
- Static asset delivery

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Pages["Client Pages"]
        MobileNav["Mobile Navigation"]:::component
        StaticAssets["Static Assets"]:::component
    end

    subgraph "Next.js Framework"
        AppRouter["App Router"]:::nextjs
        Layout["Root Layout"]:::component
        
        subgraph "Server Components"
            HomePage["Home Page"]:::page
            AboutPage["About Page"]:::page
            ProductsPage["Products Page"]:::page
            ContactPage["Contact Page"]:::page
            AdminPage["Admin Page"]:::page
        end
        
        subgraph "API Layer"
            APIRoutes["API Routes"]:::api
            EmailService["Email Service"]:::api
        end
    end

    subgraph "External Services"
        Firebase["Firebase"]:::external
        EmailProvider["Email Provider"]:::external
    end

    subgraph "Build & Optimization"
        TailwindCSS["Tailwind CSS"]:::build
        TypeScript["TypeScript"]:::build
        PostCSS["PostCSS"]:::build
    end

    Pages --> AppRouter
    AppRouter --> Layout
    Layout --> |Routes to| HomePage
    Layout --> |Routes to| AboutPage
    Layout --> |Routes to| ProductsPage
    Layout --> |Routes to| ContactPage
    Layout --> |Routes to| AdminPage
    APIRoutes --> Firebase
    EmailService --> EmailProvider
    
    %% Component Mappings
    click MobileNav "https://github.com/arqam365/grabbix/blob/master/src/app/MobileNav.tsx"
    click StaticAssets "https://github.com/arqam365/grabbix/tree/master/public/"
    click Layout "https://github.com/arqam365/grabbix/blob/master/src/app/layout.tsx"
    click HomePage "https://github.com/arqam365/grabbix/blob/master/src/app/page.tsx"
    click AboutPage "https://github.com/arqam365/grabbix/blob/master/src/app/about/page.tsx"
    click ProductsPage "https://github.com/arqam365/grabbix/blob/master/src/app/products/page.tsx"
    click ContactPage "https://github.com/arqam365/grabbix/blob/master/src/app/contact/page.tsx"
    click AdminPage "https://github.com/arqam365/grabbix/blob/master/src/app/admin/page.tsx"
    click EmailService "https://github.com/arqam365/grabbix/blob/master/src/app/api/send-email/route.js"
    click Firebase "https://github.com/arqam365/grabbix/blob/master/src/firebase.ts"
    click TailwindCSS "https://github.com/arqam365/grabbix/blob/master/tailwind.config.ts"
    click TypeScript "https://github.com/arqam365/grabbix/blob/master/tsconfig.json"
    click PostCSS "https://github.com/arqam365/grabbix/blob/master/postcss.config.mjs"
    click APIRoutes "https://github.com/arqam365/grabbix/tree/master/src/app/api"

    classDef page fill:#e1f5fe,stroke:#01579b
    classDef component fill:#fff3e0,stroke:#ff6f00
    classDef nextjs fill:#bbdefb,stroke:#1976d2
    classDef api fill:#e8f5e9,stroke:#2e7d32
    classDef external fill:#f3e5f5,stroke:#7b1fa2
    classDef build fill:#fafafa,stroke:#424242
```
