# Zucms

## Quick Start

> Category: Getting Started

---

## Pages

- [Introduction](https://docs.zucms.co/introduction)

### API

- [RESTful API](https://docs.zucms.co/api/rest)
- [Typescript SDK](https://docs.zucms.co/api/typescript)

### Getting Started

- [Quick Start](https://docs.zucms.co/getting-started/quick-start)
- [Core Concepts](https://docs.zucms.co/getting-started/core-concepts)

### Models

- [Overview](https://docs.zucms.co/models/overview)
- [Field Types](https://docs.zucms.co/models/field-types)
- [Relations](https://docs.zucms.co/models/relations)

### Content

- [Working with Entries](https://docs.zucms.co/content/working-with-entries)
- [Localization](https://docs.zucms.co/content/localization)

### Access & Security

- [Roles](https://docs.zucms.co/access-security/roles)
- [Access Policies](https://docs.zucms.co/access-security/access-policies)

### Organization

- [Members & Roles](https://docs.zucms.co/organization/members-roles)
- [Audit Log](https://docs.zucms.co/organization/audit-log)
- [Billing & Plans](https://docs.zucms.co/organization/billing-plans)

---

# Quick Start

This guide gets you from zero to a running Zucms instance with your first model and entries.

## 1. Install dependencies

```bash
pnpm install
```

## 2. Configure environment variables

Copy the example file and fill in your values.

```bash
cp .env.example .env
```

Key variables:

| Variable | Description |
|---|---|
| `DATABASE_URL` | PostgreSQL connection string |
| `MONGODB_URI` | MongoDB connection string |
| `REDIS_URL` | Redis connection string |
| `BETTER_AUTH_SECRET` | Random secret for session signing |
| `BUNNY_API_KEY` | BunnyCDN API key for file storage |
| `STRIPE_SECRET_KEY` | Stripe secret key for billing |

## 3. Run database migrations

```bash
pnpm migrate:deploy
```

## 4. Start the development server

```bash
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000). You will be redirected to the auth page.

## 5. Create your account

Sign up with an email and password (or a configured OAuth provider). After verifying your email, the onboarding flow prompts you to name and brand your organization.

## 6. Build your first model

1. Go to **Model Builder** in the sidebar.
2. Click **New Model** and choose a type (e.g. `Collection`).
3. Enter a display name like `Blog Post`.
4. Add fields — for example a `title` (string) and a `body` (text / WYSIWYG).
5. Save the model.

## 7. Add content

1. Go to **Content** → **Blog Post**.
2. Click **New Entry**.
3. Fill in the fields and save.

## 8. Query via the API

Generate an API key in **Organization Settings → API Keys**, then fetch entries:

```bash
curl https://your-domain.com/api/models/blog_post/entries \
  -H "Authorization: Bearer zw_your_api_key"
```

```json
{
  "data": [
    { "id": "...", "title": "Hello World", "body": "..." }
  ],
  "meta": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 }
}
```
