How iamvisshu/github-blog works
Project Type & Purpose
• This is a Jamstack‐style static blog application built with Next.js.
• Purpose: Read Markdown files from /posts, parse front‐matter metadata, generate SEO‐friendly static pages (posts, tags, about, index) and deploy them (e.g., on Vercel).
Key Components
a. Content Layer
• /posts directory (Markdown files + front‐matter)
• public/images for post assets
b. Build & Deployment
• Next.js build step (npm run build)
• Markdown parser (e.g. remark) invoked in getStaticProps / getStaticPaths
• Vercel CI/CD pipeline (GitHub → Vercel → build → CDN)
c. Presentation Layer
• React components in /components (Header, Footer, Layout)
• Page entrypoints in /pages (index, about, posts/[slug], tags/[tag], etc.)
• Styling via Tailwind CSS (configured in tailwind.config.js, imported in globals.css)
d. Runtime Layer
• Browser loads pre-rendered HTML/CSS/JS from CDN
• Client‐side interactivity: theme switcher, tag filtering, search
Relationships & Data Flow
1. Developer pushes Markdown + code to GitHub
2. Vercel picks up changes → runs Next.js build
3. Next.js:
• Reads /posts/*.md
• Parses front‐matter & Markdown → HTML
• Runs getStaticPaths / getStaticProps in /pages
• Bundles React components + styles
• Emits static HTML, CSS, JS assets
4. Assets deployed to CDN
5. Browser requests pages → CDN serves static files → React hydrates for client features
Architectural Patterns & Principles
• Jamstack (pre-rendering + CDN delivery)
• SSG (Static Site Generation) with Next.js
• Component-based UI (React)
• File-system routing (Next.js pages folder)
• Separation of concerns:
• Content (Markdown)
• Build logic (Next.js + parsing)
• Presentation (components + styles)
• Deployment (Vercel CDN)
Essential Details to Capture
• File‐system routing: how pages/posts/[slug].js and pages/tags/[tag].js generate dynamic paths.
• Front‐matter → data model for each page (title, date, tags, summary, cover).
• Theme switcher & client‐side filtering as small client interactivity layer.
• Configuration files (next.config.js, tailwind.config.js, postcss.config.js) that drive build/tools.
Final Advice
• Component boundaries (data, build, UI, infra).
• Don’t overengineer—this is a static site, so the architecture is simple: content → build → deploy → serve.