|
| 1 | +# Documentation Architecture |
| 2 | + |
| 3 | +This document explains the documentation structure of the NeetCode Practice Framework, following software engineering best practices. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 📐 Design Principles |
| 8 | + |
| 9 | +### Separation of Concerns |
| 10 | + |
| 11 | +Documentation is organized by **target audience**, not by file type: |
| 12 | + |
| 13 | +| Directory | Purpose | Target Audience | |
| 14 | +|-----------|---------|-----------------| |
| 15 | +| `docs/` | User-facing documentation | Users, learners | |
| 16 | +| `tools/README.md` | Developer tools reference | Contributors | |
| 17 | +| `tools/*/README.md` | Module technical details | Deep contributors | |
| 18 | +| `.dev/` | Maintainer documentation | Maintainers | |
| 19 | + |
| 20 | +### Single Source of Truth |
| 21 | + |
| 22 | +Each topic has **one authoritative document**: |
| 23 | + |
| 24 | +- ❌ Avoid: Same content in multiple places |
| 25 | +- ✅ Prefer: One source, with links from other places |
| 26 | + |
| 27 | +### Proximity Principle |
| 28 | + |
| 29 | +Documentation lives **close to the code** it describes: |
| 30 | + |
| 31 | +- Tool documentation → `tools/README.md` |
| 32 | +- Module documentation → `tools/<module>/README.md` |
| 33 | +- Test documentation → `.dev/TESTING.md` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## 📁 Documentation Structure |
| 38 | + |
| 39 | +``` |
| 40 | +neetcode/ |
| 41 | +│ |
| 42 | +├── README.md # 🏠 Project overview (users) |
| 43 | +├── README_zh-TW.md # 🏠 Project overview (繁體中文) |
| 44 | +│ |
| 45 | +├── docs/ # 📚 User documentation (MkDocs website) |
| 46 | +│ ├── index.md # Homepage (includes README.md) |
| 47 | +│ ├── index_zh-TW.md # Homepage (繁體中文) |
| 48 | +│ │ |
| 49 | +│ ├── SOLUTION_CONTRACT.md # Solution file specification |
| 50 | +│ ├── GENERATOR_CONTRACT.md # Generator file specification |
| 51 | +│ ├── ARCHITECTURE_MIGRATION.md # Architecture migration guide |
| 52 | +│ ├── GITHUB_PAGES_SETUP.md # Deployment guide |
| 53 | +│ │ |
| 54 | +│ ├── patterns/ # Pattern documentation |
| 55 | +│ │ ├── README.md |
| 56 | +│ │ ├── sliding_window.md |
| 57 | +│ │ └── two_pointers.md |
| 58 | +│ │ |
| 59 | +│ ├── mindmaps/ # Mind map documentation |
| 60 | +│ │ ├── index.md |
| 61 | +│ │ └── *.md |
| 62 | +│ │ |
| 63 | +│ ├── ONTOLOGY_DESIGN.md # Ontology design (not in nav) |
| 64 | +│ └── MKDOCS_CONTENT_GUIDE.md # Content guide (not in nav) |
| 65 | +│ |
| 66 | +├── tools/ # 🔧 Developer tools |
| 67 | +│ ├── README.md # Tools reference (comprehensive) |
| 68 | +│ │ |
| 69 | +│ ├── mindmaps/ |
| 70 | +│ │ └── README.md # Mind map module technical docs |
| 71 | +│ │ |
| 72 | +│ ├── patterndocs/ |
| 73 | +│ │ └── README.md # Pattern docs module technical docs |
| 74 | +│ │ |
| 75 | +│ └── prompts/ |
| 76 | +│ └── README.md # AI prompts documentation |
| 77 | +│ |
| 78 | +└── .dev/ # 🔒 Maintainer documentation |
| 79 | + ├── README.md # Maintainer guide |
| 80 | + ├── TESTING.md # Testing documentation |
| 81 | + ├── VIRTUAL_ENV_SETUP.md # Virtual environment guide |
| 82 | + └── DOCUMENTATION_ARCHITECTURE.md # This file |
| 83 | +``` |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## 🎯 Target Audience Guide |
| 88 | + |
| 89 | +### 👤 Users (Learners, Practitioners) |
| 90 | + |
| 91 | +**What they need:** |
| 92 | +- How to use the framework |
| 93 | +- Solution and generator specifications |
| 94 | +- Pattern guides and mind maps |
| 95 | + |
| 96 | +**Where to find:** |
| 97 | +- `README.md` → Quick start |
| 98 | +- `docs/` → Detailed documentation |
| 99 | +- Website → `https://lufftw.github.io/neetcode/` |
| 100 | + |
| 101 | +### 🔧 Contributors (Pull Request Authors) |
| 102 | + |
| 103 | +**What they need:** |
| 104 | +- Code style and architecture |
| 105 | +- Tool usage |
| 106 | +- Testing requirements |
| 107 | + |
| 108 | +**Where to find:** |
| 109 | +- `tools/README.md` → Tools reference |
| 110 | +- `docs/SOLUTION_CONTRACT.md` → Solution format |
| 111 | +- `.dev/TESTING.md` → Test requirements |
| 112 | + |
| 113 | +### 🛠️ Maintainers (Core Team) |
| 114 | + |
| 115 | +**What they need:** |
| 116 | +- Internal architecture |
| 117 | +- Release process |
| 118 | +- Module deep-dives |
| 119 | + |
| 120 | +**Where to find:** |
| 121 | +- `.dev/README.md` → Maintainer guide |
| 122 | +- `tools/*/README.md` → Module details |
| 123 | +- `.dev/DOCUMENTATION_ARCHITECTURE.md` → This file |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## 📋 Documentation Checklist |
| 128 | + |
| 129 | +### When Adding a New Feature |
| 130 | + |
| 131 | +- [ ] Update `README.md` if user-facing |
| 132 | +- [ ] Update `tools/README.md` if developer tool |
| 133 | +- [ ] Add module README if new module |
| 134 | +- [ ] Update relevant CONTRACT files if API change |
| 135 | + |
| 136 | +### When Adding a New Tool |
| 137 | + |
| 138 | +- [ ] Add to `tools/README.md` quick reference table |
| 139 | +- [ ] Add detailed section in `tools/README.md` |
| 140 | +- [ ] Create `tools/<module>/README.md` if complex |
| 141 | +- [ ] Add tests to `.dev/tests/` or `tools/tests/` |
| 142 | + |
| 143 | +### When Modifying Documentation Structure |
| 144 | + |
| 145 | +- [ ] Update this file (`DOCUMENTATION_ARCHITECTURE.md`) |
| 146 | +- [ ] Update `docs/MKDOCS_CONTENT_GUIDE.md` |
| 147 | +- [ ] Update `mkdocs.yml` if adding to website |
| 148 | +- [ ] Update README documentation section |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +## 🏗️ Industry Best Practices |
| 153 | + |
| 154 | +This structure follows patterns from well-known open source projects: |
| 155 | + |
| 156 | +### Flask / Django Pattern |
| 157 | + |
| 158 | +``` |
| 159 | +project/ |
| 160 | +├── docs/ # Sphinx/MkDocs user documentation |
| 161 | +├── scripts/ # Scripts with their own README |
| 162 | +└── CONTRIBUTING.md # Contributor guide |
| 163 | +``` |
| 164 | + |
| 165 | +### Kubernetes Pattern |
| 166 | + |
| 167 | +``` |
| 168 | +project/ |
| 169 | +├── docs/ # User documentation |
| 170 | +├── hack/ # Developer scripts and tools |
| 171 | +└── contributor/ # Contributor documentation |
| 172 | +``` |
| 173 | + |
| 174 | +### Our Adaptation |
| 175 | + |
| 176 | +``` |
| 177 | +neetcode/ |
| 178 | +├── docs/ # User documentation (MkDocs) |
| 179 | +├── tools/ # Developer tools (with README.md) |
| 180 | +└── .dev/ # Maintainer documentation |
| 181 | +``` |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +## ❓ FAQ |
| 186 | + |
| 187 | +### Why separate `docs/` from `tools/`? |
| 188 | + |
| 189 | +- `docs/` → Published to website, user-facing |
| 190 | +- `tools/` → GitHub-only, developer-facing |
| 191 | + |
| 192 | +Different audiences, different update cycles, different review requirements. |
| 193 | + |
| 194 | +### Why `.dev/` for maintainer docs? |
| 195 | + |
| 196 | +- Clearly signals "internal" documentation |
| 197 | +- Keeps root directory clean |
| 198 | +- Groups with test files (same audience) |
| 199 | + |
| 200 | +### Why not put everything in `docs/`? |
| 201 | + |
| 202 | +- MkDocs publishes everything in `docs/` to the website |
| 203 | +- Internal documentation shouldn't be public-facing |
| 204 | +- Separation allows different access controls |
| 205 | + |
| 206 | +### How do I know where to add new documentation? |
| 207 | + |
| 208 | +Ask: **Who is the primary reader?** |
| 209 | + |
| 210 | +| Reader | Location | |
| 211 | +|--------|----------| |
| 212 | +| User learning the framework | `docs/` | |
| 213 | +| Contributor adding features | `tools/README.md` | |
| 214 | +| Maintainer debugging issues | `.dev/` | |
| 215 | + |
| 216 | +--- |
| 217 | + |
| 218 | +## 📝 Update Log |
| 219 | + |
| 220 | +- **2025-12-12**: Initial version - Documented architecture after consolidating tools documentation |
| 221 | + |
| 222 | +--- |
| 223 | + |
| 224 | +## 🔗 Related Documents |
| 225 | + |
| 226 | +- [Maintainer Guide](.dev/README.md) |
| 227 | +- [Testing Documentation](.dev/TESTING.md) |
| 228 | +- [MkDocs Content Guide](docs/MKDOCS_CONTENT_GUIDE.md) |
| 229 | +- [Tools Reference](tools/README.md) |
| 230 | + |
0 commit comments