From 23028fe6961ff07fc35a41354569ada96f4425ab Mon Sep 17 00:00:00 2001 From: sassanix <39465071+sassanix@users.noreply.github.com> Date: Thu, 13 Nov 2025 09:22:59 -0400 Subject: [PATCH] Removed vite Removed vite, and consolidated files to frontend folder --- CHANGELOG.md | 146 +- Dockerfile | 15 +- frontend/{src => }/about.html | 39 +- frontend/{src => }/auth-redirect.html | 22 +- frontend/{public => }/auth-redirect.js | 0 frontend/{public => }/chart.js | 0 frontend/{src => }/debug-export.html | 12 +- frontend/{src => }/favicon.ico | Bin frontend/{public => }/file-utils.js | 0 frontend/{public => }/footer-content.js | 0 frontend/{public => }/footer-fix.js | 0 frontend/{src => }/header-fix.css | 0 frontend/{src => }/img/favicon-16x16.png | Bin frontend/{src => }/img/favicon-32x32.png | Bin frontend/{src => }/img/favicon-512x512.png | Bin frontend/{src => }/index.html | 59 +- frontend/js/components/addWarrantyForm.js | 83 + frontend/{src => }/js/components/claims.js | 0 frontend/{src => }/js/components/editModal.js | 207 ++ frontend/{src => }/js/components/modals.js | 0 frontend/{src => }/js/components/notes.js | 0 frontend/{src => }/js/components/paperless.js | 0 frontend/{src => }/js/components/tag.js | 0 frontend/js/components/tagManager.js | 95 + frontend/{src => }/js/components/ui.js | 0 .../{src => }/js/components/warrantyCard.js | 0 .../js/controllers/warrantyListController.js | 622 ++++++ frontend/{public => }/js/i18n.js | 0 frontend/js/index.js | 25 + frontend/{public => }/js/lib/i18next.min.js | 0 .../lib/i18nextBrowserLanguageDetector.min.js | 0 .../js/lib/i18nextHttpBackend.min.js | 0 frontend/{src => }/js/services/apiService.js | 76 +- frontend/{src => }/js/services/authService.js | 0 frontend/js/services/i18nAdapter.js | 20 + frontend/{src => }/js/store.js | 0 frontend/{src => }/login.html | 30 +- frontend/{src => }/manifest.json | 0 frontend/{src => }/mobile-header.css | 0 frontend/{public => }/mobile-menu.js | 0 frontend/package-lock.json | 1061 ---------- frontend/package.json | 19 - frontend/{src => }/register.html | 39 +- .../{src => }/reset-password-request.html | 37 +- frontend/{src => }/reset-password.html | 37 +- frontend/{public => }/script.js | 1813 +++++------------ frontend/{src => }/settings-new.html | 85 +- frontend/{public => }/settings-new.js | 0 frontend/{public => }/settings-styles.css | 0 frontend/{src => }/status.html | 49 +- frontend/{src => }/status.js | 57 +- frontend/{src => }/style.css | 14 +- frontend/{public => }/sw.js | 0 frontend/{public => }/theme-loader.js | 0 frontend/{public => }/version-checker.js | 0 frontend/vite.config.js | 35 - 56 files changed, 1954 insertions(+), 2743 deletions(-) rename frontend/{src => }/about.html (94%) rename frontend/{src => }/auth-redirect.html (92%) rename frontend/{public => }/auth-redirect.js (100%) rename frontend/{public => }/chart.js (100%) rename frontend/{src => }/debug-export.html (96%) rename frontend/{src => }/favicon.ico (100%) rename frontend/{public => }/file-utils.js (100%) rename frontend/{public => }/footer-content.js (100%) rename frontend/{public => }/footer-fix.js (100%) rename frontend/{src => }/header-fix.css (100%) rename frontend/{src => }/img/favicon-16x16.png (100%) rename frontend/{src => }/img/favicon-32x32.png (100%) rename frontend/{src => }/img/favicon-512x512.png (100%) rename frontend/{src => }/index.html (98%) create mode 100644 frontend/js/components/addWarrantyForm.js rename frontend/{src => }/js/components/claims.js (100%) rename frontend/{src => }/js/components/editModal.js (52%) rename frontend/{src => }/js/components/modals.js (100%) rename frontend/{src => }/js/components/notes.js (100%) rename frontend/{src => }/js/components/paperless.js (100%) rename frontend/{src => }/js/components/tag.js (100%) create mode 100644 frontend/js/components/tagManager.js rename frontend/{src => }/js/components/ui.js (100%) rename frontend/{src => }/js/components/warrantyCard.js (100%) create mode 100644 frontend/js/controllers/warrantyListController.js rename frontend/{public => }/js/i18n.js (100%) create mode 100644 frontend/js/index.js rename frontend/{public => }/js/lib/i18next.min.js (100%) rename frontend/{public => }/js/lib/i18nextBrowserLanguageDetector.min.js (100%) rename frontend/{public => }/js/lib/i18nextHttpBackend.min.js (100%) rename frontend/{src => }/js/services/apiService.js (58%) rename frontend/{src => }/js/services/authService.js (100%) create mode 100644 frontend/js/services/i18nAdapter.js rename frontend/{src => }/js/store.js (100%) rename frontend/{src => }/login.html (94%) rename frontend/{src => }/manifest.json (100%) rename frontend/{src => }/mobile-header.css (100%) rename frontend/{public => }/mobile-menu.js (100%) delete mode 100644 frontend/package-lock.json delete mode 100644 frontend/package.json rename frontend/{src => }/register.html (94%) rename frontend/{src => }/reset-password-request.html (89%) rename frontend/{src => }/reset-password.html (93%) rename frontend/{public => }/script.js (84%) rename frontend/{src => }/settings-new.html (94%) rename frontend/{public => }/settings-new.js (100%) rename frontend/{public => }/settings-styles.css (100%) rename frontend/{src => }/status.html (96%) rename frontend/{src => }/status.js (97%) rename frontend/{src => }/style.css (99%) rename frontend/{public => }/sw.js (100%) rename frontend/{public => }/theme-loader.js (100%) rename frontend/{public => }/version-checker.js (100%) delete mode 100644 frontend/vite.config.js diff --git a/CHANGELOG.md b/CHANGELOG.md index ce508f1..08440fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,55 +2,65 @@ ## 1.0.3 - 2025-11-07 ### Added -- **Vite build tool (multi-page app) for the frontend** - - Initialized npm in `frontend/` with `dev`, `build`, and `preview` scripts. - - Introduced `vite.config.js` with `root: 'src'`, `outDir: '../dist'`, `publicDir: 'public'`, a development `/api` proxy, and explicit multi-page HTML inputs. - - Restructured frontend: moved sources to `frontend/src/` and static/non-module assets to `frontend/public/`. - - _Files: `frontend/package.json`, `frontend/vite.config.js`, `frontend/src/**/*`, `frontend/public/**/*`_ +- **Modular Entry Orchestrator and Feature Modules** + - Added a lean ES module entry orchestrator `index.js` that initializes auth and feature modules after `authStateReady`. + - Created feature-specific modules to prepare deconstruction of the monolith while preserving identical behavior: + - `warrantyListController.js` (list loading/filtering/rendering controller surface) + - `tagManager.js` (tag management: load/render/create/update/delete) + - `addWarrantyForm.js` (multi-step add warranty wizard surface) + - Wired pages to load the new module entry with `` alongside legacy `script.js` for zero-regression rollout. + - _Files: `frontend/js/index.js`, `frontend/js/controllers/warrantyListController.js`, `frontend/js/components/tagManager.js`, `frontend/js/components/addWarrantyForm.js`, `frontend/index.html`, `frontend/about.html`, `frontend/status.html`, `frontend/register.html`, `frontend/reset-password.html`, `frontend/reset-password-request.html`_ - **Centralized Authentication Service** - New module `authService.js` exposes `initAuth`, `login`, `logout`, `getToken`, `getCurrentUser`, `isAuthenticated`. - Backwards compatibility: attaches a `window.auth` facade so existing code continues to work. - Handles header UI state, user menu/settings dropdown toggling, and dispatches a unified `authStateReady` event. - Robustly hides “Create Account” UI when registration is disabled (with a MutationObserver to keep it hidden after other scripts mutate the DOM). - - _Files: `frontend/src/js/services/authService.js`, `frontend/src/*.html` (module includes)_ + - _Files: `frontend/js/services/authService.js`, `frontend/*.html` (module includes)_ - **Dedicated API Service** - New `apiService.js` provides a `baseRequest` wrapper that injects the `Authorization` header and normalizes error handling. - Exposes named helpers (e.g., `getWarranties`, `updateWarranty`, `deleteWarranty`, `getStatistics`, `savePreferences`) and a `window.api` shim for non-module scripts. - Safe global `fetch` shim adds the Authorization header for `/api/...` calls when missing. - - _Files: `frontend/src/js/services/apiService.js`, `frontend/src/*.html` (module includes)_ + - _Files: `frontend/js/services/apiService.js`, `frontend/*.html` (module includes)_ - **Central State Management Store** - Introduced a `store.js` module to act as a single source of truth for application data (warranties, filters, loading states), eliminating scattered global variables. - UI updates are now driven by custom events, creating a predictable data flow. - - _Files: `frontend/src/js/store.js`_ + - _Files: `frontend/js/store.js`_ - **Component-Based UI Modules** - Created a suite of new, reusable UI component modules to replace HTML string concatenation. Each is responsible for building a specific part of the UI via safe DOM manipulation. - Modules include: `warrantyCard.js`, `tag.js`, `modals.js`, `editModal.js`, `claims.js`, `notes.js`, `paperless.js`, and `ui.js`. - - _Files: `frontend/src/js/components/*`_ + - _Files: `frontend/js/components/*`_ - **HTML `