- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO. - Introduced PostgreSQL and Redis services with health checks and configurations for data persistence. - Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets. - Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage. - Enhanced the Dockerfile to support the new API environment variables and configurations. - Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
838 B
TypeScript
32 lines
838 B
TypeScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import router from './router'
|
|
import App from './App.vue'
|
|
import './style.css'
|
|
import { registerSW } from 'virtual:pwa-register'
|
|
import { initMockMode } from './utils/mock'
|
|
|
|
// Detect backend availability before the app renders.
|
|
// If the backend is unreachable, USE_MOCK is auto-flipped to true
|
|
// so every service/store/composable falls back to mock data.
|
|
initMockMode().then(() => {
|
|
const app = createApp(App)
|
|
|
|
app.use(createPinia())
|
|
app.use(router)
|
|
|
|
app.mount('#app')
|
|
|
|
// Register PWA service worker with auto-update
|
|
const updateSW = registerSW({
|
|
immediate: true,
|
|
onNeedRefresh() {
|
|
// Auto-reload when new content is available
|
|
updateSW(true)
|
|
},
|
|
onOfflineReady() {
|
|
console.log('App ready to work offline')
|
|
},
|
|
})
|
|
})
|