--- title: CoreDoc Directory Structure version: 1.0.0 date: 2026-10-25 author: Momentry Core Team status: Active --- # CoreDoc Directory Structure ## Overview This document provides a complete mapping of all CoreDoc directories and files. --- ## Primary Locations ### 1. DocServer Source Code ``` /Users/accusys/momentry_core/src/bin/docserver/ └── main.rs # HTTP server implementation ├── Lines: ~150 ├── Framework: axum ├── Features: │ ├── HTTP Basic Auth │ ├── Static file serving │ ├── WASM module serving │ └── CORS support └── Dependencies: ├── axum ├── tower-http └── base64 ``` --- ### 2. Documentation Content Directories #### 2.1 Legacy WASM System ``` /Users/accusys/momentry_core/docs_v1.0/doc_wasm/ ├── index.html # Main UI (432 lines) │ ├── Sidebar navigation │ ├── Content viewer │ └── WASM integration ├── logout.html # Logout page (2,115 bytes) ├── test.html # Test page (288 bytes) ├── README.md # Status documentation (1,977 bytes) │ └── Status: DEPRECATED ├── modules/ # Documentation modules │ ├── 000_Welcome.md # Welcome page │ ├── 001_Auth_v1.3.5.md # Authentication API │ ├── 002_Health_v1.3.5.md # Health check API │ ├── 011_Register_v1.3.5.md # Register API │ ├── 012_Lookup_v1.3.5.md # Lookup API │ ├── ... (total 68 files) │ └── _template.md # Module template └── pkg/ # WASM compilation output ├── doc_wasm_bg.wasm # Legacy WASM (223KB) ├── doc_wasm.js # Legacy JS bindings (7.4KB) ├── md_wasm_bg.wasm # Current WASM (291KB) └── md_wasm.js # Current JS bindings (7.2KB) ``` #### 2.2 New Modular System ``` /Users/accusys/momentry_core/docs_v1.0/ ├── API_WORKSPACE/ # API Documentation │ ├── modules/ # API module files │ │ ├── 001_Auth_API.md │ │ ├── 002_Health_API.md │ │ ├── ... (organized by API) │ │ └── README.md │ ├── README.md # API docs overview │ └── Makefile # Build automation ├── CLI_WORKSPACE/ # CLI Documentation │ ├── modules/ # CLI module files │ │ ├── 101_Register_CLI.md │ │ ├── 102_Lookup_CLI.md │ │ ├── ... (organized by CLI command) │ │ └── README.md │ └── README.md # CLI docs overview └── README.md # Main documentation index ``` --- ### 3. WASM Source Code ``` /Users/accusys/momentry_core/md_wasm/ ├── Cargo.toml # Rust project configuration │ ├── name: md_wasm │ ├── version: 0.1.0 │ ├── edition: 2021 │ └── crate-type: ["cdylib"] ├── src/ │ └── lib.rs # WASM library source │ ├── Lines: ~20 │ ├── Function: render(md: &str) -> String │ └── Dependencies: │ ├── wasm-bindgen │ └── pulldown-cmark └── target/ └── wasm32-unknown-unknown/ └── release/ ├── md_wasm.wasm # Compiled WASM binary └── md_wasm.d # Dependency info ``` **WASM Source Code**: ```rust use wasm_bindgen::prelude::*; #[wasm_bindgen] pub fn render(md: &str) -> String { let mut opts = pulldown_cmark::Options::empty(); opts.insert(pulldown_cmark::Options::ENABLE_TABLES); let parser = pulldown_cmark::Parser::new_ext(md, opts); let mut html = String::new(); pulldown_cmark::html::push_html(&mut html, parser); html = html.replace("", "
"); html } ``` --- ### 4. Configuration Files ``` /Users/accusys/momentry_core/ ├── run-docserver.sh # Startup script │ ├── Loads .env.docserver │ ├── Sets environment variables │ └── Starts ./target/release/docserver ├── .env.docserver # Environment configuration │ ├── DOCSERVER_PORT=8000 │ ├── DOCSERVER_USER=admin │ ├── DOCSERVER_PASSWORD=admin123 │ └── MOMENTRY_DOCS_DIR=... └── Cargo.toml # Main project config └── [[bin]] └── name = "docserver" ``` --- ### 5. Markbase Integration (New) ``` /Users/accusys/markbase/ ├── docs/ │ └── core-doc/ # CoreDoc documentation │ ├── README.md │ ├── DIRECTORY_STRUCTURE.md │ ├── ARCHITECTURE.md │ ├── MAINTENANCE_GUIDE.md │ ├── INTEGRATION_GUIDE.md │ └── API_REFERENCE.md ├── markbase-core/ │ └── src/ │ └── server.rs # Route integration │ └── .nest("/docs", docs_routes()) └── static/ └── docs/ # Documentation static files ├── legacy/ # Legacy WASM system ├── api/ # API documentation └── cli/ # CLI documentation ``` --- ## File Statistics | Category | Count | Total Size | |----------|-------|------------| | **Documentation Modules** | 68 | ~500KB | | **WASM Binaries** | 2 | 514KB | | **HTML Files** | 3 | ~20KB | | **Source Code Files** | 2 | ~5KB | | **Configuration Files** | 3 | ~1KB | --- ## Directory Purposes ### Source Code Directories | Directory | Purpose | Maintenance Frequency | |-----------|---------|----------------------| | `src/bin/docserver/` | HTTP server | Low (stable) | | `md_wasm/` | WASM renderer | Low (stable) | ### Content Directories | Directory | Purpose | Maintenance Frequency | |-----------|---------|----------------------| | `doc_wasm/modules/` | Legacy documentation | Low (deprecated) | | `API_WORKSPACE/modules/` | API documentation | High (active) | | `CLI_WORKSPACE/modules/` | CLI documentation | High (active) | ### Build Artifacts | Directory | Purpose | Regeneration | |-----------|---------|--------------| | `doc_wasm/pkg/` | WASM binaries | On WASM source changes | | `target/` | Compiled binaries | On code changes | --- ## Environment Variables | Variable | Default | Purpose | |----------|---------|---------| | `DOCSERVER_PORT` | 8000 | Server port | | `DOCSERVER_USER` | admin | Auth username | | `DOCSERVER_PASSWORD` | admin123 | Auth password | | `MOMENTRY_DOCS_DIR` | `docs_v1.0/doc_wasm` | Documentation directory | --- ## Related Documents - [Architecture](./ARCHITECTURE.md) - How components work together - [Maintenance Guide](./MAINTENANCE_GUIDE.md) - How to maintain each directory - [Integration Guide](./INTEGRATION_GUIDE.md) - Directory mapping for Markbase --- ## Version History | Version | Date | Changes | |---------|------|---------| | 1.0.0 | 2026-10-25 | Initial directory structure documentation |