# How Pottr Works

> Pottr bridges client-friendly WordPress management and modern frontend engineering: where your data lives, how requests flow, and who does what.

- **Category:** Getting Started
- **Canonical Guide:** https://pottr.tangble.com/docs/how-pottr-works

---

>
Pottr bridges client-friendly WordPress management and modern frontend engineering: where your data lives, how requests flow, and who does what.

## The End-to-End Workflow

<ol>
<li>
**Install Pottr in WordPress:** Download the zip from [pottr.tangble.com](/pottr), upload it under **Plugins › Add New › Upload Plugin** and activate it. Pottr is not on the WordPress.org directory.
</li>
<li>
**Define your application data:** Create collections visually in the WordPress admin, declare them in code with a Blueprint, or let an external app request a connection that you approve with one click.
</li>
<li>
**The REST API exists immediately:** Pottr serves JSON at `/wp-json/pottr/v1/collections/{slug}` with filtering, sorting and pagination.
</li>
<li>
**Connect your frontend:** Use your public key (`pk_live_...`) in your React, Next.js, Vue or mobile app to read and write entries.
</li>
<li>
**Add capabilities as you need them:** Turn on app-user authentication, scope collections to their owners, add webhooks, accept media uploads, stream live events, or automate deployments with Blueprints.
</li>
</ol>

## A Request, Start to Finish

<ol>
<li>Your app sends a request to `/wp-json/pottr/v1/...` with an `Authorization: Bearer` header (and, for signed-in users, an `X-Pottr-User-Token` header).</li>
<li>Pottr checks CORS, then the API key or token, then your monthly API-call quota.</li>
<li>The schema validates the request body: required fields, field types and unknown keys.</li>
<li>The entry is read from or written to `wp_pottr_entries`, scoped to the user if the collection is user-owned.</li>
<li>Pottr records an activity log event, queues any matching webhooks and publishes the change to live event streams.</li>
</ol>

## Where Your Data Lives

<ul>
<li>**Entries:** One JSON document per entry in `wp_pottr_entries`, tagged with its collection slug. Deleting an entry through the API is a soft delete.</li>
<li>**Schema:** Your collections and fields are stored in the `pottr_schema` WordPress option.</li>
<li>**App users:** Each app that declares authentication gets its own users and refresh-token tables, separate from `wp_users`.</li>
<li>**Logs, webhooks and events:** Dedicated tables for activity logs, webhook deliveries and the short-lived live-event buffer.</li>
<li>**Uploads:** Files go to the WordPress uploads folder under `pottr/{app}/` and are registered as media attachments.</li>
</ul>

Deleting the plugin keeps all of this by default. Data is only erased if you switch on **Also erase all Pottr data when the plugin is deleted** under **Pottr › Settings**.

## WordPress vs. Pottr Responsibilities

<table class="docs-table">
<thead>
<tr>
<th>Layer</th>
<th>Component</th>
<th>Responsibilities</th>
</tr>
</thead>
<tbody>
<tr>
<td>**WordPress**</td>
<td>Hosting & runtime</td>
<td>PHP and MySQL runtime, admin UI, media library, transactional mail (`wp_mail`), WP-Cron scheduling.</td>
</tr>
<tr>
<td>**Pottr**</td>
<td>Application engine</td>
<td>Schema, REST routes, API keys, app-user JWT authentication, webhooks, metering, logs and live events.</td>
</tr>
<tr>
<td>**Your frontend**</td>
<td>User experience</td>
<td>The client UI (React, Vue, Next.js, mobile), user interaction and client-side state.</td>
</tr>
</tbody>
</table>

## The Pottr Admin

Everything above can be managed from the **Pottr** menu in WordPress:

<ul>
<li>**Pottr (dashboard):** Usage at a glance, plus tabs for Collections, Webhooks, Logs and, when you use app authentication, your app users. Open a collection to edit its fields and browse, add, import and delete entries.</li>
<li>**API Keys:** View, copy and regenerate your public and secret keys, copy a ready-made `.env` snippet and see connected apps.</li>
<li>**License:** See your plan, activate or deactivate a license key and manage billing.</li>
<li>**Settings:** Choose whether Pottr keeps an activity log and whether data is erased when the plugin is deleted.</li>
<li>**Getting started:** A guided first request, available from the top bar at any time.</li>
</ul>
