The main application is in its own vue flow: after the packages are compiled, the context is started (better-write-app s/main.ts) with the plugins (from the vue itself and the native plugin initialization) and the route is created that must be called.
Editor launcher, unlike the application launcher, creates global listeners that other application tools can adapt the results (shortcuts, for example).
destroy() is always called when the vue hook called onBeforeUnmound() is called.
Below are listed some specific solutions for the application flow:
Each and every flow passes through the reactive stores. This dynamic allows the immediate response of actions (except the loading of projects) and the independence of a possible back-end.
├── src/store
├──── absolute.ts # Window's Controller
├──── addons.ts # Internal Tools
├──── auth.ts # Auth (Supabase)
├──── context.ts # Loaded Chapter
├──── docx.ts # DOCX Configuration
├──── editor.ts # Customization Settings
├──── externals.ts # External Tools
├──── global.ts # Global Controller
├──── history.ts # Redo-Undo AST Controller
├──── pdf.ts # PDF Configuration
├──── project.ts # Loaded Project
├──── tutorial.ts # Tutorial Settings
├──── vault.ts # Vault (Void) Documents and StateAlways what is being mutable and is part of the main editor will be loaded in the Context while Project will only update in specific cases (for better performance in large amounts of rendered blocks).
This store controls all interfaces that are not their own route and are attached to the edit route. So it is possible to load resources without having to destroy and reload the project at all costs.
Better Write stopped using Electron (since v0.9.0-beta.6) for the PWA approach. Because of the proposal to have an application that is web, desktop and mobile, PWA can supply all three types of platforms with the same code.
The service worker file is named
sw.jsand caches allpublicfiles. If in doubt, refer to thevite.config.tsfile inbetter-write-app
Due to the need to use some packages that are server-side by default (like zip.js), support for native nodejs functions was implemented. You can find the script by clicking here.
The application uses only static files to provide Offline First at all costs.



