How jashkarangiya/daily-bloom-journal works
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)