How james61124/jamesblogger-nextjs works
Project type and purpose
• This is a Next.js application used as a blog/documentation site. It statically generates pages for multiple categories (leetcode, life, program, travel) from Markdown sources under public/article and metadata JSON files under public/metadata.
• The primary goal is to serve content pages with client‑side React components and server‑side/static generation at build time, then deploy as a static/SSR site on Vercel.
File structure
• Top‑level config: next.config.mjs, eslint.config.mjs, postcss.config.mjs, jsconfig.json, package.json.
• Content sources:
• public/article/.../*.md – raw Markdown articles.
• public/metadata/*.json – precomputed metadata for each category.
• md2json.py – helper script to transform Markdown frontmatter into metadata JSON.
• Next.js App Router:
• src/app/layout.js, src/app/globals.css – global layout and styles.
• src/app/page.jsx – homepage.
• src/app/[category]/... – dynamic route for each category listing pages, article pages, and tags.
• UI Components: src/components/* and src/components/ui/* – reusable React components (Navbar, Footer, ArticleList, Pagination, etc.).
README for additional insights
• The README confirms a standard Create‑Next‑App setup, uses Next.js’s App Router and next/font.
• No external backend or database; content is file‑based.
Elements
• Clear labels for each component (e.g., “Client”, “Next.js Build Server”, “Markdown Files”, “JSON Metadata”, “React Components”, “Vercel CDN”)
• Markdown → md2json.py → JSON metadata
• JSON + Markdown → Next.js Build → Static HTML/JS
• Browser ↔ Vercel CDN ↔ Static Assets
• Rectangles for services (Next.js, Vercel)
• Clouds for external hosting/CDN
Final advice
• Every stage: content ingestion, build-time generation, deployment, and client runtime.
• Separate concerns visually: content vs. presentation vs. hosting.
• The objective is a single‑page architecture view that lets any engineer grasp the end‑to‑end flow from Markdown to rendered web page.