# Quickstart

Install, scaffold a project, and serve a working endpoint in three commands.

You will install Zever, scaffold a project, and serve a working `GET /hello` endpoint. It takes about five minutes. You need Go 1.27+ and the `zever` CLI ([installation](https://zenta-dev.github.io/zever/start/installation/)).

```sh
curl -fsSL https://raw.githubusercontent.com/zenta-dev/zever/main/install.sh | sh
```

```sh
curl -fsSL https://raw.githubusercontent.com/zenta-dev/zever/main/install.sh | sh
```

```powershell
irm https://raw.githubusercontent.com/zenta-dev/zever/main/install.ps1 | iex
```

Then check it with `zever --version`.

## Scaffold the project

```sh
zever new hello
cd hello
```

`zever new` writes the minimal tree: `schema/app.zen`, `cmd/server/main.go`, `internal/app/wiring.go`, the sample `internal/service/hello` module, `.env`, `.env.example`, `.gitignore`, and a `README.md`. It also runs `go mod tidy`, so the project builds as-is.

Expected output (abridged):

```text
✔ scaffolded "hello" into hello
  wrote hello/internal/app/wiring.go
  wrote hello/cmd/server/main.go
  wrote hello/internal/service/hello/service.go
```

The battery picker adds more services: `zever new hello --with cache,queue=redis,auth` (or `--interactive` for the prompt). `--with` takes a comma-separated list of batteries with optional adapter pins. See [Customizing and leaving zever](https://zenta-dev.github.io/zever/start/extend/customizing-and-leaving/) for the "batteries you actually need" table with measured dependency footprints.

## Serve it

Run the watcher. It compiles, starts the server on `:8080`, and restarts on schema or source changes:

```sh
zever dev
```

```text
{"time":"...","level":"INFO","msg":"http server listening","addr":":8080"}
```

`zever serve` runs the same server without watching. In a second terminal, call the sample endpoint:

```sh
curl -i localhost:8080/hello
```

```text
HTTP/1.1 200 OK
Content-Type: application/json

{"hello":"world"}
```

The sample module registers `GET /hello` and resolves the logger from the container. `GET /healthz` always returns 200, and `GET /readyz` returns 200 once the database ping succeeds.

## What you built

`zever new` scaffolds a typed wiring file, not a config file. `internal/app/wiring.go` declares one `Ref` per service and one `container.Provide` entry per instance, and `cmd/server/main.go` hands those providers plus the modules to `serve.Main`. Adding a battery later is one command:

```sh
zever add cache/redis
zever add db --name analytics
```

## Next steps

- [Build a booking API](https://zenta-dev.github.io/zever/tutorials/build-a-booking-api/): A full service with auth, queue, and worker.
- [How Zever works](https://zenta-dev.github.io/zever/concepts/how-zever-works/): Schema, compiler, container, adapters in one page.
- [Project layout](https://zenta-dev.github.io/zever/start/project-layout/): Where every package lives.
- [CLI reference](https://zenta-dev.github.io/zever/reference/cli/): Every command and flag.
