How fabianwaller/personal-website works
Project type and purpose
• It’s a Next.js “personal website” combining static content (blog posts in MDX), dynamic pages (contact form, OpenGraph images, RSS, sitemap), and a component library (UI primitives in src/components/ui).
• Purpose: serve a fast, responsive portfolio/blog site with SSR/SSG plus lightweight API routes for contact and metadata feeds.
File structure
• Top‑level: config files (.eslintrc, tsconfig, tailwind.config), scripts (husky, lint/test workflow), README, package locks.
• posts/: markdown content for SSG.
• public/: static assets (images, PDF).
• src/app/: Next.js 13+ App Router with directories for each route (about, blog/[slug], contact, journey, projects, etc.). Contains page.tsx, route.ts (API endpoints), middleware.ts.
• src/components/: shared React UI components organized by feature and a “ui” subfolder for primitives.
• src/hooks, src/lib, src/provider: custom React hooks, utility functions, and React Context providers.
• Configuration for PostCSS, Tailwind, Jest, Lighthouse.
README for additional insights
• The site is deployed as a Node/SSR service (or a purely SSG export on Vercel).
Main components and their interactions
a. Client/Browser UI (React):
– Next.js pages in src/app render React components (from src/components and MDX components).
– Context providers (BlogPostsContext, CommandMenuContext) wrap the app.
– Client‑side interactivity (command menu, contact form).
b. Next.js Server Functions:
– SSG/SSR engine: builds pages at build time or serves dynamic pages at request time.
– API Routes:
• /contact/actions/sendContact (server action to handle form submission → external email API/spam service).
• /rss/route and /sitemap.ts (generate RSS feed and sitemap).
• /og/route (dynamic OpenGraph images).
c. Data sources:
– File system: MDX files under posts/.
– Static assets in public/.
– Potential 3rd‑party services (email service, analytics, CDN).
d. Build & Test Toolchain:
– Build: Next.js + Webpack/RSC + Tailwind via postcss.config.
– Test: Jest + React Testing Library + snapshots.
– Lint/Format: ESLint + Prettier + Husky hooks.
Architectural patterns & design principles
• File‑based routing (App Router) → directory = route.
• Component‑based UI with a small custom design system (ui subfolder).
• SSG for blog posts and static pages; SSR or Edge functions for dynamic routes.
• Separation of concerns: UI vs. data fetch (actions, utils) vs. providers vs. hooks.
• DX tooling: ESLint, Prettier, Jest with pre‑commit/pre‑push hooks.