Desktop app
Database issues
If you’re having issues with the desktop app’s database when running the dev server or installing, try following these steps and doing a clean pnpm install.
Structure
Simplified directory structure:
/electron- The “main” process, the backend of the app, with database and system functionality- /database
- /main
- /preload - Preload script for IPC
/src- the “renderer” process, this is our react frontend./components- In here you find all the components of OpenMarch, the sidebars, titlebar, dialogs, UI component primitives. All of them are in their subfolder./context- React Context for the app of some sort of state/value/global- Classes, objects and functions for various items in the app, such as Page, Marcher, MarcherShape, etc./stores- Global stores for certain items and actions, such as the list of Pages and MarchersApp.tsx- the main app file
Most of the directories like stores, context, and database also have a __test__ directory which are used for testing.
Running Tests
Unit tests
pnpm run testUnit tests with history
These tests simulate a handful of undo/redo operations after each test and assure the database is in the correct state with the right number of undo groups. While these tests run in CI, they disabled by default as they are quite slow. But you can run them like this:
cd apps/desktoppnpm run test:historyEnd-to-end (E2E) tests
cd apps/desktoppnpm run e2eGenerate your own E2E tests
This will launch Playwright’s code generation tool to help you out.
cd apps/desktoppnpm run e2e:codegenYou can follow the instructions in the E2E testing guide to write your own tests.