# nesathanozturk/notluyorum architecture

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

- Interactive diagram: https://gitdiagram.com/nesathanozturk/notluyorum
- Repository: https://github.com/nesathanozturk/notluyorum

## Overview

##### Main System Components

A. Client-Side (Frontend)
- Next.js Application Layer
- Pages/Routes
- Components
- Layouts
- Context Providers
- Hooks

B. Backend Services
- Firebase Authentication
- Firestore Database

**[Client Browser] → [Next.js Frontend] → [Firebase Services]**

**[Pages/Routes] → [Layouts] → [Components] → [Context Providers]**

##### Detailed Component Breakdown

🔷 Blue Rectangles for Core Components:
- Pages (/app/notes, /app/page.tsx)
- Layouts (header, footer, sidebar, hero)
- Components (note-card, modal, inputs)

🟨 Yellow Hexagons for State Management:
- AuthContext
- NoteContext
- ThemeContext

🟩 Green Rectangles for External Services:
- Firebase Authentication
- Firestore Database

##### Data Flow Representation

- User authentication flow
- CRUD operations for notes
- State updates through context
- Component composition

##### Specific Implementation Details

Key architectural elements:
**Client Layer:**
- Protected Routes
- Authentication Flow
- Note Management
- Theme Management

**Component Layer:**
- Reusable Components
- Modal System
- Layout Structure

**Data Layer:**
- Firebase Config
- Firestore Operations
- Authentication State

##### Technical Stack Indicators

- Next.js
- TypeScript
- Firebase
- Tailwind CSS
- DaisyUI

Remember to highlight:
- The protected route mechanism
- Modal system for note operations
- Category filtering system
- Theme switching functionality
- Authentication flow

This will provide a clear understanding of how the application's various components interact while maintaining security and state management across the system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Next.js Application"
        Pages["Pages Layer"]
        Layout["Layout Layer"]
        Components["Component Layer"]
        State["State Management"]
        Hooks["Utility Hooks"]:::util
    end

    subgraph "External Services"
        Firebase["Firebase Services"]:::external
        Firestore["Firestore Database"]:::external
    end

    subgraph "Pages Layer"
        Home["Home Page"]:::page
        Notes["Notes Page"]:::page
    end

    subgraph "Layout Components"
        Header["Header"]:::layout
        Footer["Footer"]:::layout
        Sidebar["Sidebar"]:::layout
        Hero["Hero Section"]:::layout
        NotesLayout["Notes Layout"]:::layout
    end

    subgraph "Core Components"
        NoteCard["Note Card"]:::component
        Category["Category"]:::component
        Navbar["Navbar"]:::component
        ProtectedRoute["Protected Route"]:::auth
        NoAccess["No Access"]:::auth
        Modal["Modal System"]:::component
        Toggle["Theme Toggle"]:::component
        Inputs["Input Components"]:::component
    end

    subgraph "State Management"
        AuthContext["Auth Context"]:::context
        NoteContext["Note Context"]:::context
        ThemeContext["Theme Context"]:::context
    end

    subgraph "Containers"
        HomeContainer["Home Container"]:::container
        NoteContainer["Note Container"]:::container
    end

    Browser --> Pages
    Pages --> Layout
    Layout --> Components
    Components --> State
    State --> Firebase
    Firebase --> Firestore

    %% Component relationships
    Pages --> HomeContainer
    Pages --> NoteContainer
    Layout --> Header
    Layout --> Footer
    Layout --> Sidebar
    Layout --> Hero
    Layout --> NotesLayout
    Components --> NoteCard
    Components --> Category
    Components --> Navbar
    Components --> ProtectedRoute
    Components --> NoAccess
    Components --> Modal
    Components --> Toggle
    Components --> Inputs

    %% Click events
    click Home "https://github.com/nesathanozturk/notluyorum/blob/main/src/app/page.tsx"
    click Notes "https://github.com/nesathanozturk/notluyorum/blob/main/src/app/notes/page.tsx"
    click Header "https://github.com/nesathanozturk/notluyorum/blob/main/src/layouts/header/index.tsx"
    click Footer "https://github.com/nesathanozturk/notluyorum/blob/main/src/layouts/footer/index.tsx"
    click Sidebar "https://github.com/nesathanozturk/notluyorum/blob/main/src/layouts/sidebar/index.tsx"
    click Hero "https://github.com/nesathanozturk/notluyorum/blob/main/src/layouts/hero/index.tsx"
    click NotesLayout "https://github.com/nesathanozturk/notluyorum/blob/main/src/layouts/notes/index.tsx"
    click NoteCard "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/note-card/index.tsx"
    click Category "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/category/index.tsx"
    click Navbar "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/navbar/index.tsx"
    click ProtectedRoute "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/protected-route/index.tsx"
    click NoAccess "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/no-access/index.tsx"
    click AuthContext "https://github.com/nesathanozturk/notluyorum/blob/main/src/context/AuthContext.tsx"
    click NoteContext "https://github.com/nesathanozturk/notluyorum/blob/main/src/context/NoteContext.tsx"
    click ThemeContext "https://github.com/nesathanozturk/notluyorum/blob/main/src/context/ThemeContext.tsx"
    click Toggle "https://github.com/nesathanozturk/notluyorum/blob/main/src/components/toggle/index.tsx"
    click Inputs "https://github.com/nesathanozturk/notluyorum/tree/main/src/components/inputs"
    click Firebase "https://github.com/nesathanozturk/notluyorum/blob/main/src/config/firebase.ts"
    click HomeContainer "https://github.com/nesathanozturk/notluyorum/blob/main/src/containers/home-page/index.tsx"
    click NoteContainer "https://github.com/nesathanozturk/notluyorum/blob/main/src/containers/note-page/index.tsx"
    click Hooks "https://github.com/nesathanozturk/notluyorum/blob/main/src/hooks/use-window-size.tsx"

    %% Styling
    classDef page fill:#e1f5fe,stroke:#01579b
    classDef layout fill:#fff3e0,stroke:#ff6f00
    classDef component fill:#f3e5f5,stroke:#4a148c
    classDef context fill:#fff8e1,stroke:#ffa000
    classDef container fill:#e8f5e9,stroke:#1b5e20
    classDef auth fill:#ffebee,stroke:#b71c1c
    classDef external fill:#90caf9,stroke:#0d47a1
    classDef util fill:#f5f5f5,stroke:#212121
```
