How hwayeeon/u-reserve works
Project type and purpose
• This is a full‑stack (frontend‑heavy) Next.js application (using the new /app directory for server & client components).
• Primary features: multi‑role UI (admin vs. user), static data consumption (JSON), login flow, error handling, and a set of reusable UI components.
File structure
• Top‑level: configuration files (next.config.mjs, postcss.config.mjs, jsconfig.json, etc.), package files, and public assets.
• src/app: file‑based routing for pages, layouts, error handling, login, admin, user, and global styles.
• src/components: reusable React components (including a ui subfolder for primitive UI building blocks).
• src/data: static JSON data sources.
• src/hooks and src/lib: custom hooks and utility libraries (mobile detection, cookies, encryption, etc.).
• middleware.js: Next.js middleware for authentication, redirects, or headers.
README
• Confirms it’s a create‑next‑app scaffold, uses next/font, and is intended for deployment on Vercel.
• No custom backend API routes are present, so data is either static or fetched from external services.
Main components
a. Client Layer
• Browser (Chrome/Firefox/…)
• React hydration layer (client components)
b. Next.js Server Layer
• Next.js Server (Node.js runtime on Vercel or similar)
• Middleware (handles auth, redirects)
• Server Components (in src/app)
c. Data Layer
• Static JSON files (src/data/*.json)
d. Assets & Build Layer
• Public folder (images, favicon, manifest)
• Build pipeline (PostCSS, ESLint, bundler)
e. Third‑Party Services
• Vercel CDN / Hosting
• Google Fonts / next/font
Relationships and interactions
• Browser → Next.js Server: initial page request via SSR or SSG.
• Next.js Server → Data Layer: reads static JSON or calls external APIs.
• Next.js Server → Public Assets: serves images, CSS, JS bundles, manifest.
• Next.js Server → Browser: streams HTML + JSON, then hydrates React client components.
• Browser → Next.js Server: client‑side navigation requests (via the Next.js router).
• Middleware intercepts incoming requests for auth or logging.
Architectural patterns & design principles
• File‑based routing (Next.js app directory).
• Server vs. Client Components separation.
• Utility modules (src/lib, src/hooks) for cross‑cutting concerns.
• Atomic design in src/components/ui for consistency and reusability.
• Static‑first data approach (JSON files) with potential for extension to real APIs.
Essential elements
• Version control & build step optionally at the bottom (Git → Build → Deploy).