Make RMO and Sync run in parallel and use the same sources

This commit is contained in:
Eli Ribble 2026-04-03 15:09:53 +00:00
parent d7d6888f63
commit b919472f42
No known key found for this signature in database
7 changed files with 13 additions and 14 deletions

13
vite/sync/index.html Normal file
View file

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/static/ico/favicon-sync.ico" type="image/x-icon" />
<title>Nidus Sync</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="main.ts"></script>
</body>
</html>

57
vite/sync/main.ts Normal file
View file

@ -0,0 +1,57 @@
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "@/AppSync.vue";
import router from "@/router";
import { SSEManager, type SSEMessage } from "@/SSEManager";
import "maplibre-gl/dist/maplibre-gl.css";
// Import Bootstrap Icons CSS
import "bootstrap-icons/font/bootstrap-icons.css";
// Import Bootstrap SCSS
import "@/style/style.scss";
// Import custom icons
import "@/gen/custom-icons.scss";
// Import Bootstrap JavaScript and make it available globally
import * as bootstrap from "bootstrap";
window.bootstrap = bootstrap;
// Make SSEManager available to all the JavaScript
window.SSEManager = SSEManager;
document.addEventListener("DOMContentLoaded", () => {
SSEManager.connect("/api/events");
SSEManager.subscribe((msg: SSEMessage) => {
if (msg.type != "heartbeat") {
console.log("SSE", msg);
}
});
});
document.addEventListener("init", () => {
const user = {
display_name: "",
initials: "",
notifications: [],
notification_counts: {
communication: 0,
home: 0,
review: 0,
},
organization: {
name: "",
},
role: "",
username: "",
};
});
interface GreetingComponent {
message: string;
name: string;
updateMessage(): void;
}
const pinia = createPinia();
const app = createApp(App);
app.use(pinia);
app.use(router);
app.mount("#app");

95
vite/sync/vite.config.js Normal file
View file

@ -0,0 +1,95 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import checker from "vite-plugin-checker";
import path from "path";
export default defineConfig({
plugins: [
vue(),
checker({
vueTsc: true,
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "../../ts"),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "sass:map";\n@import "@/style/variables.scss";`,
api: "modern-compiler",
silenceDeprecations: [
"import",
"global-builtin",
"if-function",
"color-functions",
],
},
},
},
build: {
manifest: true,
outDir: "static/gen",
emptyOutDir: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, "index-sync.html"),
},
output: {
entryFileNames: "js/bundle.[hash].js",
chunkFileNames: "js/[name].[hash].js",
assetFileNames: (assetInfo) => {
if (/\.(woff2?|ttf|eot)$/.test(assetInfo.name || "")) {
return "fonts/[name].[hash][extname]";
}
if (/\.css$/.test(assetInfo.name || "")) {
return "css/style.[hash][extname]";
}
return "assets/[name].[hash][extname]";
},
},
},
sourcemap: true,
},
server: {
allowedHosts: [
"poweredge.local",
"dev-report.mosquitoes.online",
"dev-sync.nidus.cloud",
],
port: 9000,
proxy: {
"/api": {
target: "http://127.0.0.1:9002",
changeOrigin: false,
},
"/configuration/upload/pool/flyover": {
target: "http://127.0.0.1:9002",
changeOrigin: false,
},
"/mailer": {
target: "http://127.0.0.1:9002",
changeOrigin: false,
},
"/qr-code": {
target: "http://127.0.0.1:9002",
changeOrigin: false,
},
"/signin": {
target: "http://localhost:9002",
changeOrigin: false,
},
"/signup": {
target: "http://localhost:9002",
changeOrigin: false,
},
},
strictPort: true,
},
});