How jongsujin/fantajin-blog works
Project type and purpose
• This is a Next.js-based statically-generated (with optional SSR/ISR) blog that uses MDX for content pages.
• It’s a full-stack JAMstack application built with TypeScript, Tailwind CSS, and deployed on Vercel.
File structure
• app/ – Next.js App Router layout, page and route definitions (server and client components).
• public/ – Static assets (images, logo, profile pics).
• src/ – Modular source code following a layered domain approach:
• _app/providers/ – React context and global providers
• entities/ – Domain models (post, category), API calls, and content (MDX files)
• screens/ – Page-level UI components that tie entities → widgets → providers
• shared/ui/ – Generic UI primitives (Card, Pagination, MDXImage)
• widget/ – Reusable feature widgets (header, comments, post-card, tag)
• Config files: next.config.ts, postcss.config.mjs, ESLint, Prettier, TypeScript.
Insights from README
• JAMstack design: build-time MDX processing into static HTML pages (SSG); optional dynamic SSR.
• Tech stack reaffirms: Next.js, MDX, Tailwind CSS, TypeScript, Vercel.
Main components
a. Frontend:
– Next.js App Router (Server-side & Client-side components)
– React Context Providers (ThemeContext, other global state)
– UI Layer: Screens → Widgets → Shared UI primitives
b. Content pipeline:
– MDX files under entities/post/content/posts
– MDX loader → Static generation at build time or on-demand ISR
c. Data & API:
– src/entities/post/api/post.ts (fetching from local MDX or external endpoints)
– Category model under entities/category
d. Static assets:
– public folder served by Vercel CDN
e. Deployment & Hosting:
– Vercel build & deployment pipeline
– Git repo triggers Vercel CI/CD
Relationships & interactions
• Browser → Vercel Edge Network → Next.js Serverless Functions (for SSR/ISR)
• Next.js build process parses MDX → generates static pages → uploaded to CDN
• At runtime, pages use React Providers → render Screens → mount Widgets → compose Shared UI
• API module can fetch external data or local MDX frontmatter dynamically
• Static assets (images, CSS) served directly by CDN
Architectural patterns & technologies
• Layered domain architecture (entities → widgets → screens → app router)
• Component composition (widgets + shared primitives)
• JAMstack (SSG/ISR) for performance & SEO
• Context providers for global theming/state
• File-based routing with Next.js App Router
• MDX integration for content as React components