System Architecture
This system architecture documentation is restricted to administrators and system maintainers.
Overview
This documentation site is built using MkDocs with the Material theme, enhanced with custom plugins and JavaScript. The architecture follows a modern static site generation approach with dynamic client-side features for authentication and role-based access control.
Core Components
The documentation system consists of these key components:
- MkDocs Core - Static site generator that converts Markdown to HTML
- Material Theme - Enhanced UI with responsive design
- Custom JavaScript - Client-side authentication and role management
- Custom Theme Overrides - Templates for header, footer, and layout customization
graph TD
A[Markdown Content] -->|MkDocs Build| B[Static HTML]
B -->|Served to Browser| C[Client Browser]
C -->|JavaScript| D{Authentication Check}
D -->|Authenticated| E[Render Content]
D -->|Not Authenticated| F[Redirect to SSO]
G[Custom Plugins] -->|Enhance| B
H[Material Theme] -->|Style| B
I[Custom JS] -->|Dynamic Features| C Authentication Flow
The documentation uses a client-side authentication flow that integrates with RFG Studio's SSO system:
sequenceDiagram
participant User
participant DocSite as Documentation Site
participant SSO as SSO Service
participant Permissions as Permissions Service
User->>DocSite: Access page
DocSite->>DocSite: Check local storage for token
alt No valid token
DocSite->>SSO: Redirect to login
SSO->>User: Present login form
User->>SSO: Enter credentials
SSO->>DocSite: Redirect with token
DocSite->>DocSite: Store token in localStorage
end
DocSite->>Permissions: Request user roles
Permissions->>DocSite: Return roles array
alt Has sufficient permissions
DocSite->>User: Show content
else Insufficient permissions
DocSite->>User: Show access denied
end File Structure
The documentation site follows this organizational structure:
internal-documentation/
├── docs/ # Content root
│ ├── js/ # Custom JavaScript
│ │ ├── sso-auth.js # Authentication logic
│ │ ├── admin-nav.js # Admin navigation
│ │ └── ... # Other JS utilities
│ ├── css/ # Custom CSS
│ ├── theme/ # Theme customizations
│ │ └── main.html # Header & layout overrides
│ ├── index.md # Home page
│ ├── getting-started/ # Getting started guides
│ ├── guidelines/ # Style guidelines
│ ├── guides/ # Usage guides
│ ├── hidden/ # Admin-only content
│ └── ... # Other content sections
├── mkdocs.yml # Configuration
└── requirements.txt # Python dependencies
Authentication & Authorization
SSO Integration
The site integrates with RFG Studio's Single Sign-On (SSO) system for authentication. The implementation is primarily client-side using JavaScript:
- sso-auth.js - Handles authentication flow, token management, and role verification
- admin-nav.js - Provides role-specific UI elements based on permissions
graph LR
A[User Visit] --> B{Check Auth}
B -->|No Token| C[Redirect to SSO]
C --> D[SSO Login]
D --> E[Return with Token]
E --> F[Store Token]
F --> G[Check Roles]
B -->|Has Token| G
G -->|Admin| H[Show Admin UI]
G -->|Dev| I[Show Dev UI]
G -->|Other| J[Limited Access] Role-Based Access
Access control is implemented through these mechanisms:
- Client-side permission checks - Restricts UI elements based on user role
- Hidden URL paths - Admin-only content under /hidden/
- Role simulation - Allows admins to test as different roles
Customization
Theme Customizations
The MkDocs Material theme has been extended with custom:
- Header elements - Title, settings button, and print button
- Footer content - Copyright and links
- Color schemes - Light and dark modes
- Navigation - Tab-based top-level sections
JavaScript Enhancements
Several custom scripts enhance the functionality:
- fix-mobile-sidebar.js - Ensures proper mobile navigation
- image-gallery.js - Provides image gallery support
- site-cleaner.js - Removes unnecessary UI elements
- nav-helper.js - Improves navigation experience
Deployment Architecture
The documentation site is deployed using this architecture:
graph TD
A[Git Repository] -->|Commit| B[CI/CD Pipeline]
B -->|Build| C[MkDocs Build]
C -->|Static Files| D[Web Server]
D -->|Serve| E[End User]
F[CDN] -->|Cache Assets| E Local Development
Local development environment uses:
mkdocs servefor local preview- Automatic local-mode detection for SSO bypass
- Role simulation capabilities for testing different permission levels
Security Considerations
- Authentication - Client-side token storage in localStorage
- Role verification - Role checks performed on each page load
- Admin content - Hidden paths for sensitive content
- Token expiration - Automatic logout after token expires
Performance Optimizations
- Static generation - Pre-built HTML for fast loading
- CSS minification - Reduced stylesheet size
- JavaScript optimization - On-demand loading when possible
- Image optimization - Proper sizing and formats
Known Limitations
- Client-side authentication means initial page load may show restricted content briefly
- Role simulation only works for admins testing lower permission levels
- Mobile responsiveness has some edge cases on very small screens