Skip to content

Documentation Architecture

Status: Informational
Scope: Documentation under .dev/ and docs/
Last Updated: December 31, 2025 19:29:50
Created: December 12, 2025 16:53:42

This document explains the documentation structure of the NeetCode Practice Framework, following software engineering best practices.


πŸ“ Design Principles

Separation of Concerns

Documentation is organized by target audience, not by file type:

Directory Purpose Target Audience Location
docs/ User-facing documentation Users, learners Website
docs/tools/ Developer tools reference (full docs) Contributors Website
docs/contributors/ Maintainer documentation (full docs) Maintainers Website
tools/README.md Tools overview (shortened) Contributors GitHub only
.dev/README.md Maintainer overview (shortened) Maintainers GitHub only

Single Source of Truth

Each topic has one authoritative document:

  • ❌ Avoid: Same content in multiple places
  • βœ… Prefer: One source, with links from other places

Proximity Principle

Documentation follows a migration strategy for accessibility:

  • Full documentation β†’ docs/tools/ and docs/contributors/ (accessible on website)
  • Shortened READMEs β†’ Original locations (tools/README.md, .dev/README.md) with links to full docs
  • Code proximity β†’ Tool scripts remain in tools/, tests remain in .dev/

πŸ“ Documentation Structure

neetcode/
β”‚
β”œβ”€β”€ README.md                    # 🏠 Project overview (users)
β”œβ”€β”€ README_zh-TW.md              # 🏠 Project overview (繁體中文)
β”‚
β”œβ”€β”€ docs/                        # πŸ“š Documentation (MkDocs website)
β”‚   β”œβ”€β”€ index.md                 # Homepage (includes README.md)
β”‚   β”œβ”€β”€ index_zh-TW.md           # Homepage (繁體中文)
β”‚   β”‚
β”‚   β”œβ”€β”€ solution-contract.md     # Solution file specification
β”‚   β”œβ”€β”€ generator-contract.md    # Generator file specification
β”‚   β”œβ”€β”€ architecture-migration.md # Architecture migration guide
β”‚   β”œβ”€β”€ github-pages-setup.md    # Deployment guide
β”‚   β”‚
β”‚   β”œβ”€β”€ patterns/                # Pattern documentation
β”‚   β”‚   β”œβ”€β”€ README.md
β”‚   β”‚   β”œβ”€β”€ sliding_window/
β”‚   β”‚   └── two_pointers/
β”‚   β”‚
β”‚   β”œβ”€β”€ mindmaps/                # Mind map documentation
β”‚   β”‚   β”œβ”€β”€ index.md
β”‚   β”‚   └── *.md
β”‚   β”‚
β”‚   β”œβ”€β”€ contributors/            # πŸ‘₯ Maintainer documentation (website)
β”‚   β”‚   β”œβ”€β”€ README.md            # Full maintainer guide
β”‚   β”‚   β”œβ”€β”€ testing.md           # Complete testing documentation
β”‚   β”‚   β”œβ”€β”€ documentation-architecture.md  # This file
β”‚   β”‚   └── virtual-env-setup.md # Virtual environment setup
β”‚   β”‚
β”‚   β”œβ”€β”€ tools/                   # πŸ› οΈ Tools documentation (website)
β”‚   β”‚   β”œβ”€β”€ README.md            # Complete tools reference
β”‚   β”‚   β”œβ”€β”€ mindmaps/
β”‚   β”‚   β”‚   β”œβ”€β”€ README.md        # Mind Maps Generator docs
β”‚   β”‚   β”‚   └── ai-markmap-agent/
β”‚   β”‚   β”‚       └── README.md    # AI Markmap Agent docs
β”‚   β”‚   β”œβ”€β”€ patterndocs/
β”‚   β”‚   β”‚   └── README.md        # Pattern Docs Generator docs
β”‚   β”‚   └── review-code/
β”‚   β”‚       └── README.md        # Review Code tools docs
β”‚   β”‚
β”‚   β”œβ”€β”€ ontology-design.md       # Ontology design
β”‚   └── mkdocs-content-guide.md  # Content guide
β”‚
β”œβ”€β”€ tools/                       # πŸ”§ Developer tools (code + scripts)
β”‚   β”œβ”€β”€ README.md                # Shortened version (links to docs/tools/)
β”‚   β”œβ”€β”€ mindmaps/                # Mind Maps tools (consolidated)
β”‚   β”‚   β”œβ”€β”€ core/                # Core module
β”‚   β”‚   β”œβ”€β”€ ai-markmap-agent/    # AI Markmap Agent
β”‚   β”‚   └── prompts/             # AI prompts
β”‚   β”œβ”€β”€ patterndocs/             # Pattern Docs Generator
β”‚   β”œβ”€β”€ review-code/             # Code review tools
β”‚   β”‚   └── validation/          # Validation tools
β”‚   β”œβ”€β”€ docstring/               # Docstring utilities
β”‚   └── leetcode-api/            # LeetCode API cache
β”‚
└── .dev/                        # πŸ”’ Maintainer zone (tests + scripts)
    β”œβ”€β”€ README.md                # Shortened version (links to docs/contributors/)
    β”œβ”€β”€ tests/                   # Component tests
    └── tests_solutions/         # Solution correctness tests

🎯 Target Audience Guide

πŸ‘€ Users (Learners, Practitioners)

What they need: - How to use the framework - Solution and generator specifications - Pattern guides and mind maps

Where to find: - README.md β†’ Quick start - docs/ β†’ Detailed documentation - Website β†’ https://lufftw.github.io/neetcode/

πŸ”§ Contributors (Pull Request Authors)

What they need: - Code style and architecture - Tool usage - Testing requirements

Where to find: - docs/tools/README.md β†’ Complete tools reference (website) - docs/contracts/solution-contract.md β†’ Solution format - docs/contributors/testing.md β†’ Complete testing documentation (website)

πŸ› οΈ Maintainers (Core Team)

What they need: - Internal architecture - Release process - Module deep-dives

Where to find: - docs/contributors/README.md β†’ Full maintainer guide (website) - docs/tools/*/README.md β†’ Complete module documentation (website) - docs/contributors/documentation-architecture.md β†’ Documentation structure (this file)


πŸ“‹ Documentation Checklist

When Adding a New Feature

  • Update README.md if user-facing
  • Update tools/README.md if developer tool
  • Add module README if new module
  • Update relevant CONTRACT files if API change

When Adding a New Tool

  • Add to docs/tools/README.md quick reference table (full documentation)
  • Add detailed section in docs/tools/README.md
  • Create docs/tools/<module>/README.md if complex
  • Update tools/README.md (shortened version) if needed
  • Add tests to .dev/tests/ or tools/tests/
  • Update mkdocs.yml navigation if adding new documentation page

When Modifying Documentation Structure

  • Update this file (docs/contributors/documentation-architecture.md)
  • Update docs/mkdocs-content-guide.md
  • Update mkdocs.yml if adding to website
  • Update README documentation section
  • Verify all links follow the linking strategy (files in docs/ use relative paths, files outside docs/ use GitHub URLs)

πŸ—οΈ Industry Best Practices

This structure follows patterns from well-known open source projects:

Flask / Django Pattern

project/
β”œβ”€β”€ docs/           # Sphinx/MkDocs user documentation
β”œβ”€β”€ scripts/        # Scripts with their own README
└── CONTRIBUTING.md # Contributor guide

Kubernetes Pattern

project/
β”œβ”€β”€ docs/           # User documentation
β”œβ”€β”€ hack/           # Developer scripts and tools
└── contributor/    # Contributor documentation

Our Adaptation

neetcode/
β”œβ”€β”€ docs/           # User documentation (MkDocs)
β”œβ”€β”€ tools/          # Developer tools (with README.md)
└── .dev/           # Maintainer documentation

❓ FAQ

Why migrate documentation to docs/?

Migration Strategy: Full documentation has been moved to docs/contributors/ and docs/tools/ to make it accessible via the MkDocs website, while maintaining GitHub browsing context through shortened READMEs in original locations.

Benefits: - βœ… All documentation accessible on MkDocs website - βœ… Maintains GitHub browsing context with shortened READMEs - βœ… Links work correctly in both GitHub and website using relative paths - βœ… Single source of truth for full documentation content

Structure: - docs/contributors/ β†’ Full maintainer documentation (on website) - docs/tools/ β†’ Full tools documentation (on website) - .dev/README.md β†’ Shortened version (links to full docs on website) - tools/README.md β†’ Shortened version (links to full docs on website)

Why .dev/ for maintainer zone?

  • Clearly signals "internal" directory
  • Keeps root directory clean
  • Groups with test files (same audience)
  • Shortened README maintains GitHub browsing context

Why separate code from documentation in tools/?

  • tools/ β†’ Contains actual tool scripts (.py files) and shortened README
  • docs/tools/ β†’ Contains full documentation (on website)
  • Clear separation between code and documentation

How do I know where to add new documentation?

Ask: Who is the primary reader?

Reader Location
User learning the framework docs/ (patterns, guides, contracts)
Contributor adding features docs/tools/README.md (full reference on website)
Maintainer debugging issues docs/contributors/ (full docs on website)

Note: Original locations (.dev/README.md, tools/README.md) contain shortened versions with links to full documentation on the website.

When adding links in documentation files, follow this strategy:

  • βœ… Files inside docs/ directory: Use relative paths (e.g., [README](README.md), [Tools](../tools/README.md))
  • βœ… Files outside docs/ directory: Use GitHub absolute URLs (e.g., [Runner](https://github.com/lufftw/neetcode/blob/main/runner/README.md))

This ensures links work correctly in both GitHub repository browsing and the MkDocs website.

Examples: - βœ… docs/contributors/README.md linking to docs/contributors/testing.md β†’ Use [testing.md](testing.md) - βœ… docs/contracts/solution-contract.md linking to runner/README.md β†’ Use [Runner](https://github.com/lufftw/neetcode/blob/main/runner/README.md) - βœ… docs/tools/README.md linking to tools/prompts/README.md β†’ Use [Prompts](https://github.com/lufftw/neetcode/blob/main/tools/prompts/README.md)

πŸ“– See MkDocs Content Guide for detailed linking strategy documentation.


πŸ“ Update Log

  • 2025-12-24: Migrated maintainer and tools documentation to docs/contributors/ and docs/tools/ for MkDocs website integration. Created shortened READMEs in original locations with links to full documentation.
  • 2025-12-24: Added link strategy section documenting rules for linking to files inside/outside docs/ directory
  • 2025-12-12: Initial version - Documented architecture after consolidating tools documentation