How 0xniru/ajay-darpan works
Project Type and Purpose
• This is a frontend-only Single Page Application (SPA) built with Vite, React, TypeScript, Tailwind CSS, and the shadcn-ui component library.
• It delivers a set of user-facing pages (Dashboard, PublicDashboard, Auth, etc.) and leverages reusable UI components (adorned with Tailwind utilities and shadcn patterns).
• It is hosted and deployed via the Lovable platform as static assets (HTML, JS, CSS), with optional custom domain support.
File Structure
• Top-level: configuration files (.gitignore, tsconfig, vite.config.ts, tailwind.config.ts) and project metadata (package.json, README.md).
• “public/”: static assets and the index.html entry.
• “src/”: source code
• main.tsx – application entry point that hydrates App.tsx
• App.tsx & App.css – root layout and global styling
• pages/ – route-based pages (Index, Dashboard, Auth, PublicDashboard, NotFound)
• components/ – domain-specific UI widgets (HeroSection, StatsSection, plus “officer” subfolder for administrative screens)
• components/ui/ – low-level, styled primitives (buttons, dialogs, inputs, toasts, etc.) provided by shadcn-ui
• hooks/ – custom React hooks (use-mobile, use-toast)
• lib/ – shared utilities (utils.ts)
Key Insights from README
• Build and develop locally using Node.js + npm via Vite’s dev server.
• Deployment and hosting are fully automated by Lovable (runs npm install, npm run build, and serves static files).
• Technology stack summary confirms React + TS + Vite + shadcn-ui + Tailwind.
a. Main Components
• Developer Workstation (IDE, Git)
• Git Repository (GitHub)
• CI/CD & Hosting (Lovable)
• Build System (Vite, npm scripts)
• Static Asset Store / CDN (Lovable’s storage)
• Client Browser (runs the SPA)
• Optional External Services (e.g., analytics, API endpoints if integrated later)
b. Relationships & Interactions
• Developer → pushes code to → Git Repository
• Git Repository → triggers → Lovable CI/CD
• Lovable CI/CD → runs → npm install & npm run build (invokes Vite, TS compiler, PostCSS, Tailwind)
• Build Output (index.html, assets, JS bundles, CSS) → stored on → Static Asset Store / CDN
• End User Browser → requests → CDN-hosted assets → renders → React SPA → interacts with UI components/hooks/lib
• (Future) SPA → calls → External APIs for data (grievance management, project tracking, etc.)
c. Architectural Patterns & Principles
• Component-based UI (Atomic design with shadcn-ui primitives → composite components → pages)
• Unidirectional data flow (React props + custom hooks)
• Strict separation between dev/build (Node/Vite) and runtime (browser)
• Configuration-driven styling (Tailwind, PostCSS)
d. Key Technologies & Frameworks
• Vite for fast dev server + build
• React + TypeScript for UI & type safety
• Tailwind CSS for utility-first styling
• shadcn-ui for accessible, customizable primitives
• Lovable for CI/CD and static hosting
Detailed Checklist
• [ ] Developer Workstation (IDE & Git)
• [ ] GitHub Repo (source control)
• [ ] CI/CD & Hosting (Lovable platform)
• [ ] Build Step: npm install → Vite build → PostCSS/Tailwind
• [ ] Static Asset Store / CDN
• [ ] User Browser (SPA runtime)
• [ ] src directory breakdown: components/ui, components/officer, pages, hooks, lib