Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/przucidlo/electron-typescript-react-typeorm-sqlite-boilerplate
A boilerplate for creating projects that want to use typeorm with sqlite3 inside electron.
https://github.com/przucidlo/electron-typescript-react-typeorm-sqlite-boilerplate
babel electron electron-builder hot-module-replacement hot-reload react react-hooks react-hot-loader typeorm typescript typescript-boilerplate webpack
Last synced: 3 months ago
JSON representation
A boilerplate for creating projects that want to use typeorm with sqlite3 inside electron.
- Host: GitHub
- URL: https://github.com/przucidlo/electron-typescript-react-typeorm-sqlite-boilerplate
- Owner: przucidlo
- Created: 2020-04-02T16:32:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T16:39:37.000Z (about 2 years ago)
- Last Synced: 2024-11-01T07:40:43.230Z (3 months ago)
- Topics: babel, electron, electron-builder, hot-module-replacement, hot-reload, react, react-hooks, react-hot-loader, typeorm, typescript, typescript-boilerplate, webpack
- Language: JavaScript
- Homepage:
- Size: 1.15 MB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
### Stack contains:
- Typescript
- Electron
- React
- TypeORM
- SQLite3
- Webpack
- Babel#### This stack comes with few limitations due to bug(?) in webpack which causes usage of TypeORM on renderer process to be almost impossible.([#4210](https://github.com/typeorm/typeorm/issues/4210))
---
The main idea of this stack is to use TypeORM on main process and communicate with renderer process by usage of remote/ipc calls.
# Compatibility table
| OS | Status |
| ------- | ------------------ |
| Windows | ✔️ |
| Linux | :heavy_check_mark: |
| Mac | :heavy_check_mark: |# Installation
1. Clone this repository
2. Remove .gitignore
3. Call npm install to download required dependencies.
4. Have fun :)# Usage
npm start
Starts your app in development mode using the same terminal for electron and webpack-dev-server
npm build
Bundles your app using production config.
npm run build:dev
Bundles your app using development config.
npm run package
Packages your app using electron-builder (config can be found in ./electron-builder.json)
npm run start:dev
Starts webpack-dev-server.
npm run start:electron
Starts electron instance in development mode.
# Troubleshooting
> - Webpack-dev-server doesn't notice any changes I make to code.
> - React-hot-loader doesn't work.Make sure that you have enough
[watchers](https://webpack.js.org/configuration/watch/#not-enough-watchers).> - Webpack warns about not being able to find database drivers in console.
TypeORM has conditional dependencies on other databases (mysql, mssql...) and webpack has no idea which one are needed and tries to load all of them and warnings pop out.
# TODO
- Improve the sample code.
- Setup tests.