How yangxinhan/myweb works
Project type and its purpose
• Full-stack web application (UI built with Next.js, static-export/SSR hybrid)
• Purpose: A personal portfolio/blog/solutions site with static content, MDX posts, dynamic data from GitHub, styled via Tailwind CSS
File structure for architectural clues
• Root configuration & infra
– Dockerfile + docker-compose.yml: multi-stage build, container definition
– nginx.conf: static assets & SSR proxy
– .github/workflows/deploy.yml: CI/CD pipeline on push
– crontab + fetch-updates.sh: periodic data-fetching (e.g., GitHub projects)
• Build output
– out/: static HTML, JS, CSS artifacts from next export
• Source code
– src/app/: Next.js App Router pages and layouts
– src/components/ui/: reusable React UI components
– src/data, src/lib, src/utils: data sources, MDX parsing, utility functions
README for additional insights
• Next.js App Router, static export & dev server
• next/font integration for Geist font
• Deployment target: Vercel (but overridden by Docker+Nginx here)
Main components & their interactions
a. Developer workstation
– Edits code, runs npm run dev → Next.js dev server
– Commits to GitHub repo
b. CI/CD (GitHub Actions)
– On push, runs build, lint, tests; builds Docker image; pushes to registry or deploys
c. Build stage (Docker multi-stage)
– Stage 1: npm install + npm run build → generates .next and out/
– Stage 2: Nginx container copies out/ and proxies dynamic routes to Node (or purely serves static)
– crontab container executes fetch-updates.sh periodically to update JSON data
d. Runtime
– Nginx: serves /static, /_next, and proxies API/SSR requests to Node server
– Node.js: hosts Next.js server for any SSR/page-hooks, MDX rendering on the fly if needed
– External services: GitHub REST API (for project list), font CDN, analytics
Architectural patterns & principles
• Static Site Generation (SSG) + selective SSR via Next.js App Router
• Component-driven UI (atomic React components under src/components/ui)
• Containerization & immutable infrastructure (Docker + Nginx)
• CI/CD with GitOps (GitHub Actions drives build/deploy)
• Cron/data-fetch sidecar for periodic external updates
[ ] All major components labeled
[ ] External dependencies clearly shown
[ ] Build vs. runtime separated