## Setting Up a Desktop App Environment with Electron and React

Electron is a powerful framework for building desktop applications with HTML, CSS, and JavaScript. This article explains in detail how to set up an environment for an Electron + React application on Windows. Follow the steps below to get your project started.

### 1. Prerequisites

First, make sure Node.js is installed. Node.js is the runtime environment required to build Electron applications. If you haven't installed it yet, download and install the latest version from the [official Node.js website](https://nodejs.org/).

### 2. Proxy Configuration for Accessing npm

If you're behind a proxy server, you need to configure npm correctly. Use the following commands to set up npm's proxy configuration.

```powershell
npm config set strict-ssl false
npm config registry "http://registry.npmjs.org"
npm config set proxy "利用しているProxyのURL"
npm config set https-proxy "利用しているProxyのURL"
```

This allows npm to download the required packages through the proxy.

### 3. Cloning electron-react-boilerplate

Next, clone `electron-react-boilerplate` from GitHub to start the project. Use the following command.

```powershell
git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate your-project-name
```

Here, `your-project-name` is where you specify the project name. Change it to an appropriate project name.

### 4. Installing the Required Packages

Move into the project folder and install the required packages. Follow the steps below.

1. Open PowerShell and move into the project folder.

```powershell
cd your-project-name
```

2. Setting Environment Variables

You need to set environment variables to install Electron. Use the following commands to set them.

```powershell
$env:ELECTRON_GET_USE_PROXY = 1
$env:GLOBAL_AGENT_HTTPS_PROXY = "利用しているProxyのURL"
```

3. Installing the Packages

Finally, run the following command to install the required packages.

```powershell
npm install
```

Your Electron + React desktop application project is now set up. The required libraries and dependencies are resolved, and you can start development.

### References

- [Let's build a desktop app with Electron + React!](https://qiita.com/udayaan/items/2a7c8fd0771d4d995b69)
- [A hidden pitfall when installing Electron behind a proxy](https://qiita.com/LuckyRetriever/items/2f377b1ce34f7d12903c)

This guide should help you get an Electron + React project started smoothly.  
Go ahead and continue development to build your desktop app.
