commit 5b0e7cccd9be6eb98361fa140f921cc813e3ccf0 Author: Fabio Date: Wed Dec 31 17:26:53 2025 +0100 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7677172 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# Node +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Build output +dist/ +build/ +out/ +.tmp/ +.temp/ + +# Capacitor / Cordova +android/ +ios/ +www/ + +# Environment files +.env +.env.* +!.env.example + +# System files +.DS_Store +Thumbs.db + +# Editor folders +.vscode/ +.idea/ + +# Logs +*.log + +# Cache +.cache/ +.parcel-cache/ +.next/ +.nuxt/ +.svelte-kit/ diff --git a/app/README.md b/app/README.md new file mode 100644 index 0000000..edf8a8a --- /dev/null +++ b/app/README.md @@ -0,0 +1,2 @@ + +npx http-server . diff --git a/app/app.js b/app/app.js new file mode 100644 index 0000000..948d80e --- /dev/null +++ b/app/app.js @@ -0,0 +1,789 @@ +//const URI = "https://my.patachina2.casacam.net"; +//const USER = "fabio.micheluz@gmail.com"; +//const PASSW = "master66"; + + // ========================================================================== + // Salvataggio dati + // ========================================================================== + +const SECRET_KEY = "chiave-super-segreta-123"; // puoi cambiarla + +function saveConfig(url, user, password) { + const data = { url, user, password }; + + const encrypted = CryptoJS.AES.encrypt( + JSON.stringify(data), + SECRET_KEY + ).toString(); + + localStorage.setItem("launcherConfig", encrypted); +} + +function loadConfig() { + const encrypted = localStorage.getItem("launcherConfig"); + if (!encrypted) return null; + + try { + const bytes = CryptoJS.AES.decrypt(encrypted, SECRET_KEY); + return JSON.parse(bytes.toString(CryptoJS.enc.Utf8)); + } catch { + return null; + } +} + +function showSetupPage() { + document.getElementById("setup-page").classList.remove("hidden"); +} + +function hideSetupPage() { + document.getElementById("setup-page").classList.add("hidden"); +} + +let tapCount = 0; +let tapTimer = null; + +document.addEventListener("click", () => { + tapCount++; + + if (tapTimer) clearTimeout(tapTimer); + + tapTimer = setTimeout(() => { + tapCount = 0; + }, 600); + + if (tapCount >= 6) { + tapCount = 0; + showSetupPage(); + } +}); + + + +document.addEventListener("DOMContentLoaded", () => { + + // ========================================================================== + // Salva config + // ========================================================================== + document.getElementById("cfg-save").addEventListener("click", () => { + const url = document.getElementById("cfg-url").value; + const user = document.getElementById("cfg-user").value; + const pass = document.getElementById("cfg-pass").value; + + saveConfig(url, user, pass); + hideSetupPage(); + startLauncher(); + }); + + + + + // Blocca il menu contestuale nativo + document.addEventListener("contextmenu", e => e.preventDefault()); + + // ========================================================================== + // RIFERIMENTI DOM + // ========================================================================== + const folderEl = document.getElementById("folder"); + const contextMenuEl = document.getElementById("context-menu"); + + // ========================================================================== + // STATO GLOBALE + // ========================================================================== + let appsData = []; + let appsOrder = []; + let editMode = false; + + // Zoom + let zoomLevel; + let zoomMax; + let initialPinchDistance = null; + let lastTapTime = 0; + let zoomAnimFrame = null; + + // Long‑press / drag + let longPressTimer = null; + let longPressTarget = null; + let contextMenuTargetId = null; + const MOVE_TOLERANCE = 18; + + let draggingIcon = null; + let draggingId = null; + let dragOffsetX = 0; + let dragOffsetY = 0; + let dragStartX = 0; + let dragStartY = 0; + + // ========================================================================== + // CARICAMENTO APPS + // ========================================================================== + function loadOrder() { + try { + const val = localStorage.getItem("appsOrder"); + if (!val) return null; + const parsed = JSON.parse(val); + return Array.isArray(parsed) ? parsed : null; + } catch { + return null; + } + } + + function saveOrder() { + localStorage.setItem("appsOrder", JSON.stringify(appsOrder)); + } + + function renderApps() { + folderEl.innerHTML = ""; + + appsOrder.forEach(id => { + const app = appsData.find(a => a.id === id); + if (!app) return; + + const div = document.createElement("div"); + div.className = "app-icon"; + div.dataset.id = app.id; + + div.innerHTML = ` + ${app.name} + ${app.name} + `; + + div.addEventListener("click", () => { + if (!editMode) window.open(app.url, "_blank", "noopener"); + }); + + folderEl.appendChild(div); + }); + } + + async function loadApps() { + const apps = await fetch("apps.json").then(r => r.json()); + console.log(apps); + appsData = apps.map((app, i) => ({ + id: app.id || `app-${i}`, + name: app.name, + url: app.url, + icon: app.icon + })); + + const stored = loadOrder(); + if (stored) { + appsOrder = stored.filter(id => appsData.some(a => a.id === id)); + appsData.forEach(a => { + if (!appsOrder.includes(a.id)) appsOrder.push(a.id); + }); + } else { + appsOrder = appsData.map(a => a.id); + } + + renderApps(); + } + + // ========================================================================== + // UTILITY POINTER (TOUCH + MOUSE) + // ========================================================================== + function getPointerPosition(e) { + if (e.touches && e.touches.length > 0) { + return { + pageX: e.touches[0].pageX, + pageY: e.touches[0].pageY, + clientX: e.touches[0].clientX, + clientY: e.touches[0].clientY + }; + } + return { + pageX: e.pageX, + pageY: e.pageY, + clientX: e.clientX, + clientY: e.clientY + }; + } + + // ========================================================================== + // ZOOM STILE IPHONE (PINCH ELASTICO) + WHEEL SU PC + // ========================================================================== + function computeDynamicMaxZoom() { + return Math.min(window.innerWidth / 85, 4.0); + } + + function loadInitialZoom() { + const v = parseFloat(localStorage.getItem("zoomLevel")); + if (!isFinite(v) || v <= 0) return 1; + return Math.min(Math.max(v, 0.5), computeDynamicMaxZoom()); + } + + function applyZoom(z) { + zoomLevel = (!isFinite(z) || z <= 0) ? 1 : z; + document.documentElement.style.setProperty("--zoom", zoomLevel); + localStorage.setItem("zoomLevel", String(zoomLevel)); + } + + function getPinchDistance(touches) { + const [a, b] = touches; + return Math.hypot(a.clientX - b.clientX, a.clientY - b.clientY); + } + + function elasticEase(x) { + return Math.sin(x * Math.PI * 0.5) * 1.05; + } + + function initZoomHandlers() { + zoomMax = computeDynamicMaxZoom(); + zoomLevel = loadInitialZoom(); + applyZoom(zoomLevel); + + // Pinch su mobile + document.addEventListener("touchmove", e => { + if (e.touches.length === 2) e.preventDefault(); + }, { passive: false }); + + document.addEventListener("touchstart", e => { + if (e.touches.length === 2) { + initialPinchDistance = getPinchDistance(e.touches); + if (zoomAnimFrame) cancelAnimationFrame(zoomAnimFrame); + } + + const now = Date.now(); + if (e.touches.length === 1 && now - lastTapTime < 300) { + zoomMax = computeDynamicMaxZoom(); + applyZoom(Math.min(zoomLevel * 1.15, zoomMax)); + } + lastTapTime = now; + }); + + document.addEventListener("touchmove", e => { + if (e.touches.length === 2 && initialPinchDistance) { + const newDist = getPinchDistance(e.touches); + const scale = newDist / initialPinchDistance; + + let newZoom = zoomLevel * scale; + zoomMax = computeDynamicMaxZoom(); + + if (newZoom > zoomMax) newZoom = zoomMax + (newZoom - zoomMax) * 0.25; + if (newZoom < 0.5) newZoom = 0.5 - (0.5 - newZoom) * 0.25; + + applyZoom(newZoom); + initialPinchDistance = newDist; + e.preventDefault(); + } + }, { passive: false }); + + document.addEventListener("touchend", e => { + if (e.touches.length < 2 && initialPinchDistance) { + initialPinchDistance = null; + + zoomMax = computeDynamicMaxZoom(); + const target = Math.min(Math.max(zoomLevel, 0.5), zoomMax); + const start = zoomLevel; + const duration = 250; + const startTime = performance.now(); + + function animate(t) { + const p = Math.min((t - startTime) / duration, 1); + const eased = start + (target - start) * elasticEase(p); + applyZoom(eased); + if (p < 1) zoomAnimFrame = requestAnimationFrame(animate); + } + + zoomAnimFrame = requestAnimationFrame(animate); + } + }); + + // Zoom con wheel su PC + document.addEventListener("wheel", e => { + // Se vuoi zoomare solo con CTRL, scommenta: + // if (!e.ctrlKey) return; + + e.preventDefault(); + + zoomMax = computeDynamicMaxZoom(); + + const direction = e.deltaY < 0 ? 1 : -1; + const factor = 1 + direction * 0.1; + + let newZoom = zoomLevel * factor; + + if (newZoom > zoomMax) newZoom = zoomMax + (newZoom - zoomMax) * 0.25; + if (newZoom < 0.5) newZoom = 0.5 - (0.5 - newZoom) * 0.25; + + applyZoom(newZoom); + }, { passive: false }); + } + + // ========================================================================== + // EDIT MODE + MENU CONTESTUALE + WIGGLE + // ========================================================================== + function enterEditMode() { + editMode = true; + document.body.classList.add("edit-mode"); + } + + function exitEditMode() { + editMode = false; + document.body.classList.remove("edit-mode"); + hideContextMenu(); + } + + function showContextMenuFor(id, x, y) { + contextMenuTargetId = id; + contextMenuEl.style.left = `${x}px`; + contextMenuEl.style.top = `${y}px`; + contextMenuEl.classList.remove("hidden"); + } + + function hideContextMenu() { + contextMenuEl.classList.add("hidden"); + contextMenuTargetId = null; + } + + // ========================================================================== + // LONG PRESS MOBILE + PC + // ========================================================================== + function initLongPressHandlers() { + // --- TOUCH --- + document.addEventListener("touchstart", e => { + if (e.touches.length !== 1) return; + + const touch = e.touches[0]; + const icon = touch.target.closest(".app-icon"); + + if (icon) { + longPressTarget = icon; + + longPressTimer = setTimeout(() => { + if (!editMode) { + enterEditMode(); + if (navigator.vibrate) navigator.vibrate(10); + return; + } + + const r = icon.getBoundingClientRect(); + showContextMenuFor( + icon.dataset.id, + r.left + r.width / 2, + r.top + r.height + ); + if (navigator.vibrate) navigator.vibrate(10); + }, 350); + + return; + } + + // Long press fuori icone → esce da edit mode + longPressTimer = setTimeout(() => { + if (editMode) exitEditMode(); + }, 350); + + }, { passive: true }); + + document.addEventListener("touchmove", e => { + if (!longPressTimer) return; + + const touch = e.touches[0]; + const dx = touch.clientX - (longPressTarget?.getBoundingClientRect().left ?? touch.clientX); + const dy = touch.clientY - (longPressTarget?.getBoundingClientRect().top ?? touch.clientY); + + if (Math.hypot(dx, dy) > 15) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + }, { passive: true }); + + document.addEventListener("touchend", () => { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + }, { passive: true }); + + // --- MOUSE --- + document.addEventListener("mousedown", e => { + if (e.button !== 0) return; + + const icon = e.target.closest(".app-icon"); + + longPressTarget = icon ?? null; + + longPressTimer = setTimeout(() => { + if (!editMode) { + enterEditMode(); + return; + } + + if (icon) { + const r = icon.getBoundingClientRect(); + showContextMenuFor( + icon.dataset.id, + r.left + r.width / 2, + r.top + r.height + ); + } + }, 350); + }); + + document.addEventListener("mousemove", e => { + if (!longPressTimer) return; + + if (longPressTarget) { + const r = longPressTarget.getBoundingClientRect(); + const dx = e.clientX - (r.left + r.width / 2); + const dy = e.clientY - (r.top + r.height / 2); + + if (Math.hypot(dx, dy) > 15) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + } + }); + + document.addEventListener("mouseup", () => { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + }); + } + + // ========================================================================== + // DRAG FLUIDO STILE IPHONE CON PLACEHOLDER + FIX "SOTTO IL DITO" + // ========================================================================== + function startDrag(icon, pos) { + draggingId = icon.dataset.id; + + const r = icon.getBoundingClientRect(); + dragOffsetX = pos.pageX - r.left; + dragOffsetY = pos.pageY - r.top; + + draggingIcon = icon; + draggingIcon.classList.add("dragging"); + draggingIcon.style.position = "fixed"; + draggingIcon.style.left = `${r.left}px`; + draggingIcon.style.top = `${r.top}px`; + draggingIcon.style.width = `${r.width}px`; + draggingIcon.style.height = `${r.height}px`; + draggingIcon.style.zIndex = "1000"; + draggingIcon.style.pointerEvents = "none"; + draggingIcon.style.transform = "translate3d(0,0,0)"; + + const placeholder = icon.cloneNode(true); + placeholder.classList.add("placeholder"); + placeholder.style.visibility = "hidden"; + icon.parentNode.insertBefore(placeholder, icon); + + hideContextMenu(); + } + + function updateDragPosition(pos) { + if (!draggingIcon) return; + + const x = pos.pageX - dragOffsetX; + const y = pos.pageY - dragOffsetY; + + draggingIcon.style.left = `${x}px`; + draggingIcon.style.top = `${y}px`; + + const elem = document.elementFromPoint(pos.clientX, pos.clientY); + const targetIcon = elem && elem.closest(".app-icon:not(.dragging):not(.placeholder)"); + if (!targetIcon) return; + + const from = appsOrder.indexOf(draggingId); + const to = appsOrder.indexOf(targetIcon.dataset.id); + if (from === -1 || to === -1 || from === to) return; + + appsOrder.splice(from, 1); + appsOrder.splice(to, 0, draggingId); + saveOrder(); + } + + // ========================================================================== + // DROP PRECISO NELLA CELLA CORRETTA + // ========================================================================== + function endDrag() { + if (!draggingIcon) return; + + const icon = draggingIcon; + draggingIcon = null; + + const placeholder = folderEl.querySelector(".app-icon.placeholder"); + if (placeholder) placeholder.remove(); + + const left = parseFloat(icon.style.left) || 0; + const top = parseFloat(icon.style.top) || 0; + const dropXClient = left + icon.offsetWidth / 2; + const dropYClient = top + icon.offsetHeight / 2; + + const elem = document.elementFromPoint(dropXClient, dropYClient); + const targetIcon = elem && elem.closest(".app-icon:not(.dragging)"); + + if (targetIcon) { + const from = appsOrder.indexOf(icon.dataset.id); + const to = appsOrder.indexOf(targetIcon.dataset.id); + + if (from !== -1 && to !== -1 && from !== to) { + appsOrder.splice(from, 1); + appsOrder.splice(to, 0, icon.dataset.id); + saveOrder(); + } + } + + icon.classList.remove("dragging"); + icon.style.position = ""; + icon.style.left = ""; + icon.style.top = ""; + icon.style.width = ""; + icon.style.height = ""; + icon.style.zIndex = ""; + icon.style.pointerEvents = ""; + icon.style.transform = ""; + + renderApps(); + } + + function initDragHandlers() { + // --- TOUCH --- + document.addEventListener("touchstart", e => { + if (!editMode) return; + if (e.touches.length !== 1) return; + if (contextMenuTargetId) return; + + const pos = getPointerPosition(e); + const icon = e.touches[0].target.closest(".app-icon"); + if (!icon) return; + + dragStartX = pos.clientX; + dragStartY = pos.clientY; + draggingIcon = null; + draggingId = null; + }, { passive: true }); + + document.addEventListener("touchmove", e => { + if (!editMode) return; + if (e.touches.length !== 1) return; + + const pos = getPointerPosition(e); + + if (!draggingIcon) { + const dx = pos.clientX - dragStartX; + const dy = pos.clientY - dragStartY; + if (Math.hypot(dx, dy) > 10) { + const icon = e.touches[0].target.closest(".app-icon"); + if (icon) { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + startDrag(icon, pos); + } + } + } else { + updateDragPosition(pos); + e.preventDefault(); + } + }, { passive: false }); + + document.addEventListener("touchend", e => { + if (!editMode) return; + if (draggingIcon && (!e.touches || e.touches.length === 0)) { + endDrag(); + } + }, { passive: true }); + + // --- MOUSE --- + document.addEventListener("mousedown", e => { + if (!editMode) return; + if (e.button !== 0) return; + if (contextMenuTargetId) return; + + const icon = e.target.closest(".app-icon"); + if (!icon) return; + + const pos = getPointerPosition(e); + dragStartX = pos.clientX; + dragStartY = pos.clientY; + draggingIcon = null; + draggingId = null; + }); + + document.addEventListener("mousemove", e => { + if (!editMode) return; + + const pos = getPointerPosition(e); + + if (!draggingIcon) { + if (!dragStartX && !dragStartY) return; + + const dx = pos.clientX - dragStartX; + const dy = pos.clientY - dragStartY; + if (Math.hypot(dx, dy) > 10) { + const icon = e.target.closest(".app-icon"); + if (icon) { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + longPressTarget = null; + } + startDrag(icon, pos); + } + } + } else { + updateDragPosition(pos); + } + }); + + document.addEventListener("mouseup", () => { + if (!editMode) return; + dragStartX = 0; + dragStartY = 0; + if (draggingIcon) { + endDrag(); + } + }); + } + + // ========================================================================== + // MENU CONTESTUALE: AZIONI + // ========================================================================== + function initContextMenuActions() { + contextMenuEl.addEventListener("click", e => { + const btn = e.target.closest("button"); + if (!btn || !contextMenuTargetId) return; + + const action = btn.dataset.action; + const app = appsData.find(a => a.id === contextMenuTargetId); + if (!app) return; + + if (action === "rename") { + const nuovoNome = prompt("Nuovo nome app:", app.name); + if (nuovoNome && nuovoNome.trim()) { + app.name = nuovoNome.trim(); + renderApps(); + saveOrder(); + } + } + + if (action === "change-icon") { + const nuovaIcona = prompt("URL nuova icona:", app.icon); + if (nuovaIcona && nuovaIcona.trim()) { + app.icon = nuovaIcona.trim(); + renderApps(); + saveOrder(); + } + } + + if (action === "remove") { + if (confirm("Rimuovere questa app dalla griglia?")) { + appsOrder = appsOrder.filter(id => id !== app.id); + saveOrder(); + renderApps(); + } + } + + hideContextMenu(); + }); + } + +function initGlobalCloseHandlers() { + document.addEventListener("pointerdown", e => { + const isIcon = e.target.closest(".app-icon"); + const isMenu = e.target.closest("#context-menu"); + + // 1️⃣ Clic fuori dal menu → chiudi menu + if (!isMenu && !isIcon && !contextMenuEl.classList.contains("hidden")) { + hideContextMenu(); + } + + // 2️⃣ Clic fuori dalle icone → esci da wiggle mode + if (!isIcon && editMode) { + exitEditMode(); + } + }); +} + // ========================================================================== + // LOAD APPS + // ========================================================================== + +async function login(email, password) { + const res = await fetch(`${URI}/auth/login`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }) + }); + + const data = await res.json(); + return data.token; +} + +async function getLinks() { + const token = await login(USER, PASSW); + + const res = await fetch(`${URI}/links`, { + headers: { + "Authorization": `Bearer ${token}`, + "Accept": "application/json" + } + }); + + const json = await res.json(); + //console.log(json); + appsData = json.map((json, i) => ({ + id: json.id || `app-${i}`, + name: json.name, + url: json.url, + icon: `${URI}${json.icon}` + })); + console.log(appsData); + + const stored = loadOrder(); + if (stored) { + appsOrder = stored.filter(id => appsData.some(a => a.id === id)); + appsData.forEach(a => { + if (!appsOrder.includes(a.id)) appsOrder.push(a.id); + }); + } else { + appsOrder = appsData.map(a => a.id); + } + + renderApps(); + +} + + +const config = loadConfig(); +let URI; +let USER; +let PASSW; + + +if (!config) { + showSetupPage(); +} else { + hideSetupPage(); + startLauncher(); // la tua funzione +} + + + // ========================================================================== + // INIT GLOBALE + // ========================================================================== + + + async function startLauncher() { + //(async function init() { + //await loadApps(); + const conf = loadConfig(); + URI = conf.url; + USER = conf.user; + PASSW = conf.password + await getLinks(); + initZoomHandlers(); + initLongPressHandlers(); + initDragHandlers(); + initContextMenuActions(); + initGlobalCloseHandlers(); + // })(); + } +}); diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..dbd7eb8 --- /dev/null +++ b/app/index.html @@ -0,0 +1,41 @@ + + + + + Launcher + + + + + + + + + + +
+ + + + + + + diff --git a/app/style.css b/app/style.css new file mode 100644 index 0000000..4738a99 --- /dev/null +++ b/app/style.css @@ -0,0 +1,256 @@ +/* ============================================================ + BASE PAGE + ============================================================ */ + +html, body { + margin: 0; + padding: 0; + overflow-x: hidden; /* impedisce pan orizzontale */ + max-width: 100%; + touch-action: pan-y; /* solo scroll verticale */ + background: #ffffff; + /*background: radial-gradient(circle at top, #f8f9ff 0%, #e6e8ef 60%, #dcdfe6 100%);*/ + font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; + color: #1a1a1a; + min-height: 100vh; /* evita scroll inutile se poche icone */ +} + +/* Impedisce selezione testo e highlight blu Android */ +* { + -webkit-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; +} + +/* Variabile di zoom globale */ +:root { + --zoom: 1; +} + +/* ============================================================ + GRIGLIA ICONE + ============================================================ */ + +.folder { + display: grid; + grid-template-columns: repeat( + auto-fill, + minmax(calc(85px * var(--zoom)), 1fr) + ); + gap: calc(16px * var(--zoom)); + padding-top: 24px; + padding-left: 24px; + padding-right: 24px; + padding-bottom: 0; + justify-items: start; /* più coerente con iOS */ + width: 100%; + max-width: 100%; + box-sizing: border-box; + + transition: grid-template-columns 0.15s ease-out, + gap 0.15s ease-out; +} + +/* Contenitore icona — versione glass */ +.app-icon { + text-align: center; + cursor: pointer; + user-select: none; + touch-action: none; + transition: transform 0.18s ease, filter 0.18s ease; + + /* GLASS */ + background: rgba(255, 255, 255, 0.12); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + + border-radius: calc(20px * var(--zoom)); + padding: calc(6px * var(--zoom)); + box-sizing: border-box; + overflow: hidden; +} + +/* Icona PNG */ +.app-icon img { + width: calc(78px * var(--zoom)); + height: calc(78px * var(--zoom)); + border-radius: calc(16px * var(--zoom)); + background: transparent; + pointer-events: none; + + box-shadow: + 0 4px 10px rgba(0, 0, 0, 0.12), + 0 8px 24px rgba(0, 0, 0, 0.08); + + display: block; +} + +/* Etichetta */ +.app-icon span { + display: block; + margin-top: calc(6px * var(--zoom)); + font-size: calc(11px * var(--zoom)); + color: #3a3a3a; + font-weight: 500; + letter-spacing: -0.2px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + transition: font-size 0.18s ease-out, + margin-top 0.18s ease-out; +} + + +/* ============================================================ + WIGGLE MODE + ============================================================ */ + +@keyframes wiggle { + 0% { transform: rotate(-2deg) scale(1.02); } + 50% { transform: rotate( 2deg) scale(0.98); } + 100% { transform: rotate(-2deg) scale(1.02); } +} + +.edit-mode .app-icon:not(.dragging) img { + animation: wiggle 0.25s ease-in-out infinite; +} + +/* Icona trascinata */ +.app-icon.dragging { + opacity: 0.9; + z-index: 1000; +} + +/* Placeholder invisibile */ +.app-icon.placeholder { + opacity: 0; + visibility: hidden; +} + +/* ============================================================ + MENU CONTESTUALE — ANDROID MATERIAL + RESPONSIVE ALLO ZOOM + ============================================================ */ + +#context-menu { + position: fixed; + background: #ffffff; + border-radius: calc(14px * var(--zoom)); + min-width: calc(180px * var(--zoom)); + padding: calc(8px * var(--zoom)) 0; + z-index: 2000; + + /* Ombra Material */ + box-shadow: + 0 calc(6px * var(--zoom)) calc(20px * var(--zoom)) rgba(0,0,0,0.18), + 0 calc(2px * var(--zoom)) calc(6px * var(--zoom)) rgba(0,0,0,0.12); + + /* Animazione apertura */ + opacity: 0; + transform: scale(0.85); + transform-origin: top center; + transition: opacity 120ms ease, transform 120ms ease; +} + +#context-menu:not(.hidden) { + opacity: 1; + transform: scale(1); +} + +#context-menu.hidden { + display: block; + opacity: 0; + pointer-events: none; +} + +/* Pulsanti del menù */ +#context-menu button { + all: unset; + width: 100%; + padding: calc(14px * var(--zoom)) calc(18px * var(--zoom)); + font-size: calc(15px * var(--zoom)); + color: #222; + display: flex; + align-items: center; + gap: calc(12px * var(--zoom)); + cursor: pointer; + position: relative; + overflow: hidden; +} + +/* Ripple effect */ +#context-menu button::after { + content: ""; + position: absolute; + inset: 0; + background: rgba(0,0,0,0.08); + opacity: 0; + transition: opacity 150ms; +} + +#context-menu button:active::after { + opacity: 1; +} + +/* Separatore tra voci */ +#context-menu button + button { + border-top: 1px solid rgba(0,0,0,0.08); +} + +/* Voce "Rimuovi" in rosso */ +#context-menu button:last-child { + color: #d11a2a; +} + + + +/* Permette drag sia mouse che touch */ +.app-icon { + touch-action: none; +} + +/* Evita che l'immagine intercetti eventi */ +.app-icon img { + pointer-events: none; +} + +/* Allineamento stile iOS, evita offset su PC */ +.folder { + justify-items: start; +} + +/* ============================================================ + PAGINA INIZIALE + ============================================================ */ + +#setup-page { + position: fixed; + inset: 0; + background: #f5f5f7; + padding: 40px; + display: flex; + flex-direction: column; + gap: 16px; + z-index: 9999; +} + +#setup-page.hidden { + display: none; +} + +#setup-page input { + padding: 12px; + font-size: 16px; + border-radius: 8px; + border: 1px solid #ccc; +} + +#setup-page button { + padding: 14px; + font-size: 16px; + border-radius: 8px; + background: #007aff; + color: white; + border: none; +} + diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..2485a89 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json package-lock.json* ./ +RUN npm install --production + +COPY . . + +RUN mkdir -p uploads + +EXPOSE 3000 + +CMD ["node", "index.js"] diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..5ce0ff0 --- /dev/null +++ b/server/README.md @@ -0,0 +1,61 @@ +# Server Json per condivisione delle mie apps + +Utilizza MongoDB su 192.168.1.3 con user root e password example + +## Installazione ed avvio server + +vai su server e installa i packages + +```sh +cd server +npm ci install +``` + +far partire il server con + +``` +node index.js +``` +o con +``` +npm start +``` + +è settato per far partire su porta 3000 + +## User interface per inserire i dati + +vai su frontend ed avvia la UI + +``` +cd frontend +npx http-server . -c-1 -p 8282 +``` + +il comando -c-1 toglie la cache +-p indica la porta + +## Altri strumenti per l'utilizzo + +nella directory server c'è + + ./link.sh + +che estrae la lista usando curl + +oppure il comando in js + + node list.js + +che estrae la lista + +nel folder how_use le api e i vari comandi in js + +## Installazione in docker con mongoDB incluso (non testato) + +Come avviarlo + +``` +cd project +docker-compose up --build +``` diff --git a/server/backend/.env.example b/server/backend/.env.example new file mode 100644 index 0000000..949fb60 --- /dev/null +++ b/server/backend/.env.example @@ -0,0 +1,17 @@ +# === SERVER CONFIG === +PORT=3000 + +# === JWT CONFIG === +# Cambialo SEMPRE in produzione +JWT_SECRET=supersegreto-cambialo + +# === MONGO CONFIG === +# In locale: +# MONGO_URI=mongodb://localhost:27017/mydb +# +# In Docker (usato dal docker-compose): +MONGO_URI=mongodb://mongo:27017/mydb + +# === UPLOADS === +# Cartella dove Express serve le icone +UPLOAD_DIR=uploads diff --git a/server/backend/index.js b/server/backend/index.js new file mode 100644 index 0000000..ac517dc --- /dev/null +++ b/server/backend/index.js @@ -0,0 +1,33 @@ +import express from "express"; +import mongoose from "mongoose"; +import cors from "cors"; +import dotenv from "dotenv"; +import linksRouter from "./routes/links.js"; +import authRouter from "./routes/auth.js"; + +dotenv.config(); + +const app = express(); + +app.use(cors()); +app.use(express.json()); + +// Static folder per le icone +app.use("/uploads", express.static("uploads")); + +// Auth routes +app.use("/auth", authRouter); + +// Link routes (protette) +app.use("/links", linksRouter); + +// Connessione Mongo (URL da env con fallback) +const MONGO_URI = process.env.MONGO_URI || "mongodb://mongo:27017/mydb"; + +mongoose + .connect(MONGO_URI) + .then(() => console.log("MongoDB connesso")) + .catch(err => console.error(err)); + +const PORT = process.env.PORT || 3000; +app.listen(PORT, () => console.log(`API su http://localhost:${PORT}`)); diff --git a/server/backend/list.js b/server/backend/list.js new file mode 100644 index 0000000..aa2db94 --- /dev/null +++ b/server/backend/list.js @@ -0,0 +1,26 @@ +async function login(email, password) { + const res = await fetch("http://192.168.1.3:3000/auth/login", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }) + }); + + const data = await res.json(); + return data.token; +} + +async function getLinks() { + const token = await login("fabio.micheluz@gmail.com", "master66"); + + const res = await fetch("http://192.168.1.3:3000/links", { + headers: { + "Authorization": `Bearer ${token}`, + "Accept": "application/json" + } + }); + + const json = await res.json(); + console.log(json); +} + +getLinks(); diff --git a/server/backend/list.sh b/server/backend/list.sh new file mode 100755 index 0000000..726fefa --- /dev/null +++ b/server/backend/list.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +API_URL="http://192.168.1.3:3000" +EMAIL="fabio.micheluz@gmail.com" +PASSWORD="master66" + +echo "➡️ Effettuo login..." + +# Login e estrazione token +TOKEN=$(curl -s -X POST "$API_URL/auth/login" \ + -H "Content-Type: application/json" \ + -d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\"}" | jq -r '.token') + +# Controllo token +if [ "$TOKEN" == "null" ] || [ -z "$TOKEN" ]; then + echo "❌ Errore: impossibile ottenere il token. Controlla email/password." + exit 1 +fi + +echo "🔑 Token ottenuto." + +echo "➡️ Richiedo lista link..." + +# Richiesta protetta +curl -s -X GET "$API_URL/links" \ + -H "Authorization: Bearer $TOKEN" \ + -H "Accept: application/json" | jq . + +echo "✅ Fine." diff --git a/server/backend/list1.js b/server/backend/list1.js new file mode 100644 index 0000000..0ff16b5 --- /dev/null +++ b/server/backend/list1.js @@ -0,0 +1,30 @@ +const URI = "https://my.patachina2.casacam.net"; +const USER = "fabio.micheluz@gmail.com"; +const PASSW = "master66"; + +async function login(email, password) { + const res = await fetch(`${URI}/auth/login`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }) + }); + + const data = await res.json(); + return data.token; +} + +async function getLinks() { + const token = await login(USER, PASSW); + + const res = await fetch(`${URI}/links`, { + headers: { + "Authorization": `Bearer ${token}`, + "Accept": "application/json" + } + }); + + const json = await res.json(); + console.log(json); +} + +getLinks(); diff --git a/server/backend/middleware/auth.js b/server/backend/middleware/auth.js new file mode 100644 index 0000000..eefd0c4 --- /dev/null +++ b/server/backend/middleware/auth.js @@ -0,0 +1,16 @@ +import jwt from "jsonwebtoken"; + +export function authMiddleware(req, res, next) { + const authHeader = req.headers.authorization || ""; + const token = authHeader.startsWith("Bearer ") ? authHeader.slice(7) : null; + + if (!token) return res.status(401).json({ error: "Token mancante" }); + + try { + const payload = jwt.verify(token, process.env.JWT_SECRET || "devsecret"); + req.userId = payload.userId; + next(); + } catch (err) { + return res.status(401).json({ error: "Token non valido" }); + } +} diff --git a/server/backend/models/Link.js b/server/backend/models/Link.js new file mode 100644 index 0000000..e0f4f65 --- /dev/null +++ b/server/backend/models/Link.js @@ -0,0 +1,10 @@ +import mongoose from "mongoose"; + +const LinkSchema = new mongoose.Schema({ + url: { type: String, required: true }, + name: { type: String, required: true }, + icon: { type: String, required: false }, + owner: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: true } +}); + +export default mongoose.model("Link", LinkSchema); diff --git a/server/backend/models/User.js b/server/backend/models/User.js new file mode 100644 index 0000000..fa7e608 --- /dev/null +++ b/server/backend/models/User.js @@ -0,0 +1,8 @@ +import mongoose from "mongoose"; + +const UserSchema = new mongoose.Schema({ + email: { type: String, required: true, unique: true }, + passwordHash: { type: String, required: true } +}); + +export default mongoose.model("User", UserSchema); diff --git a/server/backend/package-lock.json b/server/backend/package-lock.json new file mode 100644 index 0000000..129030a --- /dev/null +++ b/server/backend/package-lock.json @@ -0,0 +1,1380 @@ +{ + "name": "server", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "bcryptjs": "^3.0.3", + "cors": "^2.8.5", + "dotenv": "^17.2.3", + "express": "^5.2.1", + "jsonwebtoken": "^9.0.3", + "mongoose": "^9.0.2", + "multer": "^2.0.2" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.4.tgz", + "integrity": "sha512-p7X/ytJDIdwUfFL/CLOhKgdfJe1Fa8uw9seJYvdOmnP9JBWGWHW69HkOixXS6Wy9yvGf1MbhcS6lVmrhy4jm2g==", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-N8WXpbE6Wgri7KUSvrmQcqrMllKZ9uxkYWMt+mCSGwNc0Hsw9VQTW7ApqI4XNrx6/SaM2QQJCzMPDEXE058s+Q==", + "license": "MIT", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" + }, + "node_modules/bcryptjs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz", + "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, + "node_modules/body-parser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz", + "integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bson": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-7.0.0.tgz", + "integrity": "sha512-Kwc6Wh4lQ5OmkqqKhYGKIuELXl+EPYSCObVE6bWsp1T/cGkOCBN0I8wF/T44BiuhHyNi1mmKVPXk60d41xZ7kw==", + "license": "Apache-2.0", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dotenv": { + "version": "17.2.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", + "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.1.tgz", + "integrity": "sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/jsonwebtoken": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "license": "MIT", + "dependencies": { + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kareem": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-3.0.0.tgz", + "integrity": "sha512-RKhaOBSPN8L7y4yAgNhDT2602G5FD6QbOIISbjN9D6mjHPeqeg7K+EB5IGSU5o81/X2Gzm3ICnAvQW3x3OP8HA==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "license": "MIT" + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mongodb": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-7.0.0.tgz", + "integrity": "sha512-vG/A5cQrvGGvZm2mTnCSz1LUcbOPl83hfB6bxULKQ8oFZauyox/2xbZOoGNl+64m8VBrETkdGCDBdOsCr3F3jg==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.3.0", + "bson": "^7.0.0", + "mongodb-connection-string-url": "^7.0.0" + }, + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.806.0", + "@mongodb-js/zstd": "^7.0.0", + "gcp-metadata": "^7.0.1", + "kerberos": "^7.0.0", + "mongodb-client-encryption": ">=7.0.0 <7.1.0", + "snappy": "^7.3.2", + "socks": "^2.8.6" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-7.0.0.tgz", + "integrity": "sha512-irhhjRVLE20hbkRl4zpAYLnDMM+zIZnp0IDB9akAFFUZp/3XdOfwwddc7y6cNvF2WCEtfTYRwYbIfYa2kVY0og==", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^13.0.0", + "whatwg-url": "^14.1.0" + }, + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/mongoose": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-9.0.2.tgz", + "integrity": "sha512-+GCaqwE+X//yN9eo2M2L/n+mVti9J6vH5iQKbhD+2AArZd5iaZqK/DkmkE4S6/iYYMyVQPTXsRk7jyVOYEtJzA==", + "license": "MIT", + "dependencies": { + "kareem": "3.0.0", + "mongodb": "~7.0", + "mpath": "0.9.0", + "mquery": "6.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-6.0.0.tgz", + "integrity": "sha512-b2KQNsmgtkscfeDgkYMcWGn9vZI9YoXh802VDEwE6qc50zxBFQ0Oo8ROkawbPAsXCY1/Z1yp0MagqsZStPWJjw==", + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/multer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", + "object-assign": "^4.1.1", + "type-is": "^1.6.18", + "xtend": "^4.0.2" + }, + "engines": { + "node": ">= 10.16.0" + } + }, + "node_modules/multer/node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/multer/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/multer/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/multer/node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", + "license": "MIT" + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "license": "MIT", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/server/backend/package.json b/server/backend/package.json new file mode 100644 index 0000000..5439c4e --- /dev/null +++ b/server/backend/package.json @@ -0,0 +1,15 @@ +{ + "type": "module", + "dependencies": { + "bcryptjs": "^3.0.3", + "cors": "^2.8.5", + "dotenv": "^17.2.3", + "express": "^5.2.1", + "jsonwebtoken": "^9.0.3", + "mongoose": "^9.0.2", + "multer": "^2.0.2" + }, + "scripts": { + "start": "node index.js" + } +} diff --git a/server/backend/routes/auth.js b/server/backend/routes/auth.js new file mode 100644 index 0000000..2f0d618 --- /dev/null +++ b/server/backend/routes/auth.js @@ -0,0 +1,42 @@ +import express from "express"; +import bcrypt from "bcryptjs"; +import jwt from "jsonwebtoken"; +import User from "../models/User.js"; + +const router = express.Router(); + +// Registrazione +router.post("/register", async (req, res) => { + const { email, password } = req.body; + if (!email || !password) + return res.status(400).json({ error: "Email e password richiesti" }); + + const existing = await User.findOne({ email }); + if (existing) return res.status(400).json({ error: "Email già registrata" }); + + const passwordHash = await bcrypt.hash(password, 10); + + const user = await User.create({ email, passwordHash }); + + res.json({ id: user._id, email: user.email }); +}); + +// Login +router.post("/login", async (req, res) => { + const { email, password } = req.body; + const user = await User.findOne({ email }); + if (!user) return res.status(400).json({ error: "Credenziali non valide" }); + + const valid = await bcrypt.compare(password, user.passwordHash); + if (!valid) return res.status(400).json({ error: "Credenziali non valide" }); + + const token = jwt.sign( + { userId: user._id }, + process.env.JWT_SECRET || "devsecret", + { expiresIn: "7d" } + ); + + res.json({ token }); +}); + +export default router; diff --git a/server/backend/routes/links.js b/server/backend/routes/links.js new file mode 100644 index 0000000..faec90a --- /dev/null +++ b/server/backend/routes/links.js @@ -0,0 +1,77 @@ +import express from "express"; +import multer from "multer"; +import Link from "../models/Link.js"; +import { authMiddleware } from "../middleware/auth.js"; + +const router = express.Router(); + +// Config upload +const storage = multer.diskStorage({ + destination: "uploads/", + filename: (req, file, cb) => { + const unique = Date.now() + "-" + file.originalname; + cb(null, unique); + } +}); +const upload = multer({ storage }); + +// Tutte le rotte protette +router.use(authMiddleware); + +// GET /links - lista dei link dell'utente +router.get("/", async (req, res) => { + const links = await Link.find({ owner: req.userId }); + res.json(links); +}); + +// POST /links - crea nuovo link con eventuale icona +router.post("/", upload.single("icon"), async (req, res) => { + const { url, name } = req.body; + const iconPath = req.file ? `/uploads/${req.file.filename}` : null; + + const link = await Link.create({ + url, + name, + icon: iconPath, + owner: req.userId + }); + + res.json(link); +}); + +// DELETE /links/:id +router.delete("/:id", async (req, res) => { + const { id } = req.params; + + const link = await Link.findOneAndDelete({ + _id: id, + owner: req.userId + }); + + if (!link) return res.status(404).json({ error: "Link non trovato" }); + + res.json({ success: true }); +}); + +// PUT /links/:id +router.put("/:id", upload.single("icon"), async (req, res) => { + const { id } = req.params; + const { name, url } = req.body; + + const update = {}; + if (name) update.name = name; + if (url) update.url = url; + if (req.file) update.icon = `/uploads/${req.file.filename}`; + + const link = await Link.findOneAndUpdate( + { _id: id, owner: req.userId }, + update, + { new: true } + ); + + if (!link) return res.status(404).json({ error: "Link non trovato" }); + + res.json(link); +}); + +export default router; diff --git a/server/backend/uploads/1767085843931-google.png b/server/backend/uploads/1767085843931-google.png new file mode 100644 index 0000000..1f90b36 Binary files /dev/null and b/server/backend/uploads/1767085843931-google.png differ diff --git a/server/backend/uploads/1767085872529-github.jpg b/server/backend/uploads/1767085872529-github.jpg new file mode 100644 index 0000000..476fbd4 Binary files /dev/null and b/server/backend/uploads/1767085872529-github.jpg differ diff --git a/server/backend/uploads/1767087426549-a.jpg b/server/backend/uploads/1767087426549-a.jpg new file mode 100644 index 0000000..8b960f2 Binary files /dev/null and b/server/backend/uploads/1767087426549-a.jpg differ diff --git a/server/backend/uploads/1767103637269-a.jpg b/server/backend/uploads/1767103637269-a.jpg new file mode 100644 index 0000000..8b960f2 Binary files /dev/null and b/server/backend/uploads/1767103637269-a.jpg differ diff --git a/server/backend/uploads/1767103690515-github.jpg b/server/backend/uploads/1767103690515-github.jpg new file mode 100644 index 0000000..476fbd4 Binary files /dev/null and b/server/backend/uploads/1767103690515-github.jpg differ diff --git a/server/backend/uploads/1767193346029-google.png b/server/backend/uploads/1767193346029-google.png new file mode 100644 index 0000000..3d6d694 Binary files /dev/null and b/server/backend/uploads/1767193346029-google.png differ diff --git a/server/backend/uploads/1767193354089-github.png b/server/backend/uploads/1767193354089-github.png new file mode 100644 index 0000000..ee269b3 Binary files /dev/null and b/server/backend/uploads/1767193354089-github.png differ diff --git a/server/backend/uploads/1767193354094-github.png b/server/backend/uploads/1767193354094-github.png new file mode 100644 index 0000000..ee269b3 Binary files /dev/null and b/server/backend/uploads/1767193354094-github.png differ diff --git a/server/docker-compose.yml b/server/docker-compose.yml new file mode 100644 index 0000000..3ff65cd --- /dev/null +++ b/server/docker-compose.yml @@ -0,0 +1,40 @@ +version: "3.9" + +services: + mongo: + image: mongo:7 + container_name: mongo + restart: unless-stopped + ports: + - "27017:27017" + volumes: + - mongo_data:/data/db + + api: + build: ./server + container_name: api + restart: unless-stopped + environment: + - MONGO_URI=mongodb://mongo:27017/mydb + - JWT_SECRET=supersegreto-cambialo + - PORT=3000 + ports: + - "3000:3000" + volumes: + - ./server/uploads:/app/uploads + depends_on: + - mongo + + frontend: + image: nginx:alpine + container_name: frontend + restart: unless-stopped + ports: + - "8080:80" + volumes: + - ./frontend:/usr/share/nginx/html:ro + depends_on: + - api + +volumes: + mongo_data: diff --git a/server/frontend/api.js b/server/frontend/api.js new file mode 100644 index 0000000..fd57756 --- /dev/null +++ b/server/frontend/api.js @@ -0,0 +1,98 @@ +const API_BASE = "http://192.168.1.3:3000"; + +// ------------------------------ +// AUTH +// ------------------------------ + +export async function login(email, password) { + const res = await fetch(`${API_BASE}/auth/login`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }) + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore login"); + return data.token; +} + +export async function register(email, password) { + const res = await fetch(`${API_BASE}/auth/register`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }) + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore registrazione"); + return data; +} + +// ------------------------------ +// LINKS +// ------------------------------ + +export async function getLinks(token) { + const res = await fetch(`${API_BASE}/links`, { + headers: { + Authorization: `Bearer ${token}`, + Accept: "application/json" + } + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore caricamento link"); + return data; +} + +export async function createLink(token, { name, url, iconFile }) { + const formData = new FormData(); + formData.append("name", name); + formData.append("url", url); + if (iconFile) formData.append("icon", iconFile); + + const res = await fetch(`${API_BASE}/links`, { + method: "POST", + headers: { + Authorization: `Bearer ${token}` + }, + body: formData + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore creazione link"); + return data; +} + +export async function deleteLink(token, id) { + const res = await fetch(`${API_BASE}/links/${id}`, { + method: "DELETE", + headers: { + Authorization: `Bearer ${token}` + } + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore eliminazione link"); + return data; +} + +export async function updateLink(token, id, { name, url, iconFile }) { + const formData = new FormData(); + if (name) formData.append("name", name); + if (url) formData.append("url", url); + if (iconFile) formData.append("icon", iconFile); + + const res = await fetch(`${API_BASE}/links/${id}`, { + method: "PUT", + headers: { + Authorization: `Bearer ${token}` + }, + body: formData + }); + + const data = await res.json(); + if (!res.ok) throw new Error(data.error || "Errore aggiornamento link"); + return data; +} + diff --git a/server/frontend/app.js b/server/frontend/app.js new file mode 100644 index 0000000..4362cea --- /dev/null +++ b/server/frontend/app.js @@ -0,0 +1,191 @@ +import { + login, + register, + getLinks, + createLink, + deleteLink, + updateLink +} from "./api.js"; + +const authSection = document.getElementById("authSection"); +const linkSection = document.getElementById("linkSection"); +const authStatus = document.getElementById("authStatus"); +const list = document.getElementById("list"); +const editModal = document.getElementById("editModal"); +const editForm = document.getElementById("editForm"); +const closeModal = document.getElementById("closeModal"); + +let editingId = null; +let token = null; + +// ====================================================== +// AUTH +// ====================================================== + +function setToken(t) { + token = t; + + if (token) { + authSection.style.display = "none"; + linkSection.style.display = "block"; + loadLinks(); + } else { + authSection.style.display = "block"; + linkSection.style.display = "none"; + } +} + +document.getElementById("loginForm").addEventListener("submit", async e => { + e.preventDefault(); + const email = e.target.email.value; + const password = e.target.password.value; + + try { + const t = await login(email, password); + setToken(t); + } catch (err) { + authStatus.textContent = err.message; + } +}); + +document.getElementById("registerForm").addEventListener("submit", async e => { + e.preventDefault(); + const email = e.target.email.value; + const password = e.target.password.value; + + try { + await register(email, password); + authStatus.textContent = "Registrato! Ora effettua il login."; + } catch (err) { + authStatus.textContent = err.message; + } +}); + +// ====================================================== +// LINKS +// ====================================================== + +async function loadLinks() { + const links = await getLinks(token); + + list.innerHTML = links + .map( + link => ` +
+ ${link.icon ? `` : ""} + +
+ ${link.name}
+ ${link.url} +
+ +
+ + +
+
+ ` + ) + .join(""); +} + +// ====================================================== +// CREAZIONE LINK +// ====================================================== + +document.getElementById("linkForm").addEventListener("submit", async e => { + e.preventDefault(); + + const formData = new FormData(e.target); + const iconFile = formData.get("icon"); + + await createLink(token, { + name: formData.get("name"), + url: formData.get("url"), + iconFile: iconFile.size > 0 ? iconFile : null + }); + + e.target.reset(); + loadLinks(); +}); + +// ====================================================== +// AZIONI: MODIFICA + ELIMINA +// ====================================================== + +list.addEventListener("click", async e => { + const id = e.target.dataset.id; + if (!id) return; + + // ------------------------- + // ELIMINA + // ------------------------- + if (e.target.classList.contains("deleteBtn")) { + if (confirm("Vuoi davvero eliminare questo link?")) { + await deleteLink(token, id); + loadLinks(); + } + return; + } + + // ------------------------- + // MODIFICA + // ------------------------- +/* if (e.target.classList.contains("editBtn")) { + const newName = prompt("Nuovo nome:"); + const newUrl = prompt("Nuovo URL:"); + + if (!newName && !newUrl) return; + + await updateLink(token, id, { + name: newName, + url: newUrl + }); + + loadLinks(); + }*/ + +if (e.target.classList.contains("editBtn")) { + const id = e.target.dataset.id; + editingId = id; + + // Precompila i campi + const item = e.target.closest(".item"); + const name = item.querySelector("strong").textContent; + const url = item.querySelector("a").textContent; + + editForm.name.value = name; + editForm.url.value = url; + editForm.icon.value = ""; // reset file input + + editModal.style.display = "flex"; +} + +closeModal.addEventListener("click", () => { + editModal.style.display = "none"; +}); + +editForm.addEventListener("submit", async e => { + e.preventDefault(); + + const name = editForm.name.value; + const url = editForm.url.value; + const iconFile = editForm.icon.files[0] || null; + + await updateLink(token, editingId, { + name, + url, + iconFile + }); + + editModal.style.display = "none"; + loadLinks(); +}); + +}); + +// ====================================================== +// INIT +// ====================================================== + +setToken(null); diff --git a/server/frontend/app.js.old b/server/frontend/app.js.old new file mode 100644 index 0000000..be97267 --- /dev/null +++ b/server/frontend/app.js.old @@ -0,0 +1,98 @@ +import { + login, + register, + getLinks, + createLink, + deleteLink, + updateLink +} from "./api.js"; + +const authSection = document.getElementById("authSection"); +const linkSection = document.getElementById("linkSection"); +const authStatus = document.getElementById("authStatus"); +const list = document.getElementById("list"); + +let token = null; + +// ------------------------------ +// AUTH +// ------------------------------ + +function setToken(t) { + token = t; + if (token) { + authSection.style.display = "none"; + linkSection.style.display = "block"; + loadLinks(); + } else { + authSection.style.display = "block"; + linkSection.style.display = "none"; + } +} + +document.getElementById("loginForm").addEventListener("submit", async e => { + e.preventDefault(); + const email = e.target.email.value; + const password = e.target.password.value; + + try { + const t = await login(email, password); + setToken(t); + } catch (err) { + authStatus.textContent = err.message; + } +}); + +document.getElementById("registerForm").addEventListener("submit", async e => { + e.preventDefault(); + const email = e.target.email.value; + const password = e.target.password.value; + + try { + await register(email, password); + authStatus.textContent = "Registrato! Ora effettua il login."; + } catch (err) { + authStatus.textContent = err.message; + } +}); + +// ------------------------------ +// LINKS +// ------------------------------ + +async function loadLinks() { + const links = await getLinks(token); + + list.innerHTML = links + .map( + link => ` +
+ ${link.icon ? `` : ""} +
+ ${link.name}
+ ${link.url} +
+
+ ` + ) + .join(""); +} + +document.getElementById("linkForm").addEventListener("submit", async e => { + e.preventDefault(); + + const formData = new FormData(e.target); + const iconFile = formData.get("icon"); + + await createLink(token, { + name: formData.get("name"), + url: formData.get("url"), + iconFile: iconFile.size > 0 ? iconFile : null + }); + + e.target.reset(); + loadLinks(); +}); + +// Init +setToken(null); diff --git a/server/frontend/index.html b/server/frontend/index.html new file mode 100644 index 0000000..b9669d8 --- /dev/null +++ b/server/frontend/index.html @@ -0,0 +1,71 @@ + + + + + Link Manager + + + + +
+ +

Link Manager

+ + +
+
+

Accedi

+
+ + + +
+ +

Oppure registrati

+
+ + + +
+ +
+
+
+ + + + +
+ + + + + diff --git a/server/frontend/style.css b/server/frontend/style.css new file mode 100644 index 0000000..5e2c3c3 --- /dev/null +++ b/server/frontend/style.css @@ -0,0 +1,85 @@ +body { + font-family: -apple-system, BlinkMacSystemFont, "SF Pro", sans-serif; + background: #f5f5f7; + margin: 0; + padding: 40px; + color: #333; +} + +.container { + max-width: 700px; + margin: auto; +} + +h1 { + text-align: center; + margin-bottom: 40px; + font-weight: 600; +} + +.card { + background: white; + padding: 25px; + border-radius: 18px; + box-shadow: 0 4px 20px rgba(0,0,0,0.08); + margin-bottom: 30px; +} + +form { + display: flex; + flex-direction: column; + gap: 12px; +} + +input { + padding: 12px; + border-radius: 10px; + border: 1px solid #ccc; + font-size: 15px; +} + +button { + padding: 12px; + border-radius: 10px; + border: none; + background: #007aff; + color: white; + font-size: 16px; + cursor: pointer; + font-weight: 600; +} + +button:hover { + background: #0063cc; +} + +#list .item { + display: flex; + align-items: center; + gap: 12px; + padding: 10px 0; + border-bottom: 1px solid #eee; +} + +#list img { + width: 40px; + height: 40px; + object-fit: contain; + border-radius: 8px; +} +.modal { + position: fixed; + top: 0; left: 0; + width: 100%; height: 100%; + background: rgba(0,0,0,0.4); + display: flex; + justify-content: center; + align-items: center; +} + +.modal-content { + background: white; + padding: 20px; + border-radius: 12px; + width: 300px; +}