I built a React app generator.
Tags: react, news, productivity, javascript
Published: 2021-06-17 15:39:56

I am proud to announce I finally built my first desktop application. And even if I can't consider it to be in a production-ready state for now, it is usable and I was really looking forward to sharing this work and see if it can interest some react developers.
&nbsp;
### What is this ?

The application is called [reactirator](https://github.com/Leopold-V/Reactirator).
It is a desktop application built with Electron using TypeScript, React and Node. The objective is to provide a simple GUI to create a React.js application with any configs and packages you need. So you can focus on the code as fast as possible.

![screen](https://camo.githubusercontent.com/22a7e8de38773f64d257d0afb8d62d0073d5cdf102f0080c4a7bc71115045895/68747470733a2f2f692e6779617a6f2e636f6d2f33336235636638336364623964613064643934646533386363373530363331622e706e67)
*Updated screen of the current application state 20/01/2022*
&nbsp;

## Motivation

Some months ago I did learn about how to build my own boilerplate and install them like create-react-app does.
I made an article about [this](https://dev.to/leopold/generate-your-web-app-boilerplate-like-create-react-app-does-301p).

Build and use boilerplates according to your needs is cool but it can lead to a lot of project maintenances and efforts. Often you also have differents requirements than in your previous project so you will be looking for another boilerplate or make your own again and ending up with a ton of different boilerplate to maintain... or just come back to a very generic one like create-react-app if you're bored !

So I went a bit further to find a more optimal solution for my need and this is why I started to build this. It does generate a react app on top of create-react-app so you get all the advantages of CRA but where you can also chose your config and packages then push the create button like you would command a pizza.
&nbsp;
### Techs corner

As a javascript developer, I definitely enjoy working with electron, everything is full javascript and so you can build beautiful desktop app even if you are a frontend developer.

**I encounter some technical difficulties though :**
- I haven't found another way to gather the npm package size data but to use the [npm registry](https://registry.npmjs.org/), problem with that is : it can't be fetched (cors issues) and so I have to use the old [request](https://www.npmjs.com/package/request) module !
- A few packages installations such as tailwind require quite a lot of configuration to do on a CRA app : [have a look here](https://tailwindcss.com/docs/guides/create-react-app), at this time I haven't found another way than to "hardcode" some packages version (for example, tailwind requires postcss 7, autoprefixer 9 etc.) to have it installed which is definitely not ideal for maintenance reasons.

If you have any idea, those are listed in the [issues list in github](https://github.com/Leopold-V/Reactirator/issues).

In the long run the project goal is to extend the possible customizations providing you more control over the generation and more advantages to use this project (for example, custom script command in the package json file etc.).

Alright, Thanks a lot for reading ! I am glad to share Reactirator and if anyone want to contribute don't hesitate, whether you are a total beginner or not.

https://github.com/Leopold-V/Reactirator

Have a good day.