The Lore Site for the Wavelength Canon
Status: Testing new pre-increment version deployment strategy ๐
โ AUTOMATED PROTECTION ACTIVE
Comprehensive protection against package.json corruption with:
- Automated Backups: Timestamped backups before risky operations
- Integrity Validation: Real-time corruption detection
- Emergency Recovery: Automatic git and backup-based restoration
- Safe Script Execution: Protected wrapper for all script operations
Quick Commands:
# Setup protection (one-time)
bash scripts/package-guard.sh auto-protect
# Daily usage
bash scripts/package-guard.sh backup # Create backup
bash scripts/package-guard.sh safe-run <script> # Run script safely
bash scripts/package-guard.sh status # Check healthFull Guide: ๐ก๏ธ Package Protection System
All project documentation has been organized in the docs/ folder:
- ๐๏ธ System Architecture - Complete system architecture including external chatbot integration
- ๐ Documentation Index - Complete documentation overview and navigation
- ๐ ๏ธ MCP Tools Documentation - Model Context Protocol tools for AI automation
- โก MCP Quick Reference - Essential MCP commands and usage examples
๐จโ๐ป Developer Initializes Session (One Time):
# Developer runs this once to set up the session environment
node start-wavelength-session.js๐ค AI Agents Join Established Session:
// Agents join existing session (initialize: false)
await mcp.callTool("wavelength_server_status", {check: "full", initialize: false});// AI agents use MCP internally to communicate with tools
await mcp.callTool("wavelength_validate", {content: "character bio", type: "character"});
await mcp.callTool("firebase_query", {path: "/episodes", operation: "read"});- โ Developers calling
mcp.callTool()in application code - โ Using MCP syntax in Node.js scripts or terminal
- โ Production applications containing MCP protocol calls
- โ Mixing MCP with regular development workflows
๐ค AI Agents - Use MCP Protocol:
// Agents use MCP protocol exclusively
await mcp.callTool("wavelength_validate", {content: "character data", type: "character"});
await mcp.callTool("firebase_query", {path: "/episodes", operation: "read"});
await mcp.callTool("wavelength_test_runner", {command: "validate", content: "character data"});๐จโ๐ป Developers - Use Node.js Tools:
# Developers use Node.js tools directly
node scripts/unified/wavelength-validator.js --type character
node scripts/unified/firebase-manager.js --operation read --path /episodes
node scripts/unified/test-runner.js validate --content "character data"Key Difference: MCP = AI agent communication protocol | Node.js tools = actual developer utilities
- ๏ฟฝ๐ Security Guide - Security implementation and best practices
- ๐พ Backup System - Automated database backup setup
- ๐ค Chatbot Integration - Firebase Functions chatbot architecture and validation
- ๐ฎ Features - Character system, lore management, and application features
- Setup: Follow the Security Enhancement Guide
- Backup: Configure Automated Backups
- Features: Explore Application Documentation
The Wavelength-Lore ecosystem includes an advanced external AI chatbot service that provides VIP+ members with intelligent assistance about the Wavelength universe:
- โ
Firebase Functions Backend: Serverless architecture at
us-central1-wavelength-lore.cloudfunctions.net - โ SSO Integration: Seamless authentication with main website using JWT tokens
- โ VIP+ Exclusive Access: Membership tier requirement for chatbot functionality
- โ Vector Database Knowledge: Complete lore stored in Pinecone for accurate responses
- โ OpenAI GPT Integration: Advanced AI responses about characters, stories, and universe details
- Widget Integration: Embedded chat widget on main website (
/chatbot/widget) - Authentication Flow: SSO token validation between main site and chatbot service
- Session Management: Persistent conversation history and context awareness
- Health Monitoring: Comprehensive testing suite validating all integration points
- Lore Expertise: Deep knowledge of Wavelength universe, characters, and storylines
- Real-time Responses: Interactive conversation with context awareness
- Security Controls: Rate limiting, input validation, and VIP+ access enforcement
- Cross-Platform: Accessible through main website with responsive design
See ๐ค Chatbot Architecture Documentation for complete technical details and validation results.
- โ Firebase security rules with script token authentication
- โ Smart rate limiting with endpoint detection
- โ Input sanitization with XSS protection
- โ Automated encrypted backups to AWS S3
- โ User authentication with Firebase ID tokens
- โ Secure delete functionality with ownership verification
- โ External Chatbot Security: VIP+ access control with SSO integration
The site includes a comprehensive asset validation system to ensure all resources are working correctly:
- โ CloudFront CDN: Optimized content delivery through AWS CloudFront
- โ S3 Storage: Secure and scalable image storage with AWS S3
- โ Gallery Feature: User image uploads stored in S3 and served via CloudFront
- โ CORS Support: Cross-Origin Resource Sharing for external applications
- โ Automated Testing: CDN integration tests verify functionality
See CDN Configuration Guide for setup details.
- โ Image Checker: Validates all images (img tags, backgrounds) with category analysis
- โ Static Resource Checker: Tests CSS, JS, fonts, icons, and CDN resources
- โ Route Link Checker: Scans EJS templates for broken internal links with database validation
- โ Production Suite: Unified validation system with Quick/Standard/Full modes
- โ
Environment Support: Automatic detection between local (
localhost:3001) and production (wavelengthlore.com) - โ CI/CD Integration: Proper exit codes and timeout handling for automated pipelines
- โ Smart Timeouts: Optimized timeouts for local (5-10s) vs production (15-30s) environments
# Quick production health check (1-2 min)
./scripts/validate-production.sh quick
# Full comprehensive validation (5-10 min)
./scripts/validate-production.sh full
# Individual component testing
node scripts/check_broken_images.js --prod
node scripts/check_static_resources.js --prod
node scripts/check_route_links.js --prodSee Resource Checker Documentation and Production Validation Guide for complete usage details.
The site includes an advanced AI image generation system for creating custom artwork:
- โ AI Image Generator: Generate images from text prompts using Google's Imagen API
- โ Character Portraits: Automated character portrait generation with style presets
- โ Location Scenes: Epic fantasy landscape and environment generation
- โ Asset Integration: Automatic upload and optimization through enhanced asset manager
- โ Multiple Variations: Generate multiple variations of concepts for selection
# Generate character portrait
./scripts/ai-image-generator.js character "Lucky" "mischievous leprechaun with green hat"
# Generate location scene
./scripts/ai-image-generator.js location "Emerald Grove" "mystical forest with glowing trees"
# Generate and upload to assets automatically
./scripts/ai-image-generator.js workflow "magical crystal cave" "locations/crystal-cave"- โ Smart Defaults: Optimized settings for different content types
- โ Style Presets: Fantasy-art, photorealistic, anime, concept-art styles
- โ Batch Generation: Create multiple variations with single command
- โ Asset Pipeline: Seamless integration with asset management system
- โ URL Flexibility: Relative, CDN, or absolute URL generation modes
See AI Image Generation Guide for complete usage and examples.
The Wavelength Lore site includes a comprehensive community forum with:
- โ Discussion Posts: Create and participate in community discussions
- โ Reply System: Threaded replies with real-time updates
- โ Search & Discovery: Advanced search with filters and category support
- โ Community Guidelines: Comprehensive moderation policies and rules
- โ Contact System: Direct moderator contact with configurable email
- โ Rich Text Support: Markdown formatting and media attachments
- โ File Attachments: Secure S3 integration for images and documents
- โ Content Categories: Organized discussion topics and filtering
- โ User Profiles: Display user information and post history
- โ Authenticated Deletion: Secure post and reply removal with ownership verification
- โ Admin Controls: Administrative override capabilities for content management
- โ Cascade Deletion: Automatic cleanup of replies when posts are deleted
- โ File Cleanup: Automatic S3 attachment removal for deleted content
- โ Rate Limiting: Smart protection against spam and abuse
- โ Unified Navigation: Consistent forum navigation across all pages
- โ Search Integration: Real-time search with category and content filtering
- โ Guidelines Integration: Easy access to community rules and policies
- โ Help System: Comprehensive user guides and support resources
See Forum Delete Documentation and Security Enhancement Guide for implementation details.
See Security Enhancement Guide for complete details.