How decadez/decadez.icu-main works
Project Type and Purpose
• This repository holds the “Website” portion of the decadez.icu ecosystem—a documentation/blog site built with Next.js (React + TypeScript) that sources its content from local Markdown/MDX files.
• Although the overall monorepo also plans for an Antd‑S component library and a NestJS backend, the tree you provided is purely the Next.js “website‑main” project.
File Structure Analysis
• Top‐level config and metadata:
• .github/ (CI workflows, issue templates)
• Dockerfile, .env.* , next.config.js, tsconfig.json, postcss.config.js, tailwind.config.js
• Public assets:
• public/images/, robots.txt
• Source code under src/:
• pages/ — Markdown (.md/.mdx) and TSX files defining routes (SSG/SSR)
• plugins/ — custom MDX + markdown processing pipelines
• constants/ — sidebar definitions, link maps, repo URLs
• utils/ — small reusable helpers
• styles/ — global CSS (Tailwind, Algolia, Sandpack)
• Deployment:
• Dockerfile + GitHub Actions (node.js.yml) handle CI/CD → container build → publish.
Core Components and Their Relationships
a. Developer & CI/CD
• Developer pushes to GitHub → GitHub Actions triggers → builds Docker image → pushes to registry or hosting.
b. Hosting & Delivery
• Container runs Next.js server (or static export) on production → public assets and generated HTML/CSS/JS served via CDN.
c. Next.js Application
• Pages:
• SSG: builds at npm run build by reading Markdown in src/pages/.
• SSR: dynamic routes (if any) served on request.
• MDX Pipeline: custom plugins (markdownToHtml, remark‑header‑custom‑ids, smartypants) convert Markdown → JSX.
• React Component Library: page templates import reusable components (Layout, Nav, Sidebar, CodeBlock, Sandpack).
d. External Services
• Algolia for search indexing.
• CodeSandbox/Sandpack for in‑page code editing & preview.
• (Potentially) GitHub-hosted repo for CI and content versioning.
Architectural Patterns & Design Principles
• Hybrid SSR/SSG: leverages Next.js’s static generation for documentation and SSR for any dynamic content.
• Plugin‑based content processing: keeps parsing logic decoupled from page components.
• Monorepo‑friendly: separates “website‑main” from other workspaces (Antd‑S, backend) but likely under a root; uses shared TypeScript types.