How aykutkardas/miniature-painting works
Project type and purpose
• This is a Next.js-based web application using the new “app” router (App Directory) and React Server/Client Components.
• Its purpose is to render React pages (some server‐rendered, some hydrated client components), serve static assets, and deploy easily on platforms like Vercel.
File structure
• Top-level config & metadata:
• .gitignore, package.json/package-lock.json, tsconfig.json, eslint.config.mjs, postcss.config.mjs, next.config.ts
• Public assets:
• public/
• Application code under src/:
• src/app/ – App Directory (file-based routing)
– layout.tsx (root layout)
– page.tsx (root page)
– globals.css (global styles)
– components/ (page-specific components: bottom-bar.tsx, painting-board.tsx)
• src/components/ui/ – Shared UI primitives (Button, Popover, Slider, Tooltip)
• src/lib/utils.ts – Utility functions
README for insights
• Confirms standard Next.js stack: React, file-based routing, next/font integration, hot-reload dev server, Vercel deployment target.
• No backend/API routes or database layers in this minimal scaffold.
Main components & their interactions
a. Next.js Server (Node.js runtime)
• Listens for HTTP requests, resolves file-based routes in src/app, renders appropriate React Server Components into HTML.
• Serves static assets from public/.
• Applies postcss during the build, bundles with Webpack/Turbopack.
b. React Server Components (in app/page.tsx, layout.tsx, etc.)
• Execute on the server, generate HTML shell and data.
c. React Client Components (components using state/events, e.g. painting-board.tsx or any “use client” tagged files)
• Hydrate on the browser, handle interactivity.
d. Shared UI Library (src/components/ui)
• Imported by both server and client components for consistent look & feel.
e. Public assets
• Static images/fonts served directly by the server.
f. Utilities (src/lib/utils.ts)
• Business-logic/helpers invoked by components on server or client.
Architectural patterns & design principles
• File-based routing → automatic registration of pages.
• Server vs Client Components → separation of rendering and interactivity.
• Component library (atomic design) → UI primitives separated into src/components/ui.
• Global CSS + component-scoped styling.
• Zero-API (no custom API routes) in this scaffold; would slot in an /src/app/api folder if added.