A modern, dual-service documentation platform that provides a central landing page for all ITlusions documentation sites. The hub consists of a MkDocs Material frontend and a Node.js REST API backend, enabling automatic discovery and aggregation of distributed documentation sites.
The ITL Documentation Hub serves as:
- Central Landing Page - Single entry point for all ITL documentation with live statistics
- Service Registry - REST API for automatic registration and discovery of documentation sites
- Health Monitoring - Real-time monitoring of registered documentation sites with uptime tracking
- Statistics Dashboard - Visual insights into documentation usage and site availability
- Unified Search - Cross-documentation search and navigation (planned)
The hub consists of two main services working together:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β MkDocs Site β β MkDocs Site β β MkDocs Site β
β (Identity) β β (Kubernetes) β β (Monitoring) β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
β Registration API β Registration API β Registration API
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββ
β Documentation Hub β
β β
β βββββββββββββββββββ β
β β Frontend β β Port 8080
β β MkDocs+nginx β β ββ Landing page
β β Material Theme β β ββ Site registry
β βββββββββββββββββββ β ββ Statistics
β β β
β βββββββββββΌββββββββ β
β β API Backend β β Port 3000
β β Node.js/ β β ββ Site registration
β β Express β β ββ Health checks
β βββββββββββββββββββ β ββ Statistics API
βββββββββββββββββββββββββββ
-
Frontend Service (
docs-hub-frontend)- Technology: MkDocs Material + nginx
- Port: 8080
- Purpose: Serves the documentation landing page with dynamic site registry
- Features: Statistics dashboard, responsive design, real-time updates
-
API Backend (
docs-api)- Technology: Node.js + Express
- Port: 3000
- Purpose: REST API for site registration and health monitoring
- Features: JWT authentication, rate limiting, comprehensive testing
- Node.js 18+ and npm (for API backend)
- Python 3.11+ and pip (for frontend)
- Docker and Docker Compose (recommended)
- Git
-
Clone and setup:
git clone https://github.com/ITlusions/ITL.Docs.Hub.git cd ITL.Docs.Hub -
Start both services:
# Start both frontend and API docker-compose up -d # View logs docker-compose logs -f
-
Access the services:
- Frontend: http://localhost:8080 (Documentation hub)
- API: http://localhost:3000/api (REST endpoints)
- Health checks:
- Frontend: http://localhost:8080/health
- API: http://localhost:3000/api/health
# Install Python dependencies
pip install -r requirements.txt
# Start MkDocs development server
mkdocs serve --dev-addr=0.0.0.0:8080# Navigate to API directory
cd api
# Install Node.js dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Start API server
npm start
# or for development with auto-reload
npm run dev- β REST API Registration - Simple API endpoint to register documentation sites
- β JWT Authentication - Secure API access with token-based authentication
- β Health Monitoring - API endpoints for site health checking
- β Version Tracking - Track documentation versions and deployments
- β Comprehensive Testing - Full Jest test suite with 17+ test cases
- β Modern Landing Page - Material Design documentation hub
- β Live Statistics - Real-time statistics dashboard showing registered sites
- β Site Registry - Dynamic listing of all registered documentation sites
- β Responsive Design - Mobile-friendly interface with dark/light mode
- β Health Status - Visual indicators for site availability
- β Dual-Service Architecture - Separate frontend and API services
- β Docker Containerization - Full Docker Compose setup
- β Kubernetes Deployment - Production-ready Helm charts
- β CI/CD Pipeline - GitHub Actions with security scanning
- β Rate Limiting - API protection against abuse
- β Comprehensive Logging - Structured logging for debugging
- Unified Search - Cross-documentation search functionality
- Analytics Dashboard - Usage and performance metrics
- Notification System - Health alerts and status updates
- Content Aggregation - Cross-site content indexing
The REST API provides endpoints for managing documentation sites. All endpoints require JWT authentication.
First, obtain an authentication token:
curl -X POST http://localhost:3000/api/auth \
-H "Content-Type: application/json" \
-d '{"password": "admin123"}'curl -X POST http://localhost:3000/api/sites \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"name": "My Documentation",
"description": "Description of my documentation",
"url": "https://docs.itlusions.com/my-docs/",
"icon": "material/book",
"category": "Platform",
"tags": ["platform", "guide"],
"version": "v1.0.0"
}'| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/health |
API health check | β |
GET |
/api/sites |
List all registered sites | β |
GET |
/api/stats |
Get statistics dashboard data | β |
POST |
/api/auth |
Authenticate and get JWT token | β |
POST |
/api/sites |
Register new documentation site | β |
PUT |
/api/sites/:id |
Update existing site | β |
DELETE |
/api/sites/:id |
Remove site from registry | β |
Add to your deployment workflow:
- name: Register with Documentation Hub
run: |
# Get authentication token
TOKEN=$(curl -s -X POST http://docs-hub.internal/api/auth \
-H "Content-Type: application/json" \
-d '{"password": "${{ secrets.DOCS_HUB_PASSWORD }}"}' | \
jq -r '.token')
# Register the site
curl -X POST http://docs-hub.internal/api/sites \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"name": "${{ env.SITE_NAME }}",
"description": "${{ env.SITE_DESCRIPTION }}",
"url": "${{ env.DEPLOYMENT_URL }}",
"version": "${{ github.ref_name }}",
"repository": "${{ github.repository }}",
"commit": "${{ github.sha }}"
}'Use the provided testing scripts:
# PowerShell (Windows)
.\test-api.ps1
# Bash (Linux/macOS)
./test-api.shOr run the automated test suite:
cd api
npm testITL.Docs.Hub/
βββ docs/ # MkDocs frontend content
β βββ index.md # Landing page with dynamic registry
β βββ registry.md # Site registry page
β βββ statistics.md # Statistics dashboard
β βββ getting-started.md # Integration guide
βββ api/ # Node.js API backend
β βββ server.js # Express server
β βββ package.json # Node.js dependencies
β βββ data/ # JSON data storage
β β βββ sites.json # Registered sites database
β βββ __tests__/ # Jest test suite
β β βββ api.test.js # Comprehensive API tests
β βββ Dockerfile # API container image
βββ charts/ # Helm chart for Kubernetes
β βββ docs-hub/ # Production deployment
βββ .github/workflows/ # CI/CD pipeline
β βββ ci.yml # GitHub Actions workflow
βββ docker-compose.yml # Local development setup
βββ Dockerfile.frontend # Frontend container image
βββ mkdocs.yml # MkDocs configuration
βββ test-api.ps1 / test-api.sh # API testing scripts
DOCS_HUB_API_URL- API backend URL (default:http://docs-api:3000/api)
NODE_ENV- Environment mode (development,production,test)PORT- API server port (default:3000)JWT_SECRET- Secret key for JWT token signing (β οΈ Change in production!)ADMIN_PASSWORD- Admin password for authentication (β οΈ Change in production!)
The docker-compose.yml file includes:
# Frontend on port 8080
docs-hub-frontend:
build:
dockerfile: Dockerfile.frontend
ports: ["8080:8080"]
# API on port 3000
docs-api:
build:
context: ./api
ports: ["3000:3000"]
environment:
- JWT_SECRET=your-secret-key
- ADMIN_PASSWORD=your-admin-passwordπ Important: Change default credentials before deployment:
-
Generate secure JWT secret:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" -
Set strong admin password in environment variables
-
Use HTTPS in production with proper TLS certificates
For production deployment, create a production docker-compose file:
# Create production compose file
cp docker-compose.yml docker-compose.prod.yml
# Update environment variables for production
# Edit docker-compose.prod.yml:
# - Change JWT_SECRET and ADMIN_PASSWORD
# - Set NODE_ENV=production
# - Configure proper volumes for data persistence
# Deploy to production
docker-compose -f docker-compose.prod.yml up -dUse the included Helm chart for production Kubernetes deployment:
# Add custom values
helm install docs-hub ./charts/docs-hub \
--set frontend.image.repository=ghcr.io/itlusions/docs-hub-frontend \
--set frontend.image.tag=latest \
--set api.image.repository=ghcr.io/itlusions/docs-hub-api \
--set api.image.tag=latest \
--set ingress.enabled=true \
--set ingress.hosts[0].host=docs.itlusions.com \
--set api.auth.jwtSecret="your-secure-jwt-secret" \
--set api.auth.adminPassword="your-secure-admin-password"For simple single-service deployment:
# Frontend only (without API)
docker run -d \
--name docs-hub-frontend \
-p 8080:8080 \
ghcr.io/itlusions/docs-hub-frontend:latest
# API only (without frontend)
docker run -d \
--name docs-hub-api \
-p 3000:3000 \
-e JWT_SECRET=your-secret \
-e ADMIN_PASSWORD=your-password \
ghcr.io/itlusions/docs-hub-api:latestThe project includes comprehensive Jest tests covering all API functionality:
# Run all tests
cd api && npm test
# Run tests with coverage
cd api && npm test -- --coverage
# Run tests in watch mode (for development)
cd api && npm test -- --watchUse the provided testing scripts to verify API functionality:
# PowerShell script (Windows)
.\test-api.ps1
# Bash script (Linux/macOS)
./test-api.shBoth scripts test:
- API health checks
- Authentication
- Site registration and management
- Statistics endpoint
- Error handling
Test the full application stack:
# Start services
docker-compose up -d
# Wait for services to be ready
sleep 10
# Test frontend
curl -f http://localhost:8080/health
# Test API
curl -f http://localhost:3000/api/health
# Run API integration tests
.\test-api.ps1
# Cleanup
docker-compose downBoth services include comprehensive health checks:
# Check frontend status
curl http://localhost:8080/health
# Response: "OK" (nginx health check)# Check API status
curl http://localhost:3000/api/health
# Response:
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00.000Z",
"version": "1.0.0",
"uptime": "00:05:30",
"environment": "development"
}Access real-time statistics:
# Get hub statistics
curl http://localhost:3000/api/stats
# Response:
{
"totalSites": 3,
"activeSites": 2,
"categories": ["Platform", "Infrastructure", "Monitoring"],
"recentActivity": [...],
"systemInfo": {
"uptime": "2 days",
"version": "1.0.0"
}
}Docker Compose includes automated health monitoring:
- Frontend: HTTP check on port 8080/health every 30s
- API: HTTP check on port 3000/api/health every 30s
- Restart Policy: Automatic restart on failure
The application includes built-in Prometheus metrics support for comprehensive monitoring:
The API exposes metrics at /metrics endpoint for Prometheus scraping:
# Access metrics endpoint
curl http://localhost:3000/metricsAvailable Metrics:
-
HTTP Metrics:
http_requests_total- Total number of HTTP requests by method, route, and statushttp_request_duration_seconds- Request duration histogram
-
Application Metrics:
docs_hub_sites_total- Total number of registered documentation sitesdocs_hub_sites_healthy- Number of healthy sitesdocs_hub_sites_by_category{category}- Sites count per categorydocs_hub_site_pages_total- Total documentation pagesdocs_hub_health_check_duration_seconds- Health check duration histogramdocs_hub_health_check_errors_total- Health check errors counter
-
Node.js Metrics (default):
- Process CPU usage, memory, event loop lag, etc.
The Helm chart includes a ServiceMonitor resource for automatic Prometheus discovery:
# Enable Prometheus monitoring
serviceMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10sFor manual Prometheus configuration, add this scrape config:
scrape_configs:
- job_name: 'docs-hub-api'
static_configs:
- targets: ['docs-hub-api:3000']
metrics_path: '/metrics'
scrape_interval: 30sFor production deployments, consider integrating with:
- Grafana - Visualize Prometheus metrics with dashboards
- ELK Stack - Log aggregation and analysis
- Uptime monitoring - External health monitoring (UptimeRobot, Pingdom)
- Alert Manager - Incident notifications and alerting
The ITL Documentation Hub includes comprehensive Grafana dashboards for monitoring API performance, health metrics, and system resources.
Overview Dashboard - Complete monitoring view of the documentation hub:
The dashboard provides monitoring for:
- HTTP Status Codes - Track 200, 304, and error responses with 5-minute rate monitoring
- Documentation Sites - Monitor total and healthy registered sites
- HTTP Request Rate - Request volume by HTTP method (GET, POST, PUT, DELETE)
- Response Time Metrics - Average response times with multiple percentile tracking
- Request Patterns - Traffic analysis for key endpoints like
/api/health,/api/sites,/metrics
Performance Metrics - System resource monitoring:
Resource monitoring includes:
- Memory Usage - Resident memory, heap used, and heap total tracking
- CPU Usage - User CPU %, System CPU %, and Total CPU % monitoring
- Response Time Percentiles - 50th, 95th, and 99th percentile response time analysis
- Real-time Updates - 30-second refresh interval for live monitoring
- Time Range Controls - Configurable time windows (1 hour default)
- Interactive Navigation - Direct links to Documentation Hub, Metrics Endpoint, and Monitoring Guide
- Data Source Integration - Connected to ITL Prometheus instance
- Performance Baselines - Historical trend analysis for capacity planning
- Dashboard URL: https://grafana.dev.itlusions.nl/d/itl-docs-hub-api/itl-documentation-hub-api-monitoring
- Tags:
api,docs-hub,itlusions,monitoring - Refresh Rate: 30 seconds
- Time Zone: Europe/Amsterdam (CEST)
For additional monitoring setup and configuration, see the Monitoring Guide.
We welcome contributions! Here's how to get started:
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/ITL.Docs.Hub.git cd ITL.Docs.Hub -
Setup development environment:
# Backend setup cd api npm install cp .env.example .env # Frontend setup cd .. python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Start development services:
# Option 1: Use Docker Compose (recommended) docker-compose up -d # Option 2: Manual startup # Terminal 1: Start API cd api && npm run dev # Terminal 2: Start frontend mkdocs serve --dev-addr=0.0.0.0:8080
- Create feature branch:
git checkout -b feature/your-feature-name - Make your changes to frontend (
docs/,mkdocs.yml) or backend (api/) - Test your changes:
# Test API changes cd api && npm test # Test frontend changes mkdocs serve # Test integration .\test-api.ps1
- Commit and push: Follow conventional commit messages
- Submit pull request with clear description
- Backend: Follow Node.js best practices, add tests for new endpoints
- Frontend: Use Material for MkDocs conventions, ensure responsive design
- Documentation: Update README.md and API docs for any changes
- Testing: Maintain test coverage above 80%
Please use GitHub Issues with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Docker version, etc.)
Report security vulnerabilities privately to security@itlusions.com
-
Add to your CI/CD pipeline:
# .github/workflows/deploy.yml - name: Register with Docs Hub run: | TOKEN=$(curl -s -X POST $DOCS_HUB_URL/api/auth \ -H "Content-Type: application/json" \ -d '{"password": "${{ secrets.DOCS_HUB_PASSWORD }}"}' | \ jq -r '.token') curl -X POST $DOCS_HUB_URL/api/sites \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "My Docs", "description": "My documentation site", "url": "${{ env.DEPLOYMENT_URL }}", "category": "Platform", "version": "${{ github.ref_name }}" }'
-
Add health check to your MkDocs site:
<!-- docs/health.md --> # Health Check β **Status**: Online π **Version**: v1.0.0 π **Last Updated**: 2024-01-01
-
Configure MkDocs for integration:
# mkdocs.yml nav: - Home: index.md - Health: health.md extra: docs_hub: enabled: true url: https://docs.itlusions.com
- β Dual-Service Architecture - Frontend + API backend
- β Site Registration API - Full CRUD operations
- β Statistics Dashboard - Real-time metrics
- β Authentication System - JWT-based security
- β Docker Deployment - Production-ready containers
- β Comprehensive Testing - 17+ automated test cases
- β Health Monitoring - Service health checks
- π§ Search Integration - Cross-site search functionality
- π§ Enhanced Statistics - Advanced metrics and analytics
- π§ API Documentation - Interactive API docs with Swagger
- β³ Notification System - Health alerts and status updates
- β³ Theme Customization - Organization-specific branding
- β³ Content Aggregation - Cross-site content indexing
- β³ Advanced Analytics - Usage patterns and insights
- β³ Multi-tenant Support - Organization-based access control
This project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: support@itlusions.com
- π Issues: GitHub Issues
- π Documentation: docs.itlusions.com
- π¬ Discussions: GitHub Discussions
Made with β€οΈ by the ITlusions Team
Bringing order to distributed documentation, one API call at a time. π

