Files
michaelschiemer/resources/js/main.js
Michael Schiemer fc3d7e6357 feat(Production): Complete production deployment infrastructure
- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
2025-10-25 19:18:37 +02:00

77 lines
2.8 KiB
JavaScript

import '../css/styles.css';
import { initApp } from './core/init.js';
import { Logger } from './core/logger.js';
import { CsrfAutoRefresh } from './modules/csrf-auto-refresh.js';
import { FormAutoSave } from './modules/form-autosave.js';
// WebPushManager is now loaded via framework module system
// LiveComponent is now loaded via framework module system
// Import DevTools in development
if (import.meta.env.DEV) {
import('./modules/LiveComponentDevTools.js').then(() => {
console.log('🛠️ LiveComponent DevTools loaded (Ctrl+Shift+D to toggle)');
});
}
// Import Hot Reload in development
if (import.meta.env.DEV) {
import('./modules/hot-reload.js').then(({ HotReload }) => {
console.log('🔥 Hot Reload module loaded');
});
}
// PWA Service Worker temporarily disabled
// TODO: Re-enable after fixing build issues
document.addEventListener("DOMContentLoaded", async () => {
try {
console.log('🚀 Starting app initialization...');
await initApp();
console.log('✅ App initialized successfully!');
// Initialize CSRF Auto-Refresh for all forms
const csrfInstances = CsrfAutoRefresh.initializeAll();
console.log(`🔒 CSRF Auto-Refresh initialized for ${csrfInstances.length} forms`);
// Initialize Form Auto-Save for all forms
const autosaveInstances = FormAutoSave.initializeAll();
console.log(`💾 Form Auto-Save initialized for ${autosaveInstances.length} forms`);
// WebPush Manager is initialized by framework module system
// Access via window.webPushManager after module initialization
// Debug info
setTimeout(() => {
console.log('📊 Debug Info:');
console.log('- Forms found:', document.querySelectorAll('form').length);
console.log('- Links found:', document.querySelectorAll('a[href^="/"]').length);
console.log('- SPA Router:', window.spaRouter ? 'Active' : 'Missing');
console.log('- Enhanced forms:', document.querySelectorAll('form[data-auto-enhanced]').length);
console.log('- CSRF protected forms:', document.querySelectorAll('input[name="_token"]').length);
}, 500);
} catch (error) {
console.error('❌ App initialization failed:', error);
console.error('Stack trace:', error.stack);
}
});
function isHtmlAttributeSupported(elementName, attribute) {
const element = document.createElement(elementName);
return attribute in element;
}
/*let closedAttr = document.getElementById('my-dialog');
if(closedAttr && !('closedby' in closedAttr)) {
alert('oh no');
}*/
/*
if (isHtmlAttributeSupported('dialog', 'closedby')) {
alert('Attribut wird unterstützt!');
} else {
alert('Nicht unterstützt!');
}
*/