# wwwhat Documentation

Build server-rendered web apps with HTML. No JavaScript frameworks, no build steps, no boilerplate.

## What is wwwhat?

wwhat is a Rust-powered web framework where you write **HTML pages** instead of backend code. Variables use `#hash#` syntax, components are plain HTML files, and interactivity works through declarative attributes.

```
<h1>Hello, #user.name#!</h1>
<p>You have #session.notifications# new notifications.</p>

<button w-set="session.notifications = 0">Mark all read</button>
```

That's a complete interactive page. The session variable updates on click, and every element showing `#session.notifications#` updates automatically.

## How It Works

wwhat follows a simple model:

- **Pages** are HTML files in the `site/` directory. File paths become routes.
- **Variables** use `#name#` syntax. Session, user, environment, and fetched data are all available.
- **Components** are HTML files in `components/`. The file `card.html` becomes `<what-card>`.
- **Interactivity** uses `w-*` attributes: `w-get`, `w-set`, `w-modal-trigger`, etc.
- **Forms** handle CRUD operations with `w-action="create"` and server-side validation.
- **Data** comes from local collections, external APIs, or Cloudflare D1.

## Quick Example

A todo app in one file:

site/todos.html

```
<what>
auth: user
fetch.todos = "local:todos"
</what>

<h1>My Todos</h1>

<form w-action="create" w-store="todos" w-validate>
  <input name="title" w-required placeholder="What needs doing?">
  <button type="submit">Add</button>
</form>

<loop data="#todos#" as="todo">
  <div class="flex items-center gap-3">
    <span>#todo.title#</span>
    <form w-action="delete" w-store="todos" w-id="#todo.id#">
      <button type="submit" w-confirm="Delete this todo?">Delete</button>
    </form>
  </div>
</loop>
```

This gives you: authentication, form validation, CRUD operations, data fetching, and confirmation dialogs — all from HTML.

## Philosophy

- **HTML is enough.** If you know HTML and CSS, you can build full-stack web apps.
- **Zero JavaScript by default.** All interactivity is declarative. Write JS only when you want to.
- **Convention over configuration.** File-based routing, auto-discovered components, sensible defaults.
- **Progressive complexity.** Start with a static page, add session state, then forms, then databases — one concept at a time.

## Next Steps

Start with [Getting Started](/content/docs/getting-started/index.html) to install wwwhat and create your first project.
