Documentation System Guide
CloudAlt Documentation System
Section titled “CloudAlt Documentation System”CloudAlt uses a unified documentation architecture with three separate Astro + Starlight sites that work together seamlessly.
🏗️ Architecture Overview
Section titled “🏗️ Architecture Overview”Three Independent Sites, One Domain
Section titled “Three Independent Sites, One Domain”Our documentation is organized into three specialized Astro sites, each deployed to Cloudflare Pages with its own subdomain:
| Site | URL | Source Location | Purpose |
|---|---|---|---|
| Landing Page | docs.cloudalt.app | cloudalt-frontend/apps/docs-hub/ | Entry point with navigation to all docs |
| Frontend Docs | frontend.docs.cloudalt.app | cloudalt-frontend/apps/docs/ | React/React Native guides, component library |
| Backend Docs | backend.docs.cloudalt.app | cloudalt-backend/docs-site/ | Django API reference, database schemas |
| Storybook | storybook.cloudalt.app | cloudalt-frontend/storybook-static/ | Component library with live examples |
Why This Architecture?
Section titled “Why This Architecture?”✅ Team Ownership - Each team maintains their own documentation independently
✅ Fast Deployments - Deploy docs without rebuilding unrelated sites
✅ Unified Search - Pagefind indexes all sites for cross-documentation search
✅ Single Sign-On - GitHub OAuth via Cloudflare Access, session shared across all *.docs.cloudalt.app
✅ Simple Scaling - Easy to add new documentation sites (mobile, architecture, etc.)
Architecture Decision: See ARCHITECTURE_DECISION_DOCS_SECURITY.md for the full technical breakdown.
🚀 Quick Start
Section titled “🚀 Quick Start”Prerequisites
Section titled “Prerequisites”- Node.js: 20.19.5 or higher
- npm: Comes with Node.js
- Git: For version control
Backend Documentation (This Site)
Section titled “Backend Documentation (This Site)”# Navigate to backend docscd cloudalt-backend/docs-site
# Install dependenciesnpm install --legacy-peer-deps
# Start development servernpm run dev# Opens at http://localhost:4321
# Build for productionnpm run build
# Preview production buildnpm run previewFrontend Documentation
Section titled “Frontend Documentation”# Navigate to frontend docscd cloudalt-frontend/apps/docs
# Install dependencies (if not already done)yarn install
# Start development serveryarn dev# Opens at http://localhost:4321
# Build for productionyarn build📝 Writing Documentation
Section titled “📝 Writing Documentation”File Structure
Section titled “File Structure”All documentation uses Markdown (.md) or MDX (.mdx) files in the src/content/docs/ directory:
docs-site/├── src/│ └── content/│ └── docs/│ ├── index.mdx # Homepage│ ├── getting-started/ # Getting started guides│ ├── architecture/ # Architecture docs│ │ ├── overview.md│ │ └── diagrams.md # ← Architecture diagrams with zoom!│ ├── api/ # API reference│ ├── deployment/ # Deployment guides│ └── contributing/ # This file!Creating a New Page
Section titled “Creating a New Page”- Create a Markdown file in the appropriate directory:
touch src/content/docs/api/new-endpoint.md- Add frontmatter at the top:
---title: New Endpoint Guidedescription: How to use the new API endpoint---
# New Endpoint Guide
Your content here...- The page is automatically added to the sidebar (using
autogenerateinastro.config.mjs)
Markdown Features
Section titled “Markdown Features”Headings
Section titled “Headings”# H1 - Page Title (only one per page)## H2 - Major Section### H3 - Subsection#### H4 - Sub-subsectionCode Blocks
Section titled “Code Blocks”```python# Python code with syntax highlightingdef hello(): return "Hello, CloudAlt!"```
```bash# Shell commandsnpm install medium-zoom```Callouts/Asides
Section titled “Callouts/Asides”:::noteThis is informational content.:::
:::tipPro tip for users!:::
:::cautionBe careful with this operation.:::
:::dangerThis could break things!:::[Internal link](/api/stays/)[External link](https://github.com/xavierdurant/cloudalt-backend)Images
Section titled “Images”Images automatically have zoom functionality! Click any image to view full-size.
🖼️ Image Zoom Feature
Section titled “🖼️ Image Zoom Feature”All images in the documentation have click-to-zoom functionality powered by medium-zoom.
How It Works
Section titled “How It Works”- Hover over any image - cursor changes to zoom-in cursor
- Click the image - it expands to full screen with dark overlay
- Click again or press ESC - returns to normal view
Best Practices for Images
Section titled “Best Practices for Images”- Use high-resolution images - zoom makes them viewable in detail
- Architecture diagrams are perfect for this feature
- Small icons automatically excluded from zoom (< 32px width)
- PNG format recommended for diagrams (better quality than JPG)
Adding Images
Section titled “Adding Images”- Place images in the
public/directory:
cloudalt-backend/docs-site/public/diagrams/my-diagram.png- Reference in Markdown:
- Image is automatically zoomable - no extra configuration needed!
Technical Implementation
Section titled “Technical Implementation”The zoom feature uses:
- medium-zoom library (lightweight, ~2KB)
- Custom Head component (
src/components/Head.astro) that initializes zoom - Custom CSS for hover effects and zoom cursor
- Dark overlay background (95% black) for optimal viewing
🎨 Customization
Section titled “🎨 Customization”Brand Colors
Section titled “Brand Colors”CloudAlt brand colors are defined in src/styles/custom.css:
:root { --sl-color-accent: #0ABAFF; /* CloudAlt Blue */ --sl-color-gray-1: #94a3b8; /* Medium Grey for headings */}Sidebar Configuration
Section titled “Sidebar Configuration”Edit astro.config.mjs to customize the sidebar:
sidebar: [ { label: 'Start Here', link: '/', }, { label: 'Getting Started', autogenerate: { directory: 'getting-started' }, }, // Add more sections...],🚢 Deployment
Section titled “🚢 Deployment”Automatic Deployment
Section titled “Automatic Deployment”Documentation deploys automatically via GitHub Actions when you push to main:
Workflow: .github/workflows/deploy-backend-docs.yml
on: push: branches: [main] paths: - 'docs-site/**'Manual Deployment
Section titled “Manual Deployment”If you need to deploy manually:
# Build the sitenpm run build
# The built site is in docs-site/dist/# Upload to Cloudflare Pages via dashboard or wranglerDeployment Checklist
Section titled “Deployment Checklist”Before pushing documentation changes:
- Test locally with
npm run dev - Build successfully with
npm run build - Preview build with
npm run preview - Check all links work
- Verify images load correctly
- Test image zoom functionality
- Review for typos and grammar
📚 Starlight Features
Section titled “📚 Starlight Features”Our documentation uses Astro Starlight, which provides:
- ✅ Automatic sidebar generation from file structure
- ✅ Dark/light mode toggle (defaults to dark)
- ✅ Built-in search with Pagefind
- ✅ Mobile-responsive navigation
- ✅ Automatic table of contents for each page
- ✅ Syntax highlighting for code blocks
- ✅ SEO optimization with automatic meta tags
- ✅ Fast performance - static site generation
Starlight Documentation
Section titled “Starlight Documentation”� Search
Section titled “� Search”Search is powered by Pagefind, which automatically indexes all content during the build process.
- Search indexes all three documentation sites
- Results show context snippets
- Keyboard shortcut: Cmd/Ctrl + K
🤝 Contributing
Section titled “🤝 Contributing”Workflow
Section titled “Workflow”-
Create a branch for your changes:
Terminal window git checkout -b docs/add-new-api-guide -
Make your changes in
docs-site/src/content/docs/ -
Test locally:
Terminal window npm run dev -
Build to verify:
Terminal window npm run build -
Commit and push:
Terminal window git add docs-site/git commit -m "docs: Add new API guide for stays endpoint"git push origin docs/add-new-api-guide -
Open a Pull Request on GitHub
Style Guide
Section titled “Style Guide”- Use clear, concise language
- Write in present tense (“Click the button” not “You will click”)
- Use active voice (“Configure the setting” not “The setting can be configured”)
- Include code examples wherever relevant
- Add screenshots for UI-heavy topics
- Use proper Markdown formatting
🛠️ Troubleshooting
Section titled “🛠️ Troubleshooting”Build Errors
Section titled “Build Errors”Error: Cannot find module '@astrojs/starlight'
npm install --legacy-peer-depsError: peer dependency conflicts
# Use legacy peer deps flagnpm install --legacy-peer-depsDevelopment Server Issues
Section titled “Development Server Issues”Port already in use:
# Kill the process on port 4321lsof -ti:4321 | xargs kill -9Images not loading:
- Check images are in
public/directory - Use absolute paths starting with
/ - Example:
/diagrams/image.png
Image Zoom Not Working
Section titled “Image Zoom Not Working”- Hard refresh the browser: Cmd+Shift+R (Mac) or Ctrl+Shift+F5 (Windows)
- Check browser console for JavaScript errors
- Verify
medium-zoomis installed:npm list medium-zoom
📞 Contact
Section titled “📞 Contact”Questions or Issues?
Section titled “Questions or Issues?”Xavier Landeros Durant
Email: xavier@cloudalt.app
For documentation bugs, feature requests, or urgent issues, please reach out directly.
Helpful Resources
Section titled “Helpful Resources”Last Updated: November 6, 2025
Maintained By: Platform Team
Status: ✅ Active