This is a boilerplate project that allows you to build an electron app through turborepo.
This project uses NestJS as the main process. NestJS is a great framework for building server-side applications with TypeScript. It has a great dependency injection system and a great module system that allows you to easily build a modular application. so now you will not get headache with writing code for main process logics and managing its lifecycle anymore.
Have you ever written code for IPC between the main process and the renderer process? if so, you may have experienced problems such as lack of type safety, and testability. since there is literally no way to ensure that the arguments and return values of the IPC commands are correct.
so this project uses GraphQL for IPC between the main process and the renderer process. with this approach, you can easily call a command from the renderer process to the main process with strongly typed arguments and return values.
and this project will not expose the GraphQL server to the outside world. it will only be used for IPC between the main
process and the renderer process. this can achieve the same level of security as IPC using ipcRenderer
and ipcMain
.
├── apps
│ ├── electron # <- this will package and build, and run the electron app
│ ├── main # <- electron main process source codes
│ └── renderer # <- renderer web app source codes
├── packages
│ ├── eslint-config-custom # <- shared eslint config
│ ├── tsconfig # <- shared tsconfig
│ ├── types # <- common types for the whole project
│ └── ui # <- shared ui components