How ignis05/baro-save-editor works
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: SaveTools.vue SaveTools · SubTools.vue SubTools · index.js Router · main.js Main
Components 25
Runtime shell
Client-side Vue SPA entry, routing, and shared app services.
Save editing
Campaign and save-file editing workspace.
- SaveTools · Workspace for campaign/save editing.
src/views/SaveTools.vue - SaveDataBar · Shows metadata and load state for the current save.
src/components/SaveDataBar.vue - CampaignSettings · Edits campaign and save-game settings.
src/components/CampaignSettings.vue - CrewList · Edits crew-related save data.
src/components/CrewList.vue - OwnedSubs · Edits owned submarine inventory and metadata.
src/components/OwnedSubList.vue - Save Tools · Miscellaneous save-side operations and helpers.
src/components/MiscSaveTools.vue - ScriptRunner · Runs scripted save transformations or automation.
src/components/ScriptRunner.vue - ShuttleExporter · Exports shuttle-related save content.
src/components/ShuttleExporter.vue
Sub editing
Submarine editing workspace.
- SubTools · Workspace for submarine editing.
src/views/SubTools.vue - SubDataBar · Shows metadata and load state for the current submarine.
src/components/SubDataBar.vue - Sub Tools · Miscellaneous submarine-side operations and helpers.
src/components/MiscSubTools.vue - WireHider · Hides or adjusts submarine wiring details.
src/components/WireHider.vue
Shared logic
Browser-side parsing, compression, and shared UI state.
- Store · Central shared state for loaded files and UI coordination.
src/store/index.js - Decompressor · Utility page for file decompression and recompression.
src/views/Decompressor.vue - FileDropper · Entry point for loading local save or submarine files.
src/components/FileDropper.vue - Compression · Handles Barotrauma compression and decompression.
src/helpers/CompressionHelpers.js - Old Save Fix · Normalizes older save formats before editing.
src/helpers/fixOldSave.js
Static docs
Deploy-time HTML pages and how-to content served from public/.
- About · Informational page for the editor.
src/views/About.vue - Sub Editor Help · Explains submarine editing workflows.
src/components/AboutSubEditor.vue - Save Editor Help · Explains save editing workflows.
src/components/AboutSaveEditor.vue - Public pages · Deployed HTML pages and how-to documents under public/.
public
Connections 32
- 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.