# jashkarangiya/daily-bloom-journal architecture

> Architecture diagram of the GitHub repository jashkarangiya/daily-bloom-journal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jashkarangiya/daily-bloom-journal
- Repository: https://github.com/jashkarangiya/daily-bloom-journal

## Overview

##### Project type and purpose
- This is a single-page journaling application (“Daily Bloom Journal”) built entirely in the frontend.

##### File structure
- Top-level config and build scripts: package.json, Vite config (vite.config.ts), tsconfig.*, Tailwind config.
- src/
- pages/ (Index.tsx, NotFound.tsx) – the SPA routes
- components/ – feature components (DailyQuote, HabitManager, JournalModal, TodayView, StatsView, YearGrid, SearchResults, SettingsModal, Navigation, NavLink, PlantTile, PlantIcons)
- components/ui/ – low-level UI primitives (buttons, dialogs, forms, etc.) from shadcn-ui + Radix + Tailwind
- hooks/ (use-mobile, use-toast) – custom React hooks for cross-cutting concerns
- lib/ (journalData.ts, utils.ts) – data access layer (likely using localStorage or IndexedDB) and helper functions
- main.tsx & App.tsx – application entry point and root component
- public/ – static assets and index.html

##### README for additional insights
- No backend: users deploy to static hosts (Vercel, Netlify, GitHub Pages)
- Build pipeline: “npm run dev” starts Vite dev server; “npm run build” outputs /dist for deployment
- Tech stack: Vite, React, TypeScript, Tailwind CSS, shadcn-ui

a. Main components
- User’s Browser (SPA client)
- React Application
– Pages router (Index, NotFound)
– Feature components (JournalModal, TodayView, YearGrid, StatsView, etc.)
– UI library layer (components/ui)
– State & data layer (hooks + lib/journalData.ts)
- Data Persistence
– localStorage or IndexedDB (via journalData.ts)
- Build & Deployment Pipeline
– Node.js & npm
– Vite dev server (localhost:8080)
– Vite build → dist folder
– Static hosting (Vercel/Netlify/GitHub Pages)

b. Relationships and interactions
- User actions → React pages/components → update in-memory state via hooks → journalData.ts writes to localStorage → components re-render.
- UI components (from components/ui) are composed by feature components.
- Router in App.tsx picks pages based on URL.
- Build tools (Vite) transform TSX, Tailwind CSS → bundling → serve or export static assets.

c. Architectural patterns / design principles
- Component-based architecture (atomic design)
- Single-page application (client-side routing)
- Separation of concerns:
– UI primitives vs feature components
– Data access layer (journalData.ts) vs presentation
- Hooks for reusable logic (use-toast, use-mobile)

d. Key technologies/frameworks
- React + React Router (implicit via pages folder)
- Vite (dev server & build)
- TypeScript
- Tailwind CSS
- shadcn-ui (Radix-based UI primitives)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser
    BROWSER["User's Browser"]:::runtime

    %% React Application Runtime
    subgraph "React Application Runtime"
        direction TB
        subgraph "Entry & Routing"
            direction TB
            MAIN["main.tsx"]:::runtime
            APP["App.tsx"]:::runtime
        end
        ROUTER["Router (pages)"]:::runtime
        MAIN --> ROUTER
        APP --> ROUTER

        subgraph "Pages"
            direction TB
            INDEX["Index.tsx"]:::runtime
            NOTFOUND["NotFound.tsx"]:::runtime
        end
        ROUTER --> INDEX
        ROUTER --> NOTFOUND

        subgraph "Feature Components"
            direction TB
            Q["DailyQuote"]:::runtime
            H["HabitManager"]:::runtime
            JM["JournalModal"]:::runtime
            TV["TodayView"]:::runtime
            YG["YearGrid"]:::runtime
            SV["StatsView"]:::runtime
            SR["SearchResults"]:::runtime
            SM["SettingsModal"]:::runtime
            NAV["Navigation"]:::runtime
            NL["NavLink"]:::runtime
            PT["PlantTile"]:::runtime
            PI["PlantIcons"]:::runtime
        end
        INDEX --> Q & H & JM & TV & YG & SV & SR & SM & NAV & NL & PT & PI

        subgraph "UI Library (shadcn-ui + Radix + Tailwind)" 
            direction TB
            UI["src/components/ui/"]:::ui
        end
        UI --> Q & H & JM & TV & YG & SV & SR & SM & NAV & NL & PT & PI

        subgraph "Hooks & Data Layer"
            direction TB
            UM["use-mobile"]:::logic
            UT["use-toast"]:::logic
            JD["journalData.ts"]:::data
            UTILS["utils.ts"]:::data
        end
        Q & H & JM & TV & YG & SV & SR & SM & NAV & NL & PT & PI --> UM & UT & JD & UTILS

        subgraph "Persistence"
            direction TB
            LS["localStorage / IndexedDB"]:::data
        end
        JD --> LS
        BROWSER --> MAIN
    end

    %% Build & Deployment Pipeline
    subgraph "Build & Deployment" 
        direction TB
        NPM["Node.js & npm"]:::infra
        VDEV["Vite Dev Server"]:::infra
        BUILD["npm run build"]:::infra
        VBUILD["Vite Build → dist"]:::infra
        DIST["/dist folder"]:::infra
        HOST["Static Hosting (Vercel/Netlify/GitHub Pages)"]:::infra
    end
    NPM --> VDEV
    VDEV --> BROWSER
    NPM --> BUILD
    BUILD --> VBUILD
    VBUILD --> DIST
    DIST --> HOST

    %% Click Events
    click MAIN "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/main.tsx"
    click APP "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/App.tsx"
    click INDEX "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/pages/Index.tsx"
    click NOTFOUND "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/pages/NotFound.tsx"
    click Q "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/DailyQuote.tsx"
    click H "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/HabitManager.tsx"
    click JM "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/JournalModal.tsx"
    click TV "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/TodayView.tsx"
    click YG "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/YearGrid.tsx"
    click SV "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/StatsView.tsx"
    click SR "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/SearchResults.tsx"
    click SM "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/SettingsModal.tsx"
    click NAV "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/Navigation.tsx"
    click NL "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/NavLink.tsx"
    click PT "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/PlantTile.tsx"
    click PI "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/components/PlantIcons.tsx"
    click UI "https://github.com/jashkarangiya/daily-bloom-journal/tree/main/src/components/ui/"
    click UM "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/hooks/use-mobile.tsx"
    click UT "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/hooks/use-toast.ts"
    click JD "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/lib/journalData.ts"
    click UTILS "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/src/lib/utils.ts"
    click LS "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/public/robots.txt"
    click NPM "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/package.json"
    click VDEV "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/vite.config.ts"
    click BUILD "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/tailwind.config.ts"
    click VBUILD "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/postcss.config.js"
    click DIST "https://github.com/jashkarangiya/daily-bloom-journal/tree/main/dist"
    click HOST "https://github.com/jashkarangiya/daily-bloom-journal/blob/main/public/robots.txt"

    %% Styles
    classDef runtime fill:#cce5ff,stroke:#3399ff,stroke-width:1px
    classDef infra fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef data fill:#ffe5b4,stroke:#ff8c00,stroke-width:1px
    classDef ui fill:#f0f0f0,stroke:#999999,stroke-width:1px
    classDef logic fill:#e2e3e5,stroke:#6c757d,stroke-width:1px
```
