How fxianglong/interview works
Project Type and Purpose
• It’s primarily a static documentation site (a “Docsify”‐powered knowledge base) with accompanying C/C++ code examples (algorithms, data structures, design patterns, problems, STL usage).
• The README and docs/ folder drive the hosted site; the top‐level folders (Algorithm/, DataStructure/, DesignPattern/, etc.) are source directories for reference code.
Top‐Level Folder Analysis
• /docs: markdown + HTML/CSS/JS for the Docsify web UI. Contains index.html, nav config, CNAME, static assets.
• Algorithm/, DataStructure/, DesignPattern/, Problems/, STL/, …: code‐example modules, each with its own substructure and sometimes local READMEs or binaries.
• README.md, README_en.md: root landing documentation.
• Git metadata: .gitignore, LICENSE.
Runtime Site Architecture
• User (Browser) loads site URL (e.g. https://interview.huihut.com).
• GitHub Pages / Static‐host (Netlify / Docsify) serves docs/index.html plus JS/CSS.
• Docsify Engine (client‐side JavaScript) dynamically pulls markdown files from /docs and from the repo root (via relative paths) to render nav, pages, code snippets.
• Static Assets (images/, any local READMEs) get fetched by the browser as needed.
Main Components
a. Browser/Client – Runs Docsify single‐page app, renders markdown → HTML.
b. Docsify JS Engine – Interprets index.html + _navbar.md + _sidebar.md + markdown files.
c. Markdown Content – All .md under docs/ and root that Docsify serves.
d. Code Modules – Algorithm, DataStructure, DesignPattern, Problems, STL folders (these live in the repo and get linked into the site as code blocks).
e. Static Host – GitHub Pages or equivalent (delivers HTML, JS, CSS, images, markdown).
f. External Services – DNS/CNAME (points custom domain to GitHub Pages), optionally Netlify/CDN.
Relationships & Data Flow
• Browser requests / → Host serves index.html
• Docsify JS fetches _sidebar.md, _navbar.md, then other .md on navigation
• When user clicks “Algorithm” → Docsify loads Algorithm/README.md or code listings via raw HTTP
• All content delivered over HTTPS by static host; no backend.
Architectural Patterns & Principles
• Client‐Side Rendering: Docsify SPA pattern.
• Static Site Generation (via markdown, but generated at runtime on client).
• Modular Code Layout: separate folders for each knowledge domain.
• Progressive Enhancement: plain HTML fallback if JS disabled.
Technologies & Frameworks
• Markdown for content
• Docsify JS (spa docs generator)
• HTML/CSS/JavaScript for UI
• Git/GitHub for source management
• GitHub Pages (or any static‐site hosting)
• CNAME DNS configuration for custom domain
• C/C++ (.h/.cpp) for code examples
• Browser (Client)
• Docsify SPA (JS Engine loaded by index.html)
• Markdown Repositories (docs/*.md, root READMEs)
• Code Examples (Algorithm/, DataStructure/, DesignPattern/, Problems/, STL/)
• Static Host (GitHub Pages)
• DNS/CNAME mapping to static host
• Assets directory (images/)