How hotwax/inventory-count works
Project type and purpose
• This is a cross‐platform inventory‐counting application built with Ionic Framework (Vue) that runs as:
• A Progressive Web App (Ionic serve / PWA)
• Native Android app via Capacitor
• Native iOS app via Capacitor
• It communicates with a remote backend (RESTful API) and supports offline usage with local storage/indexedDB.
File structure
• Top level: configuration files (.env, firebase.json, capacitor.config.json), mobile platforms (android/, ios/), public assets, and the core source under src/.
• src/ contains:
• views/ & components/ – UI layer (Ionic Vue components)
• router/ – Vue Router for navigation
• store/ – Vuex modules (count, product, user, util) implementing state management (Flux/MVVM pattern)
• services/ – TypeScript classes wrapping HTTP calls to the backend API
• adapter/, api/ – abstraction layers for API endpoints
• offline-helper/ – logic handling offline data sync
• event-bus/ – Vue event bus for cross‐component communication
• i18n/ & locales/ – internationalization
• utils/, logger/ – utility functions and logging
• android/ and ios/ hold the native wrappers generated by Capacitor, linking the web assets to platform projects.
• Configuration for CI/CD: GitHub workflows (.github/workflows) and Firebase Hosting (firebase.json).
README for insights
• The README confirms:
• Firebase CLI + Hosting is used for web deployments
• Ionic/Cordova CLI is used for builds
• vue-cli-service builds for different modes (staging, production)
• Capacitor performs “copy” into native projects
• Contribution & release processes use GitHub Actions.
Major components and their relationships
a. Frontend (Ionic Vue):
– UI Views & Components (views/, components/)
– Router (router/)
– Vuex Store (store/)
– Services & Adapters (services/, adapter/, api/)
– Offline Helper & Event Bus (offline-helper/, event-bus/)
– i18n & Logger (i18n.ts, logger/)
b. Native Platforms (Capacitor wrappers):
– Android project (android/)
– iOS project (ios/)
– Capacitor runtime bridges web code to native APIs
c. External Backend API:
– REST endpoints consumed by services (CountService, ProductService, etc.)
– Authentication & Authorization (authorization/)
d. Data Stores:
– Remote DB (behind backend API)
– Local storage/indexedDB for offline caching (offline-helper/)
– Vuex in‐memory store for app state
e. Deployment & CI/CD:
– GitHub Actions → build & test → Firebase Hosting
– Ionic/Cordova CLI for local builds → Capacitor copy → deploy to app stores
Architectural patterns & design principles
• MVVM / Flux: Views ↔ Vuex Store ↔ Services
• Modular state: store/modules per domain (count, product, user, util)
• Layered API abstraction: adapter → api → services → store → UI
• Offline‐first: offline-helper manages sync between local and remote
• Platform‐agnostic UI: Ionic Components for both web & native