# Getting Started

Install wwwhat, create a project, and have a working page in under two minutes.

## Requirements

- **Rust 1.70+** — Install from [rustup.rs](https://rustup.rs/) if you don't have it
- **Cargo** — Ships with Rust automatically

Verify your setup:

```
rustc --version   # 1.70.0 or newer
cargo --version
```

## Installation

Install the wwwhat CLI from crates.io:

```
cargo install run-what
```

This gives you the `run-what` command globally. Confirm it worked:

```
run-what --version
```

## Create a Project

Scaffold a new project with the built-in wizard:

```
run-what new my-app
```

You'll be asked to choose a template:

| Template | Description |
| --- | --- |
| `example` | A guided project with a welcome page, components, and a 10-step tutorial. Recommended for first-time users. |
| `minimum` | A minimal app with `site/`, `static/`, `data/`, and one page. Start from scratch. |

**Tip:** Start with `example` if this is your first project. Use `run-what new my-app --template minimum` when you want the smallest possible scaffold.

## Start the Dev Server

Navigate into your project and start the development server:

```
cd my-app
run-what dev
```

Open [http://127.0.0.1:8085](http://127.0.0.1:8085/) in your browser. The server watches your files and automatically reloads when you make changes.

You can specify a different port if needed:

```
run-what dev --port 3000
```

## Your First Page

Pages live in the `site/` directory. Create a new file:

site/hello.html

```
<h1>Hello, world!</h1>
<p>This is my first wwwhat page.</p>
```

Visit [http://127.0.0.1:8085/hello](http://127.0.0.1:8085/hello) and you'll see it rendered with your project's layout. That's it — no imports, no configuration, no routing setup. The file path **is** the route.

**Tip:** If your project has a layout defined in `application.what`, every page in that directory inherits it automatically. Add `layout: none` in a page's `<what>` block to opt out.

## Adding Interactivity

Let's make the page interactive with a session-backed counter. No JavaScript required.

site/hello.html

```
<h1>Hello, world!</h1>
<p>You've visited this page #session.visits# times.</p>

<button w-set="session.visits += 1">Count visit</button>
<button w-set="session.visits = 0">Reset</button>
```

Here's what's happening:

- `#session.visits#` renders the current value of the session variable. It starts empty.
- `w-set="session.visits += 1"` increments the value on click via a server round-trip.
- Every element displaying `#session.visits#` updates automatically — no manual wiring needed.

Session variables persist across page loads for each user. They're stored server-side, so they survive browser refreshes and work across multiple tabs.

**Note:** Session variables start as empty strings. Using `+= 1` on an empty value initializes it to `1`. You don't need to set a default.

## Next Steps

You now have a working project with a live dev server and an interactive page. From here:

- Learn how [Project Structure](/content/docs/project-structure/index.html) maps files to routes and features
- Explore [Variables & Filters](/content/docs/templates/index.html) to render dynamic content
- Build reusable UI with [Components](/content/docs/components/index.html)
