How megh-bari/pattern-craft works
Project Type and Purpose
• This is a full-stack web application built with Next.js 14 (App Router), TypeScript, and Tailwind CSS.
• Its purpose is to present a curated library of CSS background patterns and gradients, allow live preview in the browser, and enable copy-and-paste of CSS/Tailwind code snippets.
• It’s deployed as a monolithic application on Vercel, serving both static assets and dynamic server-rendered pages.
File Structure
• Top-level:
• next.config.ts, postcss.config.mjs, eslint.config.mjs, tsconfig.json → build & lint config
• public/ → static assets (pattern preview images, favicon, etc.)
• components.json → metadata for UI components (shadcn/ui)
• src/app/ → Next.js App directory (routes, layout, global styles, React Server Components)
• components/ → page-level UI components (Navbar, Hero, PatternShowcase, Footer, ThemeProvider)
• utils/patterns.ts → pattern definition objects (id, name, CSS style, code)
• types/pattern.ts → TypeScript interfaces for patterns
• globals.css → global Tailwind and custom CSS
• layout.tsx → root layout, includes ThemeProvider and common UI
• page.tsx → home page that orchestrates Hero and PatternShowcase
• src/components/ui/ → shared, low-level UI primitives (Badge, Button) provided by shadcn/ui.
• src/lib/utils.ts → general utilities (e.g., formatting, helpers).
• package.json & lock → dependencies (next, react, tailwindcss, etc.)
Extract Insights from README
• Architecture is monolithic but layered: presentation layer (React pages & components), data layer (patterns stored in code), utility layer (helpers).
• No external databases or APIs; patterns are loaded from an in-repo JSON/TS file.
• Deployed on Vercel with CDN for static assets and SSR endpoints.