When creating a new Electron project, the most important part is to decide on the stack and tooling to use. For this project, we are going to use the React view library, as well as the popular create-react-app tool, which allows you to generate a full-fledged application structure in a matter of seconds.
Let's generate a new application called ebook-generator:
- Run the following code to generate a new React application:
npx create-react-app ebook-generator
The output should be similar to the following:
Compiled successfully!
You can now view ebook-generator in the browser.
Local: http://localhost:3000/
On Your Network: http://192.168.0.10:3000/
Note that the development build is not optimized.
To create a production build, use yarn build.
- Switch to the project folder and run the project using the following command:
cd ebook-generator
npm start
- If you navigate to http://localhost:3000, you should see the following as a result:
Now, let's install the Monaco Editor component and integrate it with our React application for Electron.