How markmead/hyperui works
Project type and purpose
• This is a full-stack React/Next.js application (App Router) used to showcase and serve a catalogue of Tailwind CSS components (HyperUI).
• It combines static site generation (SSG), dynamic routing (MDX-based pages), and a lightweight API route for search.
High-level components
a. Client (Browser)
b. Next.js Server (SSG/SSR)
c. File-system Content Layer (MDX files in src/data)
d. UI Component Library (React components in src/components + public HTML snippets)
e. API Layer (app/api/search/route.js + src/utils/db.js)
f. CSS Build Pipeline (Tailwind CSS, PostCSS, styles in src/styles)
g. Configuration & Deployment (next.config.js, Vercel/GitHub CI)
Relationships and data flows
• Browser → Next.js Server
• Requests pages under /, /about, /blog, /components/:category/:collection
• Requests search via AJAX against /api/search
• Next.js Server → File-system Content Layer
• Reads MDX files (src/data/pages, src/data/posts, src/data/components/…)
• Transforms MDX via src/utils/transformers.js into React elements
• Next.js Server → UI Component Library
• Renders pages by composing layout.jsx + header/footer/navigation + dynamic page.jsx
• Embeds component previews using HTML snippets from public/components or live React previews
• Browser ← Next.js Server
• Receives pre-rendered HTML/CSS/JS (Tailwind CSS styles via PostCSS pipeline)
• Browser → /api/search → Next.js Server → src/utils/db.js → File-system
• Returns JSON search results
Architectural patterns & design principles
• App Router (Next.js 13+) for nested layouts and file-based routing
• Content-driven pages via MDX + data-first approach
• SSG for performance, with on-demand dynamic rendering for API routes
• Separation of concerns
• “app/” for routes and layouts
• “src/components/” for React UI primitives
• “src/data/” for Markdown content
• “public/components/” for static HTML previews
• “src/utils/” for transformation and data access logic
Relevant technologies, frameworks, and libraries
• Next.js 13 App Router (layout.jsx, page.jsx, route.js)
• React (JSX, client/server components)
• MDX (Markdown + JSX pages)
• Tailwind CSS (postcss.config.js, tailwind.config.js)
• PostCSS, Prettier, ESLint for linting & formatting
• Node.js file-system for content ingestion
• Potential hosting on Vercel or Netlify