# brulestl/tech-flow architecture

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

- Interactive diagram: https://gitdiagram.com/brulestl/tech-flow
- Repository: https://github.com/brulestl/tech-flow

## Overview

##### File structure
- Top-level: Dockerfile + dockerignore, env.local, package.json, Next.js config files, Tailwind & PostCSS configs.
- cache/: HuggingFace model/tokenizer blobs.
- public/: static assets + manifest.
- src/app/: the Next.js app router—routes for auth (login/signup), collections, recents, search, profile, and the root layout/page.
- src/components/: reusable UI pieces—layout (Header, Sidebar, Navbar), feature panels (ClusterPanel, SearchResultsPanel, SaveModal, etc.), UI primitives (SaveButton, SearchBar).
- src/lib/: supabaseClient.ts (initializes Supabase), utils.ts.
- src/styles/: global CSS.
- tsconfig, eslint, prettier, stylelint: code quality and typings.

##### README for additional insights

- Browser → Next.js (page requests)
- Browser ↔ Supabase (RPC via supabaseClient)
- Next.js → Supabase (server-side queries, if any)
- Next.js/Browser → Tokenizer Cache (file reads)

##### Detail is key
- Be explicit about data flow for each feature: auth flow, collections CRUD, recents retrieval, search calls, save operations.
- Both the static-asset serving (public/) and dynamic data pathways.
- Document any environment variables (env.local) that connect Next.js to Supabase.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Browser (React Client)" 
        style BrowserClient fill:#bbdefb,stroke:#000,stroke-width:1px
        BrowserClient["User's Browser"]:::client
        subgraph "Pages & Components" 
            style PagesComponents fill:#e3f2fd,stroke:#000,stroke-width:1px
            LoginPage["Login Page"]:::page
            SignupPage["Signup Page"]:::page
            CollectionsPage["Collections Page"]:::page
            CollectionsGrid["Collections Grid"]:::component
            RecentsPage["Recents Page"]:::page
            RecentsContent["Recents Content"]:::component
            SearchPageShell["Search Page Shell"]:::page
            SearchPageComp["SearchPage Component"]:::component
            ProfilePage["Profile Page"]:::page
            ProfileContent["Profile Content"]:::component
            HomePage["Home Page"]:::page
            Header["Header"]:::layout
            Sidebar["Sidebar"]:::layout
            MobileNavbar["Mobile Navbar"]:::layout
            StatsBar["Stats Bar"]:::layout
            LayoutClient["LayoutClient"]:::layout
            DashboardGrid["Dashboard Grid"]:::component
            ClusterPanel["ClusterPanel"]:::component
            SearchResultsPanel["SearchResultsPanel"]:::component
            SaveModal["SaveModal"]:::component
            RecentSavesList["RecentSavesList"]:::component
            ResourceCard["ResourceCard"]:::component
            SaveButton["SaveButton"]:::ui
            SearchBar["SearchBar"]:::ui
        end
    end

    %% Backend Tier
    subgraph "Docker Container" 
        style Container fill:#ffe0b2,stroke:#000,stroke-width:1px
        subgraph "Next.js App (Server & API)" 
            style NextApp fill:#c8e6c9,stroke:#000,stroke-width:1px
            AppRouter["Next.js App Router"]:::backend
            SupabaseClientInit["supabaseClient.ts"]:::backend
            Utils["utils.ts"]:::backend
            LayoutTS["Application Layout"]:::backend
        end
        TokenizerCache["Tokenizer Cache"]:::cache
        PublicStatic["public/ Static Assets"]:::infra
    end

    SupabaseService["Supabase\nAuth & Postgres"]:::db

    %% Relationships
    BrowserClient -->|Requests Pages| AppRouter
    BrowserClient -->|Calls Auth & Data| SupabaseService
    AppRouter -->|Server-side Queries| SupabaseService
    AppRouter -->|Reads Tokenizer| TokenizerCache
    BrowserClient -->|Loads Static Assets| PublicStatic
    AppRouter -->|Serves Static| PublicStatic

    %% Click Events
    click AppRouter "https://github.com/brulestl/tech-flow/tree/main/src/app/"
    click LoginPage "https://github.com/brulestl/tech-flow/blob/main/src/app/(auth)/login/page.tsx"
    click SignupPage "https://github.com/brulestl/tech-flow/blob/main/src/app/(auth)/signup/page.tsx"
    click CollectionsPage "https://github.com/brulestl/tech-flow/blob/main/src/app/collections/page.tsx"
    click CollectionsGrid "https://github.com/brulestl/tech-flow/blob/main/src/app/collections/CollectionsGrid.tsx"
    click RecentsPage "https://github.com/brulestl/tech-flow/blob/main/src/app/recents/page.tsx"
    click RecentsContent "https://github.com/brulestl/tech-flow/blob/main/src/app/recents/RecentsContent.tsx"
    click SearchPageShell "https://github.com/brulestl/tech-flow/blob/main/src/app/search/page.tsx"
    click SearchPageComp "https://github.com/brulestl/tech-flow/blob/main/src/app/search/SearchPage.tsx"
    click ProfilePage "https://github.com/brulestl/tech-flow/blob/main/src/app/profile/page.tsx"
    click ProfileContent "https://github.com/brulestl/tech-flow/blob/main/src/app/profile/ProfileContent.tsx"
    click HomePage "https://github.com/brulestl/tech-flow/blob/main/src/app/page.tsx"
    click LayoutTS "https://github.com/brulestl/tech-flow/blob/main/src/app/layout.tsx"
    click Header "https://github.com/brulestl/tech-flow/tree/main/src/components/layout/"
    click Sidebar "https://github.com/brulestl/tech-flow/tree/main/src/components/layout/"
    click MobileNavbar "https://github.com/brulestl/tech-flow/tree/main/src/components/layout/"
    click StatsBar "https://github.com/brulestl/tech-flow/tree/main/src/components/layout/"
    click LayoutClient "https://github.com/brulestl/tech-flow/tree/main/src/components/layout/"
    click DashboardGrid "https://github.com/brulestl/tech-flow/blob/main/src/components/dashboard/DashboardGrid.tsx"
    click ClusterPanel "https://github.com/brulestl/tech-flow/blob/main/src/components/features/ClusterPanel.tsx"
    click SearchResultsPanel "https://github.com/brulestl/tech-flow/blob/main/src/components/features/SearchResultsPanel.tsx"
    click SaveModal "https://github.com/brulestl/tech-flow/blob/main/src/components/features/SaveModal.tsx"
    click RecentSavesList "https://github.com/brulestl/tech-flow/blob/main/src/components/features/RecentSavesList.tsx"
    click ResourceCard "https://github.com/brulestl/tech-flow/blob/main/src/components/features/ResourceCard.tsx"
    click SaveButton "https://github.com/brulestl/tech-flow/blob/main/src/components/ui/SaveButton.tsx"
    click SearchBar "https://github.com/brulestl/tech-flow/blob/main/src/components/ui/SearchBar.tsx"
    click SupabaseClientInit "https://github.com/brulestl/tech-flow/blob/main/src/lib/supabaseClient.ts"
    click Utils "https://github.com/brulestl/tech-flow/blob/main/src/lib/utils.ts"
    click TokenizerCache "https://github.com/brulestl/tech-flow/tree/main/cache/huggingface/hub/models--Xenova--llama-3-tokenizer"
    click PublicStatic "https://github.com/brulestl/tech-flow/tree/main/public/"
    
    %% Styles
    classDef client fill:#bbdefb,stroke:#000
    classDef page fill:#bbdefb,stroke:#000
    classDef component fill:#bbdefb,stroke:#000
    classDef layout fill:#90caf9,stroke:#000
    classDef ui fill:#81d4fa,stroke:#000
    classDef backend fill:#c8e6c9,stroke:#000
    classDef db fill:#ffecb3,stroke:#000
    classDef cache fill:#e0e0e0,stroke:#000
    classDef infra fill:#ffe0b2,stroke:#000
```
