# ignis05/baro-save-editor architecture

> Architecture diagram of the GitHub repository ignis05/baro-save-editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ignis05/baro-save-editor
- Repository: https://github.com/ignis05/baro-save-editor

## Overview

1. **Overall shape**
   - This is a single-page Vue 3 application for editing **Barotrauma** save files and submarines.
   - It is explicitly **client-side only**: the browser performs all parsing, editing, compression/decompression, and export work. There is no backend service or database in the repo.

2. **Top-level navigation and screens**
   - The app is organized around routed views in `src/views`: **SaveTools**, **SubTools**, **Decompressor**, and **About**.
   - `src/router/index.js` maps those views into the SPA, so the main architectural boundary is between **route-level pages** and the feature components they compose.

3. **Feature areas**
   - The repository splits into two main product domains:
     - **Save editing**: campaign/save-related tools.
     - **Submarine editing**: submarine-related tools.
   - The `SaveTools` and `SubTools` views are the main workspaces for those domains, while `Decompressor` is a utility page for file transformation and `About` is informational.

4. **Component composition**
   - Most behavior lives in `src/components`, which are small feature-specific UI modules.
   - Save-side components include `FileDropper`, `CampaignSettings`, `CrewList`, `OwnedSubList`, `SaveDataBar`, `MiscSaveTools`, `ScriptRunner`, and `ShuttleExporter`.
   - Sub-side components include `SubDataBar`, `MiscSubTools`, `WireHider`, `AboutSubEditor`, and `AboutSaveEditor`.

5. **Data import/export flow**
   - The primary user flow is: **drop or load a file → parse it in-browser → modify structured data in UI controls → export or download the result**.
   - `FileDropper` is the likely entry point for local file ingestion.
   - `SaveDataBar` and `SubDataBar` appear to provide status and metadata for the currently loaded document, while export-oriented components handle emitting a modified file back to the user.

6. **Domain logic helpers**
   - Shared file-format logic is concentrated in `src/helpers`.
   - `CompressionHelpers.js` likely handles Barotrauma save/sub compression and decompression.
   - `fixOldSave.js` suggests backward-compatibility handling for older save formats.
   - This helper layer is the main non-UI boundary: it translates between raw file contents and the editable data structures used by the Vue components.

7. **Global state and cross-component coordination**
   - `src/store/index.js` indicates a centralized store for shared application state across the editing screens.
   - This is likely where the currently loaded save/sub data, derived metadata, and UI state are coordinated so different components can stay in sync.

8. **UI framework and shell**
   - The app uses **Vuetify** for its component library and styling, configured in `src/plugins/vuetify.js`.
   - `src/App.vue` is the shell that wraps routing, layout, and global UI chrome.
   - This means most screens are composed from standard Vuetify primitives plus the domain-specific editors.

9. **Static/public assets and documentation pages**
   - The `public` directory contains static HTML pages such as `404.html`, `About.html`, `Decompressor.html`, and `SubTools.html`, plus how-to guides under `public/howto`.
   - These act as deploy-time assets and user documentation rather than runtime application logic.
   - `robots.txt` and the 404 page suggest the app is intended for static hosting, likely on GitHub Pages.

10. **Build/runtime/tooling**
   - The repo is built with **Vite** (`vite.config.js`) and uses Node.js for local development and production builds.
   - `package.json`, ESLint, and Prettier define the developer workflow.
   - The readme and `deploy.sh` point to a static deployment model, with an online build and optional offline/PWA usage.

11. **Operational boundary**
   - Since everything runs in the browser, the key external dependency is the **user’s local file system** through file upload/drop and browser download APIs.
   - There is no evidence of remote API calls, authentication, or server-side persistence, which keeps the architecture self-contained and portable.

12. **What to draw in an architecture diagram**
   - A good diagram would show:
     - Browser SPA shell
     - Router-driven views
     - Two main editing domains: save tools and submarine tools
     - Shared helper layer for compression/format fixing
     - Central store for shared state
     - Static assets/docs served from `public`
   - The most important arrows are **file input → helper parsing/transformations → store/UI editing components → export/download**.

Main entry points: [`src/views/SaveTools.vue`](https://github.com/ignis05/baro-save-editor/blob/master/src/views/SaveTools.vue) (SaveTools), [`src/views/SubTools.vue`](https://github.com/ignis05/baro-save-editor/blob/master/src/views/SubTools.vue) (SubTools), [`src/router/index.js`](https://github.com/ignis05/baro-save-editor/blob/master/src/router/index.js) (Router), [`src/main.js`](https://github.com/ignis05/baro-save-editor/blob/master/src/main.js) (Main)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime shell"]
  node_main(("Main<br/>entry<br/>[main.js]"))
  node_app["Shell<br/>[App.vue]"]
  node_router["Router<br/>spa routes<br/>[index.js]"]
  node_vuetify["Vuetify<br/>ui plugin<br/>[vuetify.js]"]
end

subgraph group_save["Save editing"]
  node_saveview["SaveTools<br/>view<br/>[SaveTools.vue]"]
  node_savedata["SaveDataBar<br/>save status<br/>[SaveDataBar.vue]"]
  node_campaign["CampaignSettings<br/>save editor"]
  node_crew["CrewList<br/>save editor<br/>[CrewList.vue]"]
  node_owned["OwnedSubs<br/>save editor<br/>[OwnedSubList.vue]"]
  node_miscsave["Save Tools<br/>[MiscSaveTools.vue]"]
  node_script["ScriptRunner<br/>save action<br/>[ScriptRunner.vue]"]
  node_shuttle["ShuttleExporter"]
end

subgraph group_sub["Sub editing"]
  node_subview["SubTools<br/>view<br/>[SubTools.vue]"]
  node_subdata["SubDataBar<br/>sub status<br/>[SubDataBar.vue]"]
  node_miscsub["Sub Tools<br/>[MiscSubTools.vue]"]
  node_wirehider["WireHider<br/>sub editor<br/>[WireHider.vue]"]
end

subgraph group_shared["Shared logic"]
  node_store[("Store<br/>[index.js]")]
  node_decompview["Decompressor<br/>view<br/>[Decompressor.vue]"]
  node_dropper["FileDropper<br/>file ingest<br/>[FileDropper.vue]"]
  node_compression{{"Compression<br/>file format"}}
  node_compat{{"Old Save Fix<br/>compatibility<br/>[fixOldSave.js]"}}
end

subgraph group_docs["Static docs"]
  node_aboutview["About<br/>view<br/>[About.vue]"]
  node_aboutsub["Sub Editor Help<br/>help content<br/>[AboutSubEditor.vue]"]
  node_aboutsave["Save Editor Help<br/>help content"]
  node_publicdocs["Public pages<br/>static assets"]
end

node_main -->|"mounts"| node_app
node_main -->|"uses"| node_router
node_main -->|"shares state"| node_store
node_main -->|"configures"| node_vuetify
node_app -->|"hosts"| node_router
node_router -->|"routes to"| node_saveview
node_router -->|"routes to"| node_subview
node_router -->|"routes to"| node_decompview
node_router -->|"routes to"| node_aboutview
node_saveview -->|"ingests"| node_dropper
node_saveview -->|"shows"| node_savedata
node_saveview -->|"edits"| node_campaign
node_saveview -->|"edits"| node_crew
node_saveview -->|"edits"| node_owned
node_saveview -->|"tools"| node_miscsave
node_saveview -->|"runs"| node_script
node_saveview -->|"exports"| node_shuttle
node_subview -->|"ingests"| node_dropper
node_subview -->|"shows"| node_subdata
node_subview -->|"tools"| node_miscsub
node_subview -->|"edits"| node_wirehider
node_subview -->|"explains"| node_aboutsub
node_saveview -->|"explains"| node_aboutsave
node_dropper -->|"parses"| node_compression
node_decompview -->|"transforms"| node_compression
node_saveview -->|"normalizes"| node_compat
node_subview -->|"normalizes"| node_compat
node_store -->|"syncs"| node_saveview
node_store -->|"syncs"| node_subview
node_publicdocs -.->|"serves"| node_aboutview
node_publicdocs -.->|"serves"| node_decompview
node_publicdocs -.->|"serves"| node_subview

click node_main "https://github.com/ignis05/baro-save-editor/blob/master/src/main.js"
click node_app "https://github.com/ignis05/baro-save-editor/blob/master/src/App.vue"
click node_router "https://github.com/ignis05/baro-save-editor/blob/master/src/router/index.js"
click node_store "https://github.com/ignis05/baro-save-editor/blob/master/src/store/index.js"
click node_vuetify "https://github.com/ignis05/baro-save-editor/blob/master/src/plugins/vuetify.js"
click node_saveview "https://github.com/ignis05/baro-save-editor/blob/master/src/views/SaveTools.vue"
click node_subview "https://github.com/ignis05/baro-save-editor/blob/master/src/views/SubTools.vue"
click node_decompview "https://github.com/ignis05/baro-save-editor/blob/master/src/views/Decompressor.vue"
click node_aboutview "https://github.com/ignis05/baro-save-editor/blob/master/src/views/About.vue"
click node_dropper "https://github.com/ignis05/baro-save-editor/blob/master/src/components/FileDropper.vue"
click node_savedata "https://github.com/ignis05/baro-save-editor/blob/master/src/components/SaveDataBar.vue"
click node_campaign "https://github.com/ignis05/baro-save-editor/blob/master/src/components/CampaignSettings.vue"
click node_crew "https://github.com/ignis05/baro-save-editor/blob/master/src/components/CrewList.vue"
click node_owned "https://github.com/ignis05/baro-save-editor/blob/master/src/components/OwnedSubList.vue"
click node_miscsave "https://github.com/ignis05/baro-save-editor/blob/master/src/components/MiscSaveTools.vue"
click node_script "https://github.com/ignis05/baro-save-editor/blob/master/src/components/ScriptRunner.vue"
click node_shuttle "https://github.com/ignis05/baro-save-editor/blob/master/src/components/ShuttleExporter.vue"
click node_subdata "https://github.com/ignis05/baro-save-editor/blob/master/src/components/SubDataBar.vue"
click node_miscsub "https://github.com/ignis05/baro-save-editor/blob/master/src/components/MiscSubTools.vue"
click node_wirehider "https://github.com/ignis05/baro-save-editor/blob/master/src/components/WireHider.vue"
click node_aboutsub "https://github.com/ignis05/baro-save-editor/blob/master/src/components/AboutSubEditor.vue"
click node_aboutsave "https://github.com/ignis05/baro-save-editor/blob/master/src/components/AboutSaveEditor.vue"
click node_compression "https://github.com/ignis05/baro-save-editor/blob/master/src/helpers/CompressionHelpers.js"
click node_compat "https://github.com/ignis05/baro-save-editor/blob/master/src/helpers/fixOldSave.js"
click node_publicdocs "https://github.com/ignis05/baro-save-editor/tree/master/public"

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_main,node_app,node_router,node_vuetify toneBlue
class node_saveview,node_savedata,node_campaign,node_crew,node_owned,node_miscsave,node_script,node_shuttle toneAmber
class node_subview,node_subdata,node_miscsub,node_wirehider toneMint
class node_store,node_decompview,node_dropper,node_compression,node_compat toneRose
class node_aboutview,node_aboutsub,node_aboutsave,node_publicdocs toneIndigo
```

## Components

### Runtime shell

Client-side Vue SPA entry, routing, and shared app services.

- [Main](https://github.com/ignis05/baro-save-editor/blob/master/src/main.js): entry · Bootstraps the Vue app and global plugins. · `src/main.js`
- [Shell](https://github.com/ignis05/baro-save-editor/blob/master/src/App.vue): vue shell · Top-level app wrapper around routed content. · `src/App.vue`
- [Router](https://github.com/ignis05/baro-save-editor/blob/master/src/router/index.js): spa routes · Maps URL paths to the main tool views. · `src/router/index.js`
- [Vuetify](https://github.com/ignis05/baro-save-editor/blob/master/src/plugins/vuetify.js): ui plugin · Registers the component library and app styling. · `src/plugins/vuetify.js`

### Save editing

Campaign and save-file editing workspace.

- [SaveTools](https://github.com/ignis05/baro-save-editor/blob/master/src/views/SaveTools.vue): view · Workspace for campaign/save editing. · `src/views/SaveTools.vue`
- [SaveDataBar](https://github.com/ignis05/baro-save-editor/blob/master/src/components/SaveDataBar.vue): save status · Shows metadata and load state for the current save. · `src/components/SaveDataBar.vue`
- [CampaignSettings](https://github.com/ignis05/baro-save-editor/blob/master/src/components/CampaignSettings.vue): save editor · Edits campaign and save-game settings. · `src/components/CampaignSettings.vue`
- [CrewList](https://github.com/ignis05/baro-save-editor/blob/master/src/components/CrewList.vue): save editor · Edits crew-related save data. · `src/components/CrewList.vue`
- [OwnedSubs](https://github.com/ignis05/baro-save-editor/blob/master/src/components/OwnedSubList.vue): save editor · Edits owned submarine inventory and metadata. · `src/components/OwnedSubList.vue`
- [Save Tools](https://github.com/ignis05/baro-save-editor/blob/master/src/components/MiscSaveTools.vue): save tools · Miscellaneous save-side operations and helpers. · `src/components/MiscSaveTools.vue`
- [ScriptRunner](https://github.com/ignis05/baro-save-editor/blob/master/src/components/ScriptRunner.vue): save action · Runs scripted save transformations or automation. · `src/components/ScriptRunner.vue`
- [ShuttleExporter](https://github.com/ignis05/baro-save-editor/blob/master/src/components/ShuttleExporter.vue): export · Exports shuttle-related save content. · `src/components/ShuttleExporter.vue`

### Sub editing

Submarine editing workspace.

- [SubTools](https://github.com/ignis05/baro-save-editor/blob/master/src/views/SubTools.vue): view · Workspace for submarine editing. · `src/views/SubTools.vue`
- [SubDataBar](https://github.com/ignis05/baro-save-editor/blob/master/src/components/SubDataBar.vue): sub status · Shows metadata and load state for the current submarine. · `src/components/SubDataBar.vue`
- [Sub Tools](https://github.com/ignis05/baro-save-editor/blob/master/src/components/MiscSubTools.vue): sub tools · Miscellaneous submarine-side operations and helpers. · `src/components/MiscSubTools.vue`
- [WireHider](https://github.com/ignis05/baro-save-editor/blob/master/src/components/WireHider.vue): sub editor · Hides or adjusts submarine wiring details. · `src/components/WireHider.vue`

### Shared logic

Browser-side parsing, compression, and shared UI state.

- [Store](https://github.com/ignis05/baro-save-editor/blob/master/src/store/index.js): state store · Central shared state for loaded files and UI coordination. · `src/store/index.js`
- [Decompressor](https://github.com/ignis05/baro-save-editor/blob/master/src/views/Decompressor.vue): view · Utility page for file decompression and recompression. · `src/views/Decompressor.vue`
- [FileDropper](https://github.com/ignis05/baro-save-editor/blob/master/src/components/FileDropper.vue): file ingest · Entry point for loading local save or submarine files. · `src/components/FileDropper.vue`
- [Compression](https://github.com/ignis05/baro-save-editor/blob/master/src/helpers/CompressionHelpers.js): file format · Handles Barotrauma compression and decompression. · `src/helpers/CompressionHelpers.js`
- [Old Save Fix](https://github.com/ignis05/baro-save-editor/blob/master/src/helpers/fixOldSave.js): compatibility · Normalizes older save formats before editing. · `src/helpers/fixOldSave.js`

### Static docs

Deploy-time HTML pages and how-to content served from public/.

- [About](https://github.com/ignis05/baro-save-editor/blob/master/src/views/About.vue): view · Informational page for the editor. · `src/views/About.vue`
- [Sub Editor Help](https://github.com/ignis05/baro-save-editor/blob/master/src/components/AboutSubEditor.vue): help content · Explains submarine editing workflows. · `src/components/AboutSubEditor.vue`
- [Save Editor Help](https://github.com/ignis05/baro-save-editor/blob/master/src/components/AboutSaveEditor.vue): help content · Explains save editing workflows. · `src/components/AboutSaveEditor.vue`
- [Public pages](https://github.com/ignis05/baro-save-editor/tree/master/public): static assets · Deployed HTML pages and how-to documents under public/. · `public`

## Connections

- Main → Shell: mounts · Initializes the root Vue shell.
- Main → Router: uses · Installs route navigation.
- Main → Store: shares state · Provides centralized app state.
- Main → Vuetify: configures · Registers the UI framework.
- Shell → Router: hosts · Renders routed views inside the shell.
- Router → SaveTools: routes to · Main save-editing workspace.
- Router → SubTools: routes to · Main submarine-editing workspace.
- Router → Decompressor: routes to · File transformation utility page.
- Router → About: routes to · Informational page.
- SaveTools → FileDropper: ingests · Loads local save files into the editor.
- SaveTools → SaveDataBar: shows · Displays loaded save metadata.
- SaveTools → CampaignSettings: edits · Configures campaign settings.
- SaveTools → CrewList: edits · Manages crew data.
- SaveTools → OwnedSubs: edits · Manages owned submarines.
- SaveTools → Save Tools: tools · Miscellaneous save operations.
- SaveTools → ScriptRunner: runs · Executes scripted transformations.
- SaveTools → ShuttleExporter: exports · Produces shuttle-related output.
- SubTools → FileDropper: ingests · Loads local submarine files into the editor.
- SubTools → SubDataBar: shows · Displays loaded submarine metadata.
- SubTools → Sub Tools: tools · Miscellaneous submarine operations.
- SubTools → WireHider: edits · Adjusts wiring visibility or structure.
- SubTools → Sub Editor Help: explains · Links to submarine editor guidance.
- SaveTools → Save Editor Help: explains · Links to save editor guidance.
- FileDropper → Compression: parses · Decompresses and prepares uploaded files.
- Decompressor → Compression: transforms · Performs browser-side decompression/recompression.
- SaveTools → Old Save Fix: normalizes · Repairs older save formats before editing.
- SubTools → Old Save Fix: normalizes · Applies format compatibility handling where needed.
- Store → SaveTools: syncs · Shares current save state with the save workspace.
- Store → SubTools: syncs · Shares current submarine state with the sub workspace.
- Public pages → About: serves · Static deploy-time page for About content.
- Public pages → Decompressor: serves · Static deploy-time page for decompressor content.
- Public pages → SubTools: serves · Static deploy-time page for submarine tools.
