How morrissimons/sample_test_page works
Project Type & Purpose
• This is a single‐page, front-end web application built with Vite, React (TypeScript), Tailwind CSS, and the shadcn-ui component library.
• There is no custom back-end code in the repo; it produces a static asset bundle (HTML/CSS/JS), which is deployed to a CDN/hosting layer (via Lovable).
File Structure & Architectural Patterns
• src/ houses the React app:
• pages/ – top-level routes/views (Index.tsx, NotFound.tsx)
• components/ui/ – dozens of reusable UI components (Button, Modal, Accordion, etc.) following an atomic/component-based pattern
• hooks/ & lib/ – cross-cutting utilities (custom React hooks, helper functions)
• main.tsx & App.tsx – entry point and root component
• public/ – static assets (robots.txt) and index.html – shell HTML
• Config files: Vite (vite.config.ts), Tailwind (tailwind.config.ts, postcss.config.js), ESLint, TypeScript (tsconfig.*), package.json.
a. Developers & Source Control
• IDE / Lovable UI → GitHub (repository)
• Lovable’s web editor also commits to the same repo
b. Build & CI/CD
• On push or Lovable “Publish”: Lovable triggers Vite’s build
• PostCSS → Tailwind CSS processing → CSS output
• Vite bundles React + TypeScript → production JS/CSS/assets
c. Static Hosting / CDN
• Built assets pushed to Lovable’s hosting layer (or configured custom domain)
• Served via CDN edge nodes
d. End-User (Browser)
• Browser requests index.html → loads JS/CSS bundles → hydrates React SPA
• Client-side routing (Index → NotFound)
e. External Services (optional)
• Custom domain / DNS via Lovable’s domain settings
• Potential 3rd-party APIs if added in future
Interactions & Data Flow
Developer → Commit → GitHub → Lovable/CICD → Build → Hosting
Developer ← HMR updates ← Vite Dev Server
User’s Browser → CDN → index.html + assets → React App initialization → UI components rendered
Architectural Patterns & Design Principles
• Component-Based UI: atomic “ui” components in src/components/ui
• Client-Side Routing: pages directory drives routes
• Utility Layers: hooks and lib for encapsulating cross-cutting concerns
• Build-Time CSS: Tailwind + PostCSS tree-shaking for minimal CSS
• Modular Config: separate tsconfig for app & node, Vite config centralized