How not-just-pratul/monolith---stone-focus-app works
Project Type and Purpose
• Monolith Focus App is a web-based, full-stack (front-end-heavy) productivity application built with Next.js 13 (App Router) and React.
• Purpose: Help users commit to and complete one “Monolith” task per session, track distractions, breaks, reflections, and store all data locally.
File Structure
• Top-Level Directories
– .next/ → Next.js build & SSR/SSG artifacts
– public/ → Static assets (redirects, manifest, robots.txt)
– src/app/ → Next.js App Router pages and nested layouts
– src/components/ → Reusable React components (core & shadcn/ui primitives)
– src/hooks/ → Custom React hooks (keyboard shortcuts, sounds, toasts)
– src/lib/utils.ts → Utility functions, localStorage wrappers
• Configuration & Build Files
– next.config.mjs, tsconfig*.json, tailwind.config.ts
– package.json, lockfiles, ESLint, PostCSS configs
README for Additional Insights
• Tech Stack: Next.js, React, TypeScript, Tailwind CSS, shadcn/ui, Framer Motion, Lucide React, next-themes
• Data Persistence: Local Storage only, JSON export, clear/reset history
• No external API or database—pure client-side data layer
Main Components & Their Relationships
a. Client Browser
– Next.js Router (SSR/SSG entry) → hydrates into a SPA
– UI Layer: src/app pages → composed of core & UI primitives (src/components + src/components/ui)
– Cross-cutting via Hooks: useKeyboardShortcuts, useSoundEffects, useToast, useMobile
– Theme Context (next-themes), Animation Context (Framer Motion)
– Styles: Tailwind (global in globals.css, component CSS)
b. Next.js Node.js Server
– SSR/SSG engine serves pre-rendered HTML + JSON data
– Builds routes based on src/app folder structure
– Static file server for public/ and .next/static assets
c. Data Layer (Browser Local Storage)
– Utility functions in src/lib/utils.ts manage get/set/clear of session data, history, settings
– Export module generates JSON download
d. Static Assets & Build Artifacts
– .next/static for JS/CSS chunks, HMR updates
– public/ for manifest, robots, redirects
e. Dev & CI/CD Tools (side note)
– Nix (.idx/dev.nix), Bun lockfile (optional), Vercel config
Architectural Patterns & Design Principles
• Component-Based Architecture: Atomic UI primitives + higher-level monolith features
• Nested Layouts via Next.js App Router for shared headers, footers, metadata
• Separation of Concerns:
– Presentation (React components)
– State & Side Effects (Hooks)
– Persistence (lib/utils)
• HYDRATED SPA: SSR/SSG for first load, then client hydrates into a rich SPA
• Client-only Data Persistence ensures privacy and simplicity