# nibecar-cofeben/plux architecture

> Architecture diagram of the GitHub repository nibecar-cofeben/plux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nibecar-cofeben/plux
- Repository: https://github.com/nibecar-cofeben/plux

## Overview

Plux is an offline-first travel-planning PWA. The primary workflow is to organize a trip by destination and day, then manage routes, costs, and reservation documents; users can also explore destination ideas and export or share plans. The README documents local browser persistence, offline caching, AI-assisted voucher extraction, and optional Firebase collaboration. Several module relationships are therefore shown only where the README states them; unsampled implementation details and call paths are not inferred.

Main entry points: [`script.js`](https://github.com/nibecar-cofeben/plux/blob/Public/script.js) (Itinerary organizer), [`js/plux-collab.js`](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-collab.js) (Trip collaboration), [`index.html`](https://github.com/nibecar-cofeben/plux/blob/Public/index.html) (Planner interface), [`js/plux-v71-routing-map.js`](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-routing-map.js) (Routes and maps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Trip planning"]
  node_planner_ui["Planner interface<br/>[index.html]"]
  node_itinerary["Itinerary organizer<br/>[script.js]"]
  node_templates["Trip templates<br/>[plux-templates.js]"]
end

subgraph group_trip_tools["Trip tools"]
  node_routing["Routes and maps"]
  node_budget["Budget and expenses"]
  node_vault["Voucher import"]
  node_export["Trip export"]
  node_assistant["Pluxy assistant<br/>[plux-pro.js]"]
  node_tools["Planner tools"]
  node_doodles["Travel doodles<br/>[plux-doodles.js]"]
  node_wrapped["Trip recap<br/>[plux-wrapped.js]"]
end

subgraph group_platform["Offline and localization"]
  node_local_data[("Browser trip data")]
  node_offline_support["Offline support<br/>[plux-offline.js]"]
  node_service_worker[("Offline cache<br/>[sw.js]")]
  node_localization["Localization<br/>[plux-i18n.js]"]
  node_language_catalog["Language catalog"]
end

subgraph group_community["Discovery and collaboration"]
  node_discover["Destination discovery<br/>[plux-discover.js]"]
  node_destination_guides["Destination guides<br/>[destiny_pluxy.js]"]
  node_collaboration["Trip collaboration<br/>[plux-collab.js]"]
  node_social_chat["Community chat"]
end

subgraph group_integrations["External services"]
  node_auth_sdk["Firebase Auth SDK"]
  node_realtime_sdk["Firebase Realtime SDK"]
  node_firestore_sdk["Firebase Firestore SDK"]
  node_firebase_service[("Firebase services")]
  node_ai_gateway["AI gateway"]
  node_traveler_services["Mapping and OCR services"]
end

node_traveler(("Traveler"))

node_traveler -->|"opens planner"| node_planner_ui
node_planner_ui -->|"organizes trips"| node_itinerary
node_itinerary -->|"saves locally"| node_local_data
node_itinerary -.->|"uses templates"| node_templates
node_itinerary -->|"plans routes"| node_routing
node_itinerary -->|"tracks expenses"| node_budget
node_itinerary -->|"imports vouchers"| node_vault
node_itinerary -->|"exports plans"| node_export
node_traveler -->|"explores destinations"| node_discover
node_traveler -.->|"views guides"| node_destination_guides
node_traveler -->|"requests advice"| node_assistant
node_assistant -->|"requests AI"| node_ai_gateway
node_traveler -->|"shares trips"| node_collaboration
node_collaboration -.->|"syncs optionally"| node_realtime_sdk
node_collaboration -.->|"syncs optionally"| node_firestore_sdk
node_traveler -.->|"joins community"| node_social_chat
node_itinerary -->|"supports offline use"| node_offline_support
node_offline_support -->|"uses caching"| node_service_worker
node_itinerary -->|"offers languages"| node_localization
node_localization -.->|"uses translations"| node_language_catalog
node_traveler -.->|"uses tools"| node_tools
node_traveler -.->|"uses doodles"| node_doodles
node_traveler -.->|"views recap"| node_wrapped
node_routing -->|"uses mapping"| node_traveler_services
node_vault -->|"uses OCR"| node_traveler_services
node_collaboration -->|"uses Firebase"| node_firebase_service
node_firebase_service -.->|"provides realtime"| node_realtime_sdk
node_firebase_service -.->|"provides storage"| node_firestore_sdk
node_firebase_service -.->|"provides authentication"| node_auth_sdk

click node_planner_ui "https://github.com/nibecar-cofeben/plux/blob/Public/index.html"
click node_itinerary "https://github.com/nibecar-cofeben/plux/blob/Public/script.js"
click node_templates "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-templates.js"
click node_routing "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-routing-map.js"
click node_budget "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-splitwise.js"
click node_vault "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-vault-ingest.js"
click node_export "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-export-cards.js"
click node_discover "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-discover.js"
click node_destination_guides "https://github.com/nibecar-cofeben/plux/blob/Public/destinies/destiny_pluxy.js"
click node_assistant "https://github.com/nibecar-cofeben/plux/blob/Public/plux-pro.js"
click node_collaboration "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-collab.js"
click node_social_chat "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-social-chat.js"
click node_local_data "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-offline-db.js"
click node_offline_support "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-offline.js"
click node_service_worker "https://github.com/nibecar-cofeben/plux/blob/Public/sw.js"
click node_localization "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-i18n.js"
click node_language_catalog "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-i18n-catalog.js"
click node_tools "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-herramientas.js"
click node_doodles "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-doodles.js"
click node_wrapped "https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-wrapped.js"
click node_auth_sdk "https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-auth-compat.js"
click node_realtime_sdk "https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-database-compat.js"
click node_firestore_sdk "https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-firestore-compat.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_planner_ui,node_itinerary,node_templates toneBlue
class node_routing,node_budget,node_vault,node_export,node_assistant,node_tools,node_doodles,node_wrapped toneAmber
class node_local_data,node_offline_support,node_service_worker,node_localization,node_language_catalog toneMint
class node_discover,node_destination_guides,node_collaboration,node_social_chat toneRose
class node_auth_sdk,node_realtime_sdk,node_firestore_sdk,node_firebase_service,node_ai_gateway,node_traveler_services,node_traveler toneIndigo
```

## Components

### Trip planning

- [Planner interface](https://github.com/nibecar-cofeben/plux/blob/Public/index.html): `index.html`
- [Itinerary organizer](https://github.com/nibecar-cofeben/plux/blob/Public/script.js): `script.js`
- [Trip templates](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-templates.js): `js/plux-templates.js`

### Trip tools

- [Routes and maps](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-routing-map.js): `js/plux-v71-routing-map.js`
- [Budget and expenses](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-splitwise.js): `js/plux-v71-splitwise.js`
- [Voucher import](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-vault-ingest.js): `js/plux-v71-vault-ingest.js`
- [Trip export](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-export-cards.js): `js/plux-export-cards.js`
- [Pluxy assistant](https://github.com/nibecar-cofeben/plux/blob/Public/plux-pro.js): `plux-pro.js`
- [Planner tools](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-herramientas.js): `js/plux-herramientas.js`
- [Travel doodles](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-doodles.js): `js/plux-doodles.js`
- [Trip recap](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-wrapped.js): `js/plux-wrapped.js`

### Offline and localization

- [Browser trip data](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-v71-offline-db.js): `js/plux-v71-offline-db.js`
- [Offline support](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-offline.js): `js/plux-offline.js`
- [Offline cache](https://github.com/nibecar-cofeben/plux/blob/Public/sw.js): `sw.js`
- [Localization](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-i18n.js): `js/plux-i18n.js`
- [Language catalog](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-i18n-catalog.js): `js/plux-i18n-catalog.js`

### Discovery and collaboration

- [Destination discovery](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-discover.js): `js/plux-discover.js`
- [Destination guides](https://github.com/nibecar-cofeben/plux/blob/Public/destinies/destiny_pluxy.js): `destinies/destiny_pluxy.js`
- [Trip collaboration](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-collab.js): `js/plux-collab.js`
- [Community chat](https://github.com/nibecar-cofeben/plux/blob/Public/js/plux-social-chat.js): `js/plux-social-chat.js`

### External services

- [Firebase Auth SDK](https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-auth-compat.js): `firebase/firebase-auth-compat.js`
- [Firebase Realtime SDK](https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-database-compat.js): `firebase/firebase-database-compat.js`
- [Firebase Firestore SDK](https://github.com/nibecar-cofeben/plux/blob/Public/firebase/firebase-firestore-compat.js): `firebase/firebase-firestore-compat.js`
- **Firebase services**
- **AI gateway**
- **Mapping and OCR services**

### Other components

- **Traveler**

## Connections

- Traveler → Planner interface: opens planner (evidence: `README.md`)
- Planner interface → Itinerary organizer: organizes trips (evidence: `README.md`)
- Itinerary organizer → Browser trip data: saves locally (evidence: `README.md`)
- Itinerary organizer → Trip templates: uses templates
- Itinerary organizer → Routes and maps: plans routes (evidence: `README.md`)
- Itinerary organizer → Budget and expenses: tracks expenses (evidence: `README.md`)
- Itinerary organizer → Voucher import: imports vouchers (evidence: `README.md`)
- Itinerary organizer → Trip export: exports plans (evidence: `README.md`)
- Traveler → Destination discovery: explores destinations (evidence: `README.md`)
- Traveler → Destination guides: views guides
- Traveler → Pluxy assistant: requests advice (evidence: `README.md`)
- Pluxy assistant → AI gateway: requests AI (evidence: `README.md`)
- Traveler → Trip collaboration: shares trips (evidence: `README.md`)
- Trip collaboration → Firebase Realtime SDK: syncs optionally (evidence: `README.md`)
- Trip collaboration → Firebase Firestore SDK: syncs optionally (evidence: `README.md`)
- Traveler → Community chat: joins community
- Itinerary organizer → Offline support: supports offline use (evidence: `README.md`)
- Offline support → Offline cache: uses caching (evidence: `README.md`)
- Itinerary organizer → Localization: offers languages (evidence: `README.md`)
- Localization → Language catalog: uses translations
- Traveler → Planner tools: uses tools
- Traveler → Travel doodles: uses doodles
- Traveler → Trip recap: views recap
- Routes and maps → Mapping and OCR services: uses mapping (evidence: `README.md`)
- Voucher import → Mapping and OCR services: uses OCR (evidence: `README.md`)
- Trip collaboration → Firebase services: uses Firebase (evidence: `README.md`)
- Firebase services → Firebase Realtime SDK: provides realtime
- Firebase services → Firebase Firestore SDK: provides storage
- Firebase services → Firebase Auth SDK: provides authentication
