diff --git a/docs/presentation.md b/docs/presentation.md index 9c984b63..8b023696 100644 --- a/docs/presentation.md +++ b/docs/presentation.md @@ -4,6 +4,20 @@ - Desktop application is created using [Electron](https://www.electronjs.org/). - Event driven as in components simply listens to events from the state and act accordingly. +## Structure + +- [`/src/` **`presentation/`**](./../src/presentation/): Contains all presentation related code including Vue and Electron configurations + - [**`bootstrapping/`**](./../src/presentation/bootstrapping/): Registers Vue global objects including components and plugins. + - [**`components/`**](./../src/presentation/components/): Contains all Vue components and their helper classes. + - [**`Shared/`**](./../src/presentation/components/Shared): Contains Vue components and component helpers that are shared across other components. + - [**`styles/`**](./../src/presentation/styles/): Contains shared styles used throughout different components. + - [**`main.ts`**](./../src/presentation/main.ts): Application entry point that mounts and starts Vue application. + - [**`background.ts`**](./../src/presentation/background.ts): Main process of Electron, started as first thing when app starts. +- [**`/public/`**](./../public/): Contains static assets that will simply be copied and not go through webpack. +- [**`/vue.config.js`**](./../vue.config.js): Global Vue CLI configurations loaded by `@vue/cli-service` +- [**`/postcss.config.js`**](./../postcss.config.js): PostCSS configurations that are used by Vue CLI internally +- [**`/babel.config.js`**](./../babel.config.js): Babel configurations for polyfills used by `@vue/cli-plugin-babel` + ## Application data - Components and should use [ApplicationFactory](./../src/application/ApplicationFactory.ts) singleton to reach the application domain. @@ -16,9 +30,9 @@ - Stateful components mutate or/and react to state changes in [ApplicationContext](./../src/application/Context/ApplicationContext.ts). - Stateless components that does not handle state extends `Vue` -- Stateful components that depends on the collection state such as user selection, search queries and more extends [`StatefulVue`](./../src/presentation/StatefulVue.ts) -- The single source of truth is a singleton of the state created and made available to presentation layer by [`StatefulVue`](./../src/presentation/StatefulVue.ts) +- Stateful components that depends on the collection state such as user selection, search queries and more extends [`StatefulVue`](./../src/presentation/components/Shared/StatefulVue.ts) +- The single source of truth is a singleton of the state created and made available to presentation layer by [`StatefulVue`](./../src/presentation/components/Shared/StatefulVue.ts) - `StatefulVue` includes abstract `handleCollectionState` that is fired once the component is loaded and also each time [collection](./collection-files.md) is changed. - Do not forget to subscribe from events when component is destroyed or if needed [collection](./collection-files.md) is changed. - - 💡 `events` in base class [`StatefulVue`](./../src/presentation/StatefulVue.ts) makes lifecycling easier + - 💡 `events` in base class [`StatefulVue`](./../src/presentation/components/Shared/StatefulVue.ts) makes lifecycling easier - 📖 See [Application state | Application layer](./presentation.md#application-state) where the state is implemented using using state pattern. diff --git a/src/background.ts b/src/presentation/background.ts similarity index 94% rename from src/background.ts rename to src/presentation/background.ts index cb542cfc..3625bdfa 100644 --- a/src/background.ts +++ b/src/presentation/background.ts @@ -1,5 +1,9 @@ 'use strict'; +// This is main process of Electron, started as first thing when app starts. +// This script is running through entire life of the application. +// It doesn't have any windows which you can see on screen, opens the main window from here. + import { app, protocol, BrowserWindow, shell } from 'electron'; import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'; import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'; diff --git a/src/presentation/Bootstrapping/ApplicationBootstrapper.ts b/src/presentation/bootstrapping/ApplicationBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/ApplicationBootstrapper.ts rename to src/presentation/bootstrapping/ApplicationBootstrapper.ts diff --git a/src/presentation/Bootstrapping/IVueBootstrapper.ts b/src/presentation/bootstrapping/IVueBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/IVueBootstrapper.ts rename to src/presentation/bootstrapping/IVueBootstrapper.ts diff --git a/src/presentation/Bootstrapping/Modules/IconBootstrapper.ts b/src/presentation/bootstrapping/Modules/IconBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/Modules/IconBootstrapper.ts rename to src/presentation/bootstrapping/Modules/IconBootstrapper.ts diff --git a/src/presentation/Bootstrapping/Modules/TooltipBootstrapper.ts b/src/presentation/bootstrapping/Modules/TooltipBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/Modules/TooltipBootstrapper.ts rename to src/presentation/bootstrapping/Modules/TooltipBootstrapper.ts diff --git a/src/presentation/Bootstrapping/Modules/TreeBootstrapper.ts b/src/presentation/bootstrapping/Modules/TreeBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/Modules/TreeBootstrapper.ts rename to src/presentation/bootstrapping/Modules/TreeBootstrapper.ts diff --git a/src/presentation/Bootstrapping/Modules/VModalBootstrapper.ts b/src/presentation/bootstrapping/Modules/VModalBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/Modules/VModalBootstrapper.ts rename to src/presentation/bootstrapping/Modules/VModalBootstrapper.ts diff --git a/src/presentation/Bootstrapping/Modules/VueBootstrapper.ts b/src/presentation/bootstrapping/Modules/VueBootstrapper.ts similarity index 100% rename from src/presentation/Bootstrapping/Modules/VueBootstrapper.ts rename to src/presentation/bootstrapping/Modules/VueBootstrapper.ts diff --git a/src/App.vue b/src/presentation/components/App.vue similarity index 76% rename from src/App.vue rename to src/presentation/components/App.vue index 7a923939..a0cd601a 100644 --- a/src/App.vue +++ b/src/presentation/components/App.vue @@ -12,11 +12,11 @@