🔬 Playtopia Dev Lab - Infrastructure Guide
Overview
Playtopia Dev Lab is a comprehensive containerized development environment that enables rapid deployment of web services with enterprise-grade security, automatic SSL, and authentication. This guide covers accessing and using the development infrastructure.
🚀 Getting Started
Accessing Dev Lab Services
Public Services (No Authentication Required)
Protected Services (Authentication Required)
Authentication System
Authelia Access Control
Playtopia Dev Lab uses Authelia for enterprise-grade authentication with three access levels:
- Admin: Full access to all services and management interfaces
- Family: Access to development tools and most services
- Users: Basic access to public services and limited protected resources
Login Process
- Navigate to any protected service
- You’ll be redirected to the Authelia login portal at
auth.playtopia.com.au
- Enter your credentials
- After successful authentication, you’ll be redirected to the requested service
- Sessions last 1 hour with 5-minute inactivity timeout
💻 Development Environment
VS Code Server
Accessing the IDE
Key Features
- Extensions: Pre-installed development extensions
- Terminal Access: Integrated terminal for command-line operations
- File Management: Direct access to project files and directories
- Git Integration: Built-in version control with Git commands
- Live Development: Real-time code editing and testing
Getting Started with VS Code Server
- Navigate to the development environment URL
- Authenticate using your Authelia credentials
- Open Folder: Use File → Open Folder to access project directories
- Install Extensions: Add language support and tools as needed
- Use Terminal: Access integrated terminal for command-line operations
Project Structure
/home/thrax/unified-services/
├── match-n-gacha/ # Puzzle game project
├── elemedals/ # Elemental match-3 game
├── rhythm-game/ # Anime rhythm game
├── regression-tester-pro/ # Testing management platform
├── monthly-service-review/ # MSR Generator application
├── data/hugo/ # Website and documentation
├── config/ # Infrastructure configuration
└── docker-compose.yml # Service orchestration
File System Access
Project Directories
- Read/Write Access: Full access to project files
- Version Control: Git repositories for all projects
- Backup Strategy: Regular automated backups
- File Permissions: Proper Unix permissions for security
Development Workflow
- Edit Code: Use VS Code Server for file editing
- Test Changes: Use integrated terminal for testing
- Version Control: Commit changes using Git commands
- Deploy Services: Use Docker commands to rebuild and deploy
- Monitor Services: Check logs and status via Portainer
🐳 Container Management
Portainer Dashboard
Accessing Container Management
Key Capabilities
- Container Status: View running, stopped, and failed containers
- Log Viewing: Real-time and historical container logs
- Resource Monitoring: CPU, memory, and network usage statistics
- Image Management: Docker image building and repository management
- Volume Management: Persistent storage volume administration
Common Container Operations
-
View Container Logs:
- Navigate to Containers section
- Click on container name
- Select “Logs” tab for real-time log viewing
-
Restart Services:
- Select target container
- Click “Restart” button
- Monitor startup process in logs
-
Resource Monitoring:
- Use “Stats” tab for real-time resource usage
- Monitor CPU, memory, and network metrics
- Identify performance bottlenecks
Docker Compose Operations
Service Management Commands
For direct command-line management via VS Code Server terminal:
# Navigate to project root
cd /home/thrax/unified-services
# View all service status
docker compose ps
# Start all services
docker compose up -d
# Start specific service
docker compose up -d service-name
# Rebuild and start service
docker compose build service-name --no-cache
docker compose up -d service-name
# View service logs
docker compose logs -f service-name
# Restart service
docker compose restart service-name
# Stop service
docker compose down service-name
# Remove service and volumes
docker compose down service-name --volumes
Building and Deploying New Services
- Create Service Directory:
mkdir new-service && cd new-service
- Add Service Files: Create Dockerfile, configuration files, and assets
- Update docker-compose.yml: Add service definition with Traefik labels
- Build Service:
docker compose build new-service --no-cache
- Deploy Service:
docker compose up -d new-service
- Test Access: Verify service is accessible at configured subdomain
🔧 Infrastructure Monitoring
Traefik Dashboard
Accessing Infrastructure Monitoring
Monitoring Capabilities
- Service Health: Real-time status of all routed services
- SSL Certificates: Certificate status and renewal information
- Request Metrics: HTTP request statistics and response times
- Route Configuration: Active routing rules and middleware
- Error Tracking: Failed requests and error rate monitoring
Key Metrics to Monitor
- Service Availability: Green/red status indicators for each service
- Certificate Expiry: SSL certificate renewal dates and status
- Response Times: Average response times for performance optimization
- Error Rates: HTTP error rates for troubleshooting
- Traffic Patterns: Request volume and distribution
SSL Certificate Management
Automatic Certificate Renewal
- Let’s Encrypt Integration: Automatic HTTPS certificate generation
- TLS Challenge: Domain validation via TLS challenge method
- Automatic Renewal: Certificates renew automatically before expiration
- iOS Compatibility: TLS challenge ensures broad device support
Certificate Status Verification
- Check Traefik Dashboard: View certificate status for all domains
- Monitor Logs:
docker compose logs traefik | grep acme
- Verify Browser: Check browser security indicators for HTTPS
- Test SSL: Use external SSL testing tools for validation
🎮 Service-Specific Guides
Game Development Services
Game Deployment Pattern
Games follow a standardized deployment pattern:
- Static Assets: HTML, CSS, JavaScript, and media files
- nginx Container: Lightweight web server with compression
- Traefik Integration: Automatic SSL and domain routing
- Performance Optimization: Caching headers and compression
Game Development Workflow
- Local Development: Edit game files in VS Code Server
- Asset Preparation: Optimize images, audio, and code
- Container Build: Rebuild game container with new assets
- Deploy Service: Deploy updated container to production
- Test Gameplay: Verify functionality across devices
Business Application Services
Full-Stack Application Pattern
Business applications use multi-container architecture:
- Frontend Service: React/Next.js user interface
- Backend Service: Node.js/Express API server
- Database Service: PostgreSQL/Redis data storage
- Authentication: Authelia integration for security
Development and Deployment
- Code Development: Edit frontend/backend code in VS Code Server
- Database Management: Use database administration tools
- API Testing: Test backend endpoints and functionality
- Integration Testing: Verify frontend-backend communication
- Production Deployment: Deploy all services with dependencies
🔐 Security and Best Practices
Access Control
Role-Based Access
- Admin Role: Infrastructure management and system administration
- Family Role: Development access and service management
- User Role: Basic service access for testing and usage
Security Features
- Session Management: Automatic session expiration and renewal
- Rate Limiting: Protection against brute force attacks
- SSL Everywhere: All services protected with HTTPS
- Container Isolation: Services isolated in separate containers
Data Protection
Backup Strategy
- Configuration Backup: All config files backed up regularly
- Database Backup: Automated database backups for data services
- SSL Certificate Backup: Certificate files preserved
- Version Control: Code changes tracked in Git repositories
Security Monitoring
- Access Logs: All authentication attempts logged
- Container Logs: Service logs monitored for security events
- SSL Monitoring: Certificate status and renewal tracking
- Resource Monitoring: Unusual resource usage detection
🛠️ Troubleshooting
Common Issues
Authentication Problems
- Symptom: Cannot access protected services
- Solution: Verify credentials with administrator, clear browser cache
- Check: Ensure user account has appropriate access level
Service Unavailability
- Symptom: Service returns 404 or connection errors
- Diagnosis: Check container status in Portainer
- Solution: Restart service via Portainer or command line
SSL Certificate Issues
- Symptom: Browser security warnings
- Diagnosis: Check certificate status in Traefik dashboard
- Solution: Force certificate renewal by restarting Traefik
- Symptom: Slow service response times
- Diagnosis: Monitor resource usage in Portainer
- Solution: Restart affected services or optimize resource allocation
Getting Help
Self-Service Resources
- Documentation: This guide and service-specific documentation
- Logs: Check service logs via Portainer for error messages
- Monitoring: Use Traefik dashboard for infrastructure status
- Testing: Use browser developer tools for debugging
Administrator Support
- Access Issues: Contact system administrator for access problems
- Configuration Changes: Request infrastructure modifications
- New Services: Request deployment of additional services
- Training: Request training sessions for advanced features
📚 Advanced Usage
Custom Service Deployment
Service Template
New services should follow the established patterns:
new-service:
build: ./new-service
container_name: new-service
restart: unless-stopped
networks:
- services-network
labels:
- traefik.enable=true
- traefik.http.routers.newservice.rule=Host(`newservice.playtopia.com.au`)
- traefik.http.routers.newservice.entrypoints=websecure
- traefik.http.routers.newservice.tls.certresolver=letsencrypt
- traefik.http.services.newservice.loadbalancer.server.port=80
Development Patterns
- Static Sites: Use nginx:alpine base image
- Node.js Apps: Use node:alpine with production builds
- Database Apps: Include separate database containers
- Authentication: Add Authelia middleware for protected services
Integration Opportunities
CI/CD Integration
- Git Hooks: Automatic deployment on code commits
- Testing Automation: Automated testing before deployment
- Monitoring Integration: Connect external monitoring services
- Backup Automation: Scheduled backup procedures
External Service Integration
- API Gateways: Connect to external APIs and services
- Monitoring Services: Integrate external monitoring platforms
- Notification Systems: Connect to communication platforms
- Data Analytics: Integration with analytics and reporting tools
Playtopia Dev Lab provides a complete, enterprise-grade development environment that combines ease of use with powerful infrastructure capabilities. This guide covers the essential aspects of using the platform effectively for both development and operations.