Phase 2.5 wires up the infrastructure decisions and prepares BlackRoad OS for production deployment. This phase codifies architectural choices and creates deployment-ready configurations. ## Key Decisions Codified - ✅ Monorepo as canonical OS home (for Phase 1-2) - ✅ Prism Console served from backend at /prism - ✅ Documentation via GitHub Pages (MkDocs) - ✅ Vanilla JavaScript frontend maintained ## New Infrastructure ### Documentation & Planning - PHASE2_5_SUMMARY_FOR_ALEXA.md - Complete Phase 2.5 summary - BLACKROAD_OS_REPO_MAP.md - Repository structure map - DEPLOYMENT_NOTES.md - Production deployment guide ### Backend Infrastructure - backend/app/routers/prism_static.py - Prism Console static router - backend/static/prism/ - Prism Console UI skeleton - index.html, css/prism.css, js/prism-core.js ### Documentation System - .github/workflows/docs-deploy.yml - MkDocs deployment automation - codex-docs/mkdocs.yml - MkDocs + Material theme config - codex-docs/DEPLOY_DOCS.md - Docs deployment guide - codex-docs/docs/ - Complete documentation structure ### Updated Files - backend/app/main.py - Added Prism router, OpenAPI tags - MASTER_ORCHESTRATION_PLAN.md - Added Phase 2.5 section ## URL Structure (Production) - https://blackroad.systems → Main OS - https://blackroad.systems/prism → Prism Console - https://blackroad.systems/api/* → REST API - https://docs.blackroad.systems → Documentation ## Post-Merge Checklist 1. Configure GitHub Pages (5 min) 2. Configure Railway deployment (10 min) 3. Configure Cloudflare DNS (15 min) 4. Verify all routes work (5 min) 5. Monitor first deployment (10 min) See PHASE2_5_SUMMARY_FOR_ALEXA.md for complete post-merge instructions. ## Implementation Status ✅ Phase 2.5 Complete - Ready for production deployment --- Where AI meets the open road. 🛣️
7.9 KiB
Documentation Deployment Guide
This guide explains how to build, test, and deploy the BlackRoad OS documentation (Codex).
Prerequisites
- Python 3.8+
- pip (Python package manager)
- Git
- GitHub repository access
Quick Start
1. Install Dependencies
# Navigate to codex-docs directory
cd codex-docs
# Install MkDocs and Material theme
pip install mkdocs mkdocs-material pymdown-extensions
2. Test Locally
# Serve documentation locally
mkdocs serve
# Access at: http://localhost:8000
# Docs auto-reload on file changes
3. Build Documentation
# Build static site (strict mode catches errors)
mkdocs build --strict
# Output in: codex-docs/site/
4. Deploy to GitHub Pages
Automatic (Recommended):
Push changes to main branch. GitHub Actions workflow automatically builds and deploys.
Manual:
# Deploy to gh-pages branch
mkdocs gh-deploy
# This creates/updates the gh-pages branch with built site
Configuration
MkDocs Configuration
File: codex-docs/mkdocs.yml
Key settings:
site_name: BlackRoad OS Codex
site_url: https://docs.blackroad.systems
repo_url: https://github.com/blackboxprogramming/BlackRoad-Operating-System
theme:
name: material
palette:
scheme: slate # Dark mode
primary: deep purple
accent: purple
nav:
- Home: index.md
- Architecture: architecture/
- API Reference: api/
- Guides: guides/
- Agents: agents/
- Contributing: contributing.md
Material Theme Customization
Custom CSS: codex-docs/docs/stylesheets/extra.css
/* Add custom styles here */
.md-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
GitHub Pages Setup
Step 1: Enable GitHub Pages
- Go to repository Settings → Pages
- Source:
- Branch:
gh-pages - Folder:
/ (root)
- Branch:
- Click "Save"
Step 2: Configure Custom Domain
In GitHub:
- Settings → Pages → Custom domain
- Enter:
docs.blackroad.systems - ✅ Enforce HTTPS
- Save
In Cloudflare DNS:
Add CNAME record:
| Type | Name | Target | Proxy |
|---|---|---|---|
| CNAME | docs | blackboxprogramming.github.io | ✅ Proxied |
Step 3: Wait for DNS Propagation
# Check DNS
dig docs.blackroad.systems
# Check HTTPS
curl -I https://docs.blackroad.systems
Propagation time: 5-10 minutes
GitHub Actions Workflow
File: .github/workflows/docs-deploy.yml
Workflow triggers:
- Push to
mainbranch (ifcodex-docs/changed) - Manual dispatch (Actions tab → Run workflow)
Steps:
- Checkout code
- Install Python 3.11
- Install MkDocs + Material + pymdown-extensions
- Build with
mkdocs build --strict - Deploy to
gh-pagesbranch
Manual Workflow Trigger
- Go to repository → Actions
- Select "Deploy Documentation" workflow
- Click "Run workflow"
- Select branch:
main - Click "Run workflow"
Writing Documentation
File Structure
codex-docs/
├── mkdocs.yml # Configuration
├── docs/ # Markdown files
│ ├── index.md # Homepage
│ ├── architecture/ # Architecture docs
│ ├── api/ # API reference
│ ├── guides/ # User guides
│ ├── agents/ # Agent docs
│ └── contributing.md # Contributing guide
└── site/ # Built site (gitignored)
Adding a New Page
- Create markdown file in
docs/ - Add to navigation in
mkdocs.yml:
nav:
- New Section:
- Page Title: path/to/file.md
- Test locally:
mkdocs serve - Commit and push
Markdown Extensions
Admonitions (callouts):
!!! note "Title"
This is a note.
!!! warning
This is a warning.
!!! tip
This is a tip.
Code Blocks with syntax highlighting:
```python
def hello():
print("Hello, world!")
```
Tabs:
=== "Python"
```python
print("Hello")
```
=== "JavaScript"
```javascript
console.log("Hello");
```
Diagrams (Mermaid):
```mermaid
graph LR
A[Start] --> B[Process]
B --> C[End]
```
Troubleshooting
Issue: Build fails with "Strict mode"
Cause: Broken links or missing files
Fix:
# Build with verbose output
mkdocs build --strict --verbose
# Check error message for specific issue
# Common issues:
# - Broken internal links
# - Missing images
# - Invalid YAML in frontmatter
Issue: Changes not appearing
Check:
- Workflow ran successfully (GitHub Actions)
gh-pagesbranch updated (check commit time)- Hard refresh browser (Ctrl+F5)
- DNS cache cleared
Debug:
# Check workflow status
gh run list --workflow=docs-deploy.yml
# View workflow logs
gh run view <run-id> --log
Issue: Custom domain not working
Check:
-
CNAME record in Cloudflare:
dig docs.blackroad.systems # Should return: blackboxprogramming.github.io -
GitHub Pages settings:
- Custom domain:
docs.blackroad.systems - Enforce HTTPS: ✅ enabled
- Custom domain:
-
Wait 5-10 minutes for DNS propagation
Issue: CSS not loading
Check:
extra_cssinmkdocs.ymlpoints to correct file- CSS file exists in
docs/stylesheets/ - Hard refresh browser (Ctrl+Shift+R)
Best Practices
Documentation Writing
- Clear titles: Use descriptive H1 headings
- TOC: MkDocs auto-generates table of contents
- Code examples: Always include working examples
- Screenshots: Use when helpful, but keep file size < 500KB
- Links: Use relative links for internal pages
Maintenance
- Update on feature changes: New API endpoints, config options
- Version docs: (future) Use mike for versioning
- Test locally: Always
mkdocs servebefore pushing - Review workflow: Check Actions tab after pushing
Performance
- Image optimization: Use compressed images (PNG/WebP)
- Lazy loading: Material theme handles this
- CDN: GitHub Pages + Cloudflare provide global CDN
Advanced Features
Search Configuration
File: mkdocs.yml
plugins:
- search:
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
Analytics (Future)
File: mkdocs.yml
extra:
analytics:
provider: google
property: G-XXXXXXXXXX # Replace with actual ID
Versioning (Future - Phase 2+)
Use mike for version management:
# Install mike
pip install mike
# Deploy v1.0
mike deploy 1.0 latest -u
# Set default version
mike set-default latest
Deployment Checklist
Before deploying:
- All markdown files render correctly locally
- No broken links (
mkdocs build --strictpasses) - Navigation structure is logical
- Code examples are tested
- Images are optimized
- Frontmatter is valid (if used)
After deploying:
- Workflow completed successfully (GitHub Actions)
- Site accessible at https://docs.blackroad.systems
- Search works
- Navigation works
- Mobile responsive (test on phone)
- SSL enabled (green padlock)
Resources
MkDocs
- Documentation: https://www.mkdocs.org
- Material Theme: https://squidfunk.github.io/mkdocs-material/
- Extensions: https://facelessuser.github.io/pymdown-extensions/
GitHub Pages
- Documentation: https://docs.github.com/en/pages
- Custom domains: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site
Markdown
- CommonMark Spec: https://commonmark.org
- GitHub Flavored Markdown: https://github.github.com/gfm/
Support
- Issues: Report documentation issues on GitHub Issues
- Discussions: Use GitHub Discussions for questions
- Pull Requests: Contributions welcome!
Where AI meets the open road. 🛣️
Documentation deployment guide for BlackRoad OS Codex