diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml
index 5fce158..bd17840 100644
--- a/frontend/Cargo.toml
+++ b/frontend/Cargo.toml
@@ -32,6 +32,23 @@ web-sys = { version = "0.3", features = [
"CssStyleDeclaration",
"MediaQueryList",
"MediaQueryListEvent",
+ # Notification API for browser notifications
+ "Notification",
+ "NotificationOptions",
+ "NotificationPermission",
+ # Service Worker API for background processing
+ "ServiceWorkerContainer",
+ "ServiceWorkerRegistration",
+ "MessageEvent",
+ # IndexedDB API for persistent alarm storage
+ "IdbDatabase",
+ "IdbObjectStore",
+ "IdbTransaction",
+ "IdbRequest",
+ "IdbKeyRange",
+ "IdbFactory",
+ "IdbOpenDbRequest",
+ "IdbVersionChangeEvent",
] }
wasm-bindgen = "0.2"
js-sys = "0.3"
@@ -73,3 +90,6 @@ gloo-storage = "0.3"
gloo-timers = "0.3"
wasm-bindgen-futures = "0.4"
+# IndexedDB for persistent alarm storage
+indexed_db_futures = "0.4"
+
diff --git a/frontend/index.html b/frontend/index.html
index 16d07dc..c5313b5 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -8,6 +8,7 @@
+
@@ -17,6 +18,19 @@
window.addEventListener('TrunkApplicationStarted', () => {
console.log("Trunk application started successfully!");
});
+
+ // Register service worker for alarm background processing
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register('/service-worker.js')
+ .then((registration) => {
+ console.log('SW registered: ', registration);
+ })
+ .catch((registrationError) => {
+ console.log('SW registration failed: ', registrationError);
+ });
+ });
+ }