# System requirements

Prepare Conduit for local development, start its development server, and adjust the local
port or API address when needed. The project uses Create React App. Use these steps for local
work; handle deployment separately.

## System requirements

Choose the local task you need to complete.

| If you need to… | Go to |
|---|---|
| Prepare the project before starting it | [Before you start](#before-you-start) |
| Start the local development server | [Run the application locally](#run-the-application-locally) |
| Change the local port or API address | [Configure local runtime settings](#configure-local-runtime-settings) |
| Review setup problems | [When local setup does not work](#when-local-setup-does-not-work) |
| Create a production bundle | [Next steps](#next-steps) |
| Find related application references | [Getting help](doc:getting-help) |

## Before you start

Have a local copy of the repository before you run the setup commands. Use `npm install` to
install dependencies and `npm start` to start the local server.

| Have or know | Why it matters |
|---|---|
| A local copy of the repository | The setup commands run from the project. |
| The `npm install` command | It installs the project's required dependencies. |
| The `npm start` command | It starts the local development server. |

When these items are ready, continue to [Run the application locally](#run-the-application-locally).

## Run the application locally

Use this procedure when you want to start the Conduit development server on your computer.

**Prerequisites**

- You have a local copy of the repository.

**Steps**

1. Open a terminal in the project folder.
2. Enter `npm install` in the terminal and press Enter.
3. Run `npm start`.

The start command uses port `4100` rather than React's standard port `3000`.

**Result:** The local development server starts on port `4100`.

To change the port or API address, continue to [Configure local runtime settings](#configure-local-runtime-settings).

## Configure local runtime settings

Use the local settings when the default port or API address does not match your setup.

**Prerequisites**

- You have a local copy of the repository.

**Steps**

1. Choose the setting you need:

   | If you need to… | Change… |
   |---|---|
   | Use a different local web-server port | Set `PORT` in a root `.env` file. |
   | Use a different API server | Change the API URL in the project configuration file. |

The API server is `https://conduit.productionready.io/api`.

**Result:** The local configuration contains the port or API address you selected.

If startup still does not work, review [When local setup does not work](#when-local-setup-does-not-work).

## When local setup does not work

Local setup has three relevant areas: dependencies, the local server, and the API
connection.

| Area | Relevant setting |
|---|---|
| Dependencies | `npm install` installs dependencies. |
| Local server | `npm start` starts the local server. |
| API connection | The API address is in the project configuration file. |

After reviewing the relevant setting, return to [Run the application locally](#run-the-application-locally).

## Next steps

After local setup, create a production bundle with `npm run build`. For the API
specification and other related application references, continue to [Getting help](doc:getting-help).
