Welcome to the Media Vault documentation! This directory contains comprehensive guides and references for setting up, configuring, and maintaining your Media Vault instance.
- Quick Start Guide - Get up and running in minutes
- Deployment Guide - Detailed deployment instructions
- Architecture - System design and components
- User Guide - End-user documentation
- API Reference - Complete API documentation
- Security Guide - Security best practices
- Monitoring - Observability and alerting
- Backup & Recovery - Data protection
- Troubleshooting - Common issues and solutions
docs/
├── API.md # REST API reference and usage
├── ARCHITECTURE.md # System design and components
├── DEPLOYMENT.md # Installation and configuration
├── MONITORING.md # Monitoring and observability
├── README.md # This file
├── SECURITY.md # Security best practices
└── USER_GUIDE.md # End-user documentation
- Docker 20.10+
- Docker Compose 2.0+
- Make (optional but recommended)
- Node.js 16+ (for frontend development)
- Go 1.19+ (for backend development)
-
Clone the repository:
git clone https://github.com/wronai/docker-platform.git cd docker-platform -
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Start the development environment:
make dev
-
Access the applications:
- Web UI: http://localhost:3000
- API: http://localhost:8080
- Documentation: http://localhost:8080/docs
- Monitoring: http://localhost:9090
# Run all tests
make test
# Run backend tests
make test-backend
# Run frontend tests
make test-frontend
# Run integration tests
make test-integration# Create a new migration
make migration-create name=add_user_preferences
# Run pending migrations
make migrate-up
# Rollback last migration
make migrate-down# View application logs
make logs
# View specific service logs
make logs service=backend
# Access Prometheus metrics
open http://localhost:9090
# Access Grafana dashboards
open http://localhost:3000We welcome contributions from the community! Here's how you can help:
-
Report Bugs
- Search existing issues first
- Create a new issue with detailed reproduction steps
-
Submit Fixes
- Fork the repository
- Create a feature branch
- Write tests for your changes
- Submit a pull request
-
Improve Documentation
- Fix typos and clarify text
- Add examples or missing information
- Improve code comments
- Backend (Go):
gofmt,golint,go vet - Frontend (TypeScript): ESLint, Prettier
- Commit Messages: Follow Conventional Commits
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Need help? Contact us at support@wron.ai
© 2023 WRON AI. All rights reserved.
- Docker 20.10+ and Docker Compose
- At least 4GB RAM (8GB recommended)
- Ports 80, 443, 8080, 8443, 3000 available
-
Clone the repository:
git clone https://github.com/wronai/docker-platform.git cd docker-platform -
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Start the stack:
make up
-
Access the applications:
- Web UI: https://localhost
- Admin Panel: https://admin.localhost
- Keycloak: https://auth.localhost
- Grafana: http://localhost:3000
# Run unit tests
make test-unit
# Run integration tests
make test-integration
# Run end-to-end tests
make test-e2e# Generate test coverage report
make coverage
# View coverage in browser
make coverage-html- Grafana: http://localhost:3000 (admin/admin)
- Prometheus: http://localhost:9090
- Alertmanager: http://localhost:9093
- API response times
- Error rates
- Resource usage
- User activity
- Storage utilization
docker-platform/
├── media-vault-backend/ # Backend API service
├── media-vault-analyzer/ # AI analysis service
├── media-vault-admin/ # Admin dashboard
├── flutter-web/ # Frontend application
├── keycloak/ # Keycloak configuration
├── monitoring/ # Monitoring stack
├── docker-compose.yml # Main compose file
└── Makefile # Development commands
-
Start development environment:
make dev
-
Run services in watch mode:
# Backend make watch-backend # Frontend make watch-frontend
-
Run linters and formatters:
make lint make format
-
Check for security issues:
make security-scan
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
-
Set up production environment:
make env-prod
-
Deploy the stack:
make deploy
-
Verify deployment:
make status
# Scale backend services
make scale-backend replicas=3
# Scale frontend
make scale-frontend replicas=2- 🔐 Keycloak SSO Authentication - Secure single sign-on
- 📸 Photo Upload & Management - Drag & drop photo uploads
- 🤖 AI-Powered Descriptions - Automatic image content analysis
- 📝 Manual Description Editing - Enhance AI-generated descriptions
- 🖼️ Personal Gallery - Organized photo viewing
- 🔍 Smart Search - Find photos by description or metadata
- 📱 Responsive Design - Works on desktop and mobile
- 👥 User Management - Add, edit, and manage users
- 📊 System Analytics - Performance and usage metrics
- 🛡️ Security Monitoring - Login attempts and threat detection
- 🔒 Content Moderation - Review and approve uploaded content
- ⚙️ System Configuration - Manage vault settings
- 📋 Audit Logging - Track all administrative actions
- 📈 Grafana Dashboards - Real-time system monitoring
- 📦 Bulk Photo Upload - Import hundreds of photos at once
- 🏷️ Batch Description Management - Edit multiple photo descriptions
- 📤 Photo Sharing - Share photos with specific users
- 👥 User Access Control - Manage photo permissions
- 📊 Analytics Dashboard - Track photo engagement and views
- 🔄 Batch Operations - Mass edit, delete, or share operations
- 📊 Prometheus Metrics - Comprehensive system monitoring
- 📈 Grafana Dashboards - Beautiful visualization
- 🚨 AlertManager - Intelligent alerting system
- 📝 Centralized Logging - Loki log aggregation
- 🔍 Distributed Tracing - Jaeger integration
- 🐳 Container Monitoring - Docker metrics with cAdvisor
- 🔒 Security Scanning - Automated vulnerability detection
# 1. Clone and setup
git clone https://github.com/wronai/docker-platform
cd docker-platform
# 2. Start everything with monitoring
make full-stack-with-monitoring
# 3. Access the application
open http://localhost🌐 Service URLs:
- Main App: http://localhost
- Grafana: http://localhost:3333 (admin/grafana123)
- Prometheus: http://localhost:9090
- Keycloak: http://localhost:8443/admin (admin/admin123)
- AlertManager: http://localhost:9093
👤 Test Accounts:
- Admin: vaultadmin / admin123
- User: vaultuser / user123
- Docker: 20.10+
- Docker Compose: 2.0+
- RAM: 8GB+ recommended
- Storage: 50GB+ for media files
- CPU: 4+ cores recommended
graph TB
User[Users] --> Caddy[Caddy Proxy]
Caddy --> Flutter[Flutter Web App]
Caddy --> API[Media Vault API]
Caddy --> Admin[Admin Panel]
Caddy --> Keycloak[Keycloak]
API --> SQLite[(SQLite)]
API --> Storage[File Storage]
API --> Analyzer[AI Analyzer]
API --> NSFW[NSFW Detector]
subgraph "Monitoring Stack"
Prometheus[Prometheus]
Grafana[Grafana]
AlertManager[AlertManager]
Loki[Loki Logs]
end
API --> Prometheus
Grafana --> Prometheus
AlertManager --> Prometheus
# Vault Configuration
VAULT_NAME=MediaVault
ENVIRONMENT=production
DEBUG=false
# Authentication
KEYCLOAK_ADMIN_USER=admin
KEYCLOAK_ADMIN_PASSWORD=admin123
OAUTH2_ENABLED=true
# AI Features
AI_DESCRIPTION_ENABLED=true
NSFW_DETECTION_ENABLED=true
# Monitoring
GRAFANA_ADMIN_PASSWORD=grafana123
PROMETHEUS_PORT=9090
GRAFANA_PORT=3333
# Email Alerts
SMTP_HOST=smtp.gmail.com
SMTP_USER=alerts@mediavault.com
ADMIN_EMAIL=admin@mediavault.com
# Slack Integration
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOKAI_DESCRIPTION_ENABLED: Enable/disable AI photo descriptionsNSFW_DETECTION_ENABLED: Enable/disable content moderationBULK_UPLOAD_ENABLED: Enable/disable partner bulk uploadsPHOTO_SHARING_ENABLED: Enable/disable photo sharing features
- Infrastructure Overview - System health and performance
- Application Metrics - API response times, user activity
- Security Dashboard - Authentication events, failed logins
- Business Intelligence - Photo uploads, user engagement
- System metrics (CPU, memory, disk, network)
- Application metrics (API performance, upload rates)
- Security metrics (authentication events, threats)
- Business metrics (user activity, storage usage)
- Critical: Service down, disk full, security breaches
- Warning: High resource usage, slow responses
- Info: Successful deployments, maintenance events
# View real-time metrics
make prometheus # http://localhost:9090
# Access dashboards
make grafana # http://localhost:3333
# Check alerts
make alerts # http://localhost:9093
# System health
make health-check-full # Comprehensive health checkmake up # Start main application
make down # Stop all services
make logs # Show application logs
make status # Show service status
make restart-api # Restart API servicemake monitoring # Start monitoring stack
make monitoring-logs # Show monitoring logs
make backup-monitoring # Backup monitoring data
make test-alerts # Test alert systemmake setup-keycloak # Configure Keycloak
make keycloak-clean # Reset Keycloakmake backup-now # Create system backup
make cleanup-all # Clean unused resources
make load-test-monitored # Performance testing
make security-scan # Security vulnerability scan- Keycloak SSO - Enterprise-grade identity management
- JWT Tokens - Secure API authentication
- Role-based Access - User, Admin, Partner roles
- Session Management - Secure session handling
- NSFW Detection - Automatic content moderation
- File Validation - Type and size restrictions
- Virus Scanning - Malware protection (configurable)
- Encryption - File encryption at rest
- Container Security - Trivy vulnerability scanning
- Network Policies - Segmented container networking
- Security Headers - HTTPS, HSTS, CSP headers
- Audit Logging - Comprehensive activity tracking
- Failed Login Detection - Brute force protection
- Suspicious Activity Alerts - Real-time threat detection
- IP Blocking - Automatic threat response
- Security Dashboards - Visual threat monitoring
media-vault/
├── 📄 docker-compose.yml # Main application stack
├── 📄 docker-compose.monitoring.yml # Monitoring stack
├── 📄 .env # Environment configuration
├── 📄 Makefile # Management commands
│
├── 🔒 media-vault-backend/ # Go API Backend
├── 🎨 flutter_frontend/ # Flutter Web Application
├── ⚙️ media-vault-admin/ # Admin Panel
├── 🔍 media-vault-analyzer/ # AI Processing Service
├── 🤖 nsfw-analyzer/ # Content Moderation
│
├── 📊 monitoring/ # Monitoring Configuration
│ ├── prometheus/ # Metrics collection
│ ├── grafana/ # Dashboards
│ ├── alertmanager/ # Alert routing
│ └── loki/ # Log aggregation
│
├── 🔐 keycloak/ # Authentication
├── 🌐 caddy/ # Reverse proxy
├── 📝 scripts/ # Automation scripts
└── 📋 docs/ # Documentation
# Start development environment
make dev-start
# Run tests
make test
# Check code quality
make lint
# Build all components
make build- Go: gofmt, golint, go vet
- Flutter: dart format, flutter analyze
- Docker: Dockerfile best practices
- Security: Regular vulnerability scans
# Initialize swarm
docker swarm init
# Deploy stack
docker stack deploy -c docker-compose.yml media-vault# Apply manifests
kubectl apply -f deployment/kubernetes/
# Check status
kubectl get pods -n media-vault- Change default passwords
- Configure SSL certificates
- Set up external backups
- Configure monitoring alerts
- Review security settings
- Test disaster recovery
- API: 2-4 replicas, 1GB RAM each
- Database: SSD storage, regular backups
- File Storage: CDN for media delivery
- Monitoring: 30-day retention, efficient queries
- Horizontal Scaling: Add API replicas for more users
- Vertical Scaling: Increase resources for AI processing
- Storage Scaling: Use external object storage (S3, MinIO)
- Database Scaling: Consider PostgreSQL for large datasets
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@mediavault.com
- Flutter Team - Amazing web framework
- Keycloak - Robust authentication
- Prometheus/Grafana - Excellent monitoring
- Docker - Containerization platform
- Go Community - Fast backend development
Media Vault - Secure, intelligent, and scalable media management for the modern enterprise.
Media Vault Infrastructure provides enterprise-grade monitoring, alerting, automation, and management capabilities:
- 📊 360° Monitoring - Metrics, logs, tracing, alerts
- 🤖 Automated Incident Response - Self-healing capabilities
- 🔮 Predictive Analytics - Capacity planning & forecasting
- 🛡️ Security & Compliance - Automated scanning & response
- ⚡ Performance Optimization - Automated tuning & scaling
# 1. Setup infrastructure
make infrastructure
# 2. Start with authentication
make full-stack
# 3. Check status
make infra-status🌐 Access Points:
- Main App: http://localhost
- Grafana: http://localhost:3333 (admin/grafana123)
- Prometheus: http://localhost:9090
- Portainer: http://localhost:9000
- AlertManager: http://localhost:9093
System Metrics:
✅ CPU usage per container and host
✅ Memory utilization and pressure
✅ Disk space and I/O performance
✅ Network traffic and errors
✅ Container lifecycle events
Application Metrics:
✅ API response times (95th percentile)
✅ Request rates and error rates
✅ Database query performance
✅ Upload success/failure rates
✅ Authentication events (Keycloak)
Business Metrics:
✅ Active users and sessions
✅ Storage utilization trends
✅ Content analysis results
✅ Security incident countsDashboards Available:
📊 Infrastructure Overview - System health
📈 Application Performance - API metrics
🔐 Security Dashboard - Auth & threats
💾 Storage Analytics - Vault usage
🐳 Container Monitoring - Docker stats
📡 Network Analysis - Traffic patterns
🎯 Business Intelligence - KPIsLog Aggregation Options:
🪵 Loki + Promtail (Lightweight)
- Container logs centralization
- Grafana integration
- Label-based querying
📊 ELK Stack (Advanced)
- Elasticsearch search
- Kibana visualization
- Advanced analytics
- Full-text search🔴 CRITICAL (Immediate Action):
- Service completely down (>1 min)
- Disk will fill in 4 hours
- Database connection exhaustion
- Security breach indicators
🟡 WARNING (Investigation Required):
- High resource usage (>80% for 5 min)
- API response time degraded (>5s)
- Failed login spike (>20 in 5 min)
- Memory pressure (>85%)
🔵 INFO (Monitoring):
- Scheduled maintenance
- Performance optimizations
- Backup completion
- Certificate renewalsAlert Delivery:
📧 Email - admin@mediavault.com
💬 Slack - #alerts, #warnings channels
📱 PagerDuty - Critical issues only
📊 Grafana - Dashboard notifications
🔔 Teams - Alternative to SlackSelf-Healing Actions:
🔄 Service restart for container failures
🧹 Automatic cleanup for disk space
⚡ Resource rebalancing for high usage
🛡️ Security lockdown for threats
📊 Performance optimization triggers# Automated actions for common issues:
Service Down → Docker restart → Health check → Notify
High Memory → Clear caches → Restart services → Monitor
Disk Full → Cleanup logs → Docker prune → Expand if needed
Security