How hpaprika/concilia-pe works
Project Type and Purpose
• ConciliaPe is a static, single-page Progressive Web App (PWA) for recording and reconciling airport baggage data by flight.
• It’s built with vanilla HTML, CSS, and JavaScript, with no backend server—entirely client-side, optimized for mobile and desktop.
File Structure Analysis
• Top level:
• index.html — main entry point and UI shell
• manifest.json — PWA metadata
• sw.js & src/js/register-sw.js — service worker for offline/caching
• src/css/main.css — presentation layer (mobile-first, responsive)
• src/js/app.js — application logic (form handling, baggage calculation, localStorage persistence, message generation)
• No server or API directories—signals a purely frontend architecture with client storage (localStorage).
README Insights
• UI/UX patterns: modal help dialog, reset button, message ready-for-WhatsApp feature.
Main Components
a. Browser (client runtime)
b. UI Layer
• index.html (semantic structure)
c. Application Logic
• app.js (captures user input, computes totals, generates WhatsApp message)
d. Persistence Layer
• localStorage (stores form data, with custom TTL logic)
e. PWA Support
• Service Worker (sw.js + register-sw.js) for:
• Offline support & fetch interception
f. External Interfaces
• WhatsApp Web / Share API (message share/clipboard)
Relationships & Data Flows
• On page load:
• Browser requests index.html → sw.js intercepts (return from cache or network)
• register-sw.js registers the SW
• manifest.json read by browser for installability
• User interaction:
• UI → app.js reads/writes localStorage → updates DOM
• Form submit → app.js generates text payload → Share API or click-to-copy → WhatsApp
• Offline behavior:
• Service Worker caches static assets on install → serves responses when offline
• Data persistence:
• app.js writes JSON to localStorage with timestamp → on reload, rehydrate form if <24h old
Architectural Patterns & Principles
• Separation of concerns: presentation (CSS), structure (HTML), logic (JS)
• Offline-first PWA pattern (cache-then-network strategy)
• Mobile-first, responsive design with custom properties and breakpoints
• Single-page static architecture—no server components