# Installation

## Installation Guide

**Skill level:** Beginner · **Time:** 10 minutes

You need **Node.js** (the program that runs the theme) and a **code editor** to open the files. If Node.js is not installed yet, follow the [Node.js steps for Windows, macOS, and Linux](/common-guide/getting-started/installation/) in the common guide, then come back here.

### Requirements
- **Node.js 22.12.0 or later** (declared in `package.json` under `engines`)
- **npm**, which comes with Node.js. Consultiz ships a `package-lock.json`, so use npm rather than Yarn or pnpm
- A code editor. [VS Code](https://code.visualstudio.com/) is a good free choice; Consultiz recommends extensions for it in `.vscode/extensions.json`

Check your version in a terminal:

```bash
node -v
```

The result must be `v22.12.0` or higher.

### Run Consultiz On Your Computer
<Steps>

1. Unzip the download. The theme is the `consultiz/` folder, an Astro project. Move it to wherever you keep your projects, then open it in your code editor. It is the folder that contains `package.json` and `README.md`.

2. Open a terminal **inside that folder**. In VS Code, use **Terminal → New Terminal**.

3. Install the dependencies (only needed once, and again after updates):

   ```bash
   npm ci
   ```

   `npm ci` installs the exact versions listed in `package-lock.json`. `npm install` works too.

4. Start the development server:

   ```bash
   npm run dev
   ```

5. Open the local address printed in the terminal, usually [http://localhost:4321/](http://localhost:4321/).

</Steps>

Leave the terminal running while you work. When you save a file, the browser updates on its own. Press <kbd>Ctrl</kbd> + <kbd>C</kbd> in the terminal to stop the server.

`npm run dev` first converts `src/config/config.toml` into `.astro/config.generated.json`, then watches the TOML file for changes. If the TOML has a syntax error, the terminal shows its line; fix it and save again.

### Build And Preview The Production Site
```bash
npm run build
npm run preview
```

`npm run build` writes the finished site to the `dist/` folder. `npm run preview` builds it again and serves it locally, so you can test it exactly as visitors will see it. Drafts are not built.

Until you set `site.baseUrl` in `config.toml`, the build ends with a yellow `[site]` warning: there is no sitemap, and canonical links, RSS feeds, and `llms.txt` point to the build host. That is expected on your computer; set the address before you deploy ([Quick Start](/consultiz/getting-started/quick-start/), step 1).

### Every Script, In Plain Words
| Command                                 | What it does                                                                                       |
| --------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `npm run dev`                           | Starts the local site with live reload                                                             |
| `npm run build`                         | Builds the production site into `dist/` and removes drafts from the sitemap. Warns while `site.baseUrl` is empty |
| `npm run preview`                       | Builds, then serves the production site locally                                                    |
| `npm run astro-check`                   | Checks components and content files against their schemas. Run it after you edit content or code  |
| `npm run verify`                        | Runs everything the theme checks: config generation, `astro-check`, tests, formatting, the production build, and route and section checks |
| `npm run test`                          | Runs the theme's unit tests                                                                        |
| `npm run format`                        | Tidies the formatting of files in `src/`                                                           |
| `npm run format:check`                  | Reports files in `src/` that `npm run format` would change                                         |
| `npm run generate-favicons`             | Creates every favicon size from `[site.favicon] image` in `config.toml`                            |
| `npm run remove-multilingual`           | Deletes every language except the default one. Read [Internationalization](/consultiz/customization/internationalization/) first |
| `npm run generate-multilingual-content` | Copies the English content over the French files. Read [Internationalization](/consultiz/customization/internationalization/) before you use it |
| `npm run deploy:cf`                     | Uploads `dist/` to Cloudflare Pages. Needs Wrangler installed first (see [Deployment](/consultiz/deployment/)) |
| `npm run toml:watch`                    | Converts `config.toml` into `.astro/config.generated.json`. `dev` and `build` already run it      |

<Aside type="note" title="Formatting and npm run verify">
  `npm run verify` also checks formatting with Prettier. If it stops at the
  formatting step after you edited content, run `npm run format` (or
  `npx prettier --write path/to/file`) and run it again.
</Aside>

Next: [Quick Start](/consultiz/getting-started/quick-start/), to make the site yours.