### GET /setup/checklist
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/features/setup-wizard.html
Returns the dynamic completion status of the Getting Started checklist.
```APIDOC
## GET /setup/checklist
### Description
Returns dynamic checklist completion status.
### Method
GET
### Endpoint
/setup/checklist
### Response
#### Success Response (200)
- **checklist_status** (object) - An object containing the completion status of each checklist item.
- **upload_logo** (boolean) - True if the logo has been uploaded.
- **edit_homepage** (boolean) - True if the homepage has been edited.
- **create_post** (boolean) - True if the first post has been created.
- **setup_navigation** (boolean) - True if navigation has been set up.
#### Response Example
```json
{
"checklist_status": {
"upload_logo": false,
"edit_homepage": true,
"create_post": false,
"setup_navigation": false
}
}
```
```
--------------------------------
### Setup Wizard API Endpoints
Source: https://github.com/tonyshawjr/outpost/blob/main/FEATURES.md
These API endpoints manage the setup wizard process. 'GET setup/packs' retrieves available content packs filtered by theme, 'POST setup/apply' applies wizard choices within a transaction, 'GET setup/checklist' provides dynamic completion status for the getting started checklist, and 'POST setup/checklist/dismiss' handles dismissing checklist items.
```javascript
GET setup/packs (returns available packs filtered by theme)
```
```javascript
POST setup/apply (applies wizard choices in transaction)
```
```javascript
GET setup/checklist (dynamic completion)
```
```javascript
POST setup/checklist/dismiss
```
--------------------------------
### GET setup/checklist
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/setup-wizard.html
Retrieves the current completion status of the Getting Started checklist items.
```APIDOC
## GET setup/checklist
### Description
Returns dynamic checklist completion status for the dashboard onboarding process.
### Method
GET
### Endpoint
setup/checklist
```
--------------------------------
### One-time setup for Admin SPA
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/quick-start.html
Run these commands once to install dependencies for building the admin SPA.
```bash
cd cms/
npm install
```
--------------------------------
### POST setup/checklist/dismiss
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/setup-wizard.html
Permanently dismisses the Getting Started checklist from the dashboard.
```APIDOC
## POST setup/checklist/dismiss
### Description
Dismisses the Getting Started checklist permanently.
### Method
POST
### Endpoint
setup/checklist/dismiss
```
--------------------------------
### POST setup/apply
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/setup-wizard.html
Applies the choices made during the setup wizard, including site name, Forge analysis results, and marking the setup as complete.
```APIDOC
## POST setup/apply
### Description
Applies wizard choices in a single transaction: updates site name, runs Forge site analysis, registers discovered pages and fields, and sets setup_completed.
### Method
POST
### Endpoint
setup/apply
### Request Body
- **site_name** (string) - Required - The name of the site to be configured.
### Request Example
{
"site_name": "My Awesome Site"
}
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful.
- **summary** (object) - Contains counts of discovered pages, fields, and menus.
#### Response Example
{
"success": true,
"summary": { "pages": 5, "fields": 12, "menus": 1 }
}
```
--------------------------------
### Setup API Endpoints
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
Endpoints for initial setup and configuration.
```APIDOC
## GET setup/packs
### Description
Returns available content pack metadata.
### Method
GET
### Endpoint
/setup/packs
```
```APIDOC
## POST setup/apply
### Description
Applies wizard choices (site_name, pack) in a transaction.
### Method
POST
### Endpoint
/setup/apply
### Request Body
- **site_name** (string) - Required - The name of the site.
- **pack** (string) - Required - The content pack to apply.
```
```APIDOC
## GET setup/checklist
### Description
Returns dynamic checklist completion status.
### Method
GET
### Endpoint
/setup/checklist
### Response
#### Success Response (200)
- **add_logo** (boolean) - Indicates if the logo has been added.
- **edit_homepage** (boolean) - Indicates if the homepage has been edited.
- **create_post** (boolean) - Indicates if a post has been created.
- **setup_navigation** (boolean) - Indicates if navigation has been set up.
- **customize_site** (boolean) - Indicates if the site has been customized.
```
```APIDOC
## POST setup/checklist/dismiss
### Description
Sets `setup_checklist_dismissed` to '1' in settings, effectively dismissing the setup checklist.
### Method
POST
### Endpoint
/setup/checklist/dismiss
```
--------------------------------
### Compass Quick Start HTML
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
Example HTML structure demonstrating the basic setup for Compass smart filtering. It includes a text search input, a dropdown filter, and a results container, all linked by 'data-collection' and 'data-compass' attributes.
```html
```
--------------------------------
### Setup API Endpoints
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/llms.txt
Endpoints for managing the initial setup wizard, content packs, and onboarding checklist.
```APIDOC
## GET setup/packs
### Description
Returns available content pack metadata filtered by theme.
## POST setup/apply
### Description
Applies wizard choices (site_name, theme, pack) in a single SQLite transaction.
## GET setup/checklist
### Description
Returns dynamic checklist completion status for onboarding tasks.
## POST setup/checklist/dismiss
### Description
Sets the setup_checklist_dismissed setting to '1'.
```
--------------------------------
### Full Blog List Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/loops/collection-loops.html
A comprehensive example demonstrating how to structure a blog listing page using collection loops, pagination, and various styling elements.
```APIDOC
### Full Blog List Example
```html
```
```
--------------------------------
### OutpostTemplateV2 Usage Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/reference/php-classes.html
Examples demonstrating how to render templates, compile source manually, and clear the template cache.
```APIDOC
## OutpostTemplateV2 Usage Example
```php
// Render a template file (used by front-router.php)
$siteRoot = OUTPOST_SITE_ROOT;
$template = $siteRoot . '/blog.html';
OutpostTemplateV2::render($template, $siteRoot);
// Compile source manually (useful for testing)
$source = '
Hello
';
$compiled = OutpostTemplateV2::compile($source);
// Produces:
// Clear the template cache
OutpostTemplateV2::clearCache();
```
```
--------------------------------
### Install Dependencies and Build Admin SPA
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/quick-start.html
Run these commands in the `cms/` directory to install dependencies and build the admin SPA. The build output is placed in `cms/php/admin/`.
```bash
cd cms/
npm install
# Build the admin SPA
npm run build
```
--------------------------------
### Blog Post Card Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/template-syntax/index.html
A complete example of a collection loop rendering a card component with conditional image display.
```html
```
--------------------------------
### Full Blog List Example - Outpost CMS
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/loops/collection-loops.html
A comprehensive example of a blog page layout using collection loops with pagination, sorting, filtering, and empty state handling.
```html
```
--------------------------------
### Basic Compass Setup
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/compass.html
A simple setup for Compass including a search input, a dropdown filter, and a results container. Compass automatically wires these elements together based on the `data-collection` attribute.
```html
```
--------------------------------
### Landing Page Builder Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/loops/flexible-content-loops.html
An example demonstrating a flexible content loop for building a landing page with different sections like hero, testimonials, and call-to-action banners. Each section uses specific `data-layout` attributes and `data-outpost` for its content.
```html
Click Here
```
--------------------------------
### Media Upload cURL Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/api/admin-api.html
Example command for uploading a file using multipart/form-data.
```bash
curl -b cookies.txt \
-F "file=@/path/to/photo.jpg" \
-F "csrf_token=a1b2c3..." \
"https://example.com/outpost/api.php?action=media/upload"
```
--------------------------------
### Example: Blog Post Card
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/template-syntax/index.html
An example of how to structure a blog post card using Outpost tags.
```APIDOC
## Example: Blog Post Card
```html
```
```
--------------------------------
### Create Collection Item - Full Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
Use this example to create a new item within a collection. It includes steps for obtaining a CSRF token and handling the response. API keys can be used as an alternative to session-based authentication.
```javascript
// Step 1: Get CSRF token (required for all POST/PUT/DELETE)
const meRes = await fetch('/outpost/api.php?action=auth/me', {
credentials: 'include',
});
const { csrf_token } = await meRes.json();
// Step 2: Create the item
const res = await fetch('/outpost/api.php?action=items', {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf_token,
},
body: JSON.stringify({
collection_id: 3,
slug: 'my-first-post',
status: 'published',
data: {
title: 'My First Post',
body: '
Hello world.
',
featured_image: '/outpost/uploads/hero.jpg'
}
})
});
// Step 3: Handle response
if (!res.ok) {
const err = await res.json();
// err.error contains the message, e.g. "Slug already exists"
console.error('Create failed:', err.error);
} else {
const item = await res.json();
console.log('Created item:', item.id);
}
```
--------------------------------
### Complete Example config.php
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/reference/configuration.html
A production-ready configuration file demonstrating how to set all Outpost constants. Ensure sensitive information like sync keys and passwords are kept secure.
```php
```
The member system works out of the box. No configuration is needed beyond having Outpost installed. The `members.php` file handles sessions, cookie validation, and database lookups automatically. Just `require_once` it and call the static methods.
```
--------------------------------
### Outpost Loop Options Examples
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
Demonstrates various options for the outpost-each component to control data fetching and display.
```html
```
--------------------------------
### Authentication Flow (Login, Get CSRF, Mutate)
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/api/index.html
A complete example demonstrating the authentication process: logging in to obtain a session cookie, fetching a CSRF token, and then using both for a mutating request.
```APIDOC
## Authentication Flow (Login, Get CSRF, Mutate)
### Description
This section provides a full example of the authentication flow, including logging in to establish a session, retrieving a CSRF token, and subsequently using these credentials to perform a mutating API request.
### Step 1: Log in and save session cookie
#### Method
POST
#### Endpoint
`/outpost/api.php?action=auth/login`
#### Request Body
```json
{
"username": "admin",
"password": "secret"
}
```
### Step 2: Get CSRF token
#### Method
GET
#### Endpoint
`/outpost/api.php?action=auth/me`
#### Request Headers
`Cookie: session_cookie` (from login response)
### Step 3: Use the token on a mutating request (e.g., PUT pages)
#### Method
PUT
#### Endpoint
`/outpost/api.php?action=pages&id=1`
#### Request Headers
`Cookie: session_cookie`
`X-CSRF-Token: a1b2c3d4e5f6...`
#### Request Body
```json
{
"title": "Home",
"status": "published"
}
```
```
--------------------------------
### Authentication Flow (Login, Get CSRF, Mutate)
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/api/index.html
This section provides examples for a complete authentication flow, including logging in, retrieving a CSRF token, and then using that token to perform a mutating request.
```APIDOC
## Authentication Flow (Login, Get CSRF, Mutate)
### Full login example — curl
1. **Log in and save the session cookie**
```bash
curl -c cookies.txt -X POST https://example.com/outpost/api.php?action=auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"secret"}'
```
2. **Get CSRF token**
```bash
curl -b cookies.txt https://example.com/outpost/api.php?action=auth/me
```
3. **Use the token on a mutating request**
```bash
curl -b cookies.txt -X PUT \
"https://example.com/outpost/api.php?action=pages&id=1" \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: a1b2c3d4e5f6..." \
-d '{"title":"Home","status":"published"}'
```
### Full login example — JavaScript fetch
1. **Log in**
```javascript
const loginRes = await fetch('/outpost/api.php?action=auth/login', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: 'admin', password: 'secret' }),
});
```
2. **Get CSRF token**
```javascript
const meRes = await fetch('/outpost/api.php?action=auth/me', {
credentials: 'include',
});
const { csrf_token } = await meRes.json();
```
3. **Mutating request**
```javascript
const updateRes = await fetch('/outpost/api.php?action=pages&id=1', {
method: 'PUT',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf_token,
},
body: JSON.stringify({ title: 'Home', status: 'published' }),
});
const result = await updateRes.json();
```
```
--------------------------------
### Start Local Development Servers
Source: https://github.com/tonyshawjr/outpost/blob/main/README.md
Commands to launch the PHP test server and the Vite development server.
```bash
cd cms
php -S localhost:8080 -t test-site
```
```bash
cd cms
npm run dev
```
--------------------------------
### Get JWT Bearer Token (curl)
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/api/member-api.html
Obtain a JWT bearer token by exchanging email/username and password. The token is valid for 30 days. This example demonstrates the curl command for making the request.
```curl
curl -X POST https://example.com/outpost/member-api.php?action=token \
-H "Content-Type: application/json" \
-d '{"email":"jane@example.com","password":"mypassword"}'
```
--------------------------------
### GettingStarted Component for Onboarding Checklist
Source: https://github.com/tonyshawjr/outpost/blob/main/FEATURES.md
The GettingStarted.svelte component displays a dashboard card with a checklist for new users. It includes 5 items: upload logo, edit homepage, create first post, set up navigation, and customize theme. It features a progress bar, check circles, and direct links to relevant pages. Dismissal state is persisted in the settings database.
```svelte
```
--------------------------------
### Get JWT Bearer Token (React Native)
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/api/member-api.html
Obtain a JWT bearer token by exchanging email/username and password. The token is valid for 30 days. This example shows how to make the request using React Native's fetch API and store the token.
```javascript
const res = await fetch('https://example.com/outpost/member-api.php?action=token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'jane@example.com', password: 'mypassword' }),
});
const { token, member, expires_at } = await res.json();
// Store token securely (e.g. SecureStore on iOS/Android)
await SecureStore.setItemAsync('outpost_token', token);
```
--------------------------------
### GET /channels/history&id=N
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/features/channels.html
Get sync history log.
```APIDOC
## GET channels/history&id=N
### Description
Get sync history log for a channel.
### Method
GET
### Endpoint
api.php?action=channels/history&id=N
### Parameters
#### Query Parameters
- **id** (integer) - Required - The unique identifier of the channel.
```
--------------------------------
### Admin API - Get Single Page (GET)
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/api/index.html
Use GET requests with an ID to retrieve a single page from the Admin API. Requires session or Bearer token authentication.
```http
GET api.php?action=pages&id=5 → get a single page
```
--------------------------------
### Implement Navigation Partial
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/template-syntax/global-fields.html
Example of a navigation header using global fields and the outpost-menu component.
```html
```
--------------------------------
### Site detection response example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/api/admin-api.html
Example JSON response for site detection.
```json
{
"site_root": "/var/www/html/",
"has_index": true,
"template_files": ["index.html", "about.html", "blog.html", "post.html"],
"has_partials": true,
"has_assets": true,
"has_outpost_tags": true
}
```
--------------------------------
### Implement Navigation Partial
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/template-syntax/global-fields.html
Example of a navigation header using global logo checks and menu iteration.
```html
```
--------------------------------
### Install Certbot for SSL (Debian/Ubuntu)
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/deploy.html
Install Certbot and the Nginx plugin on Debian/Ubuntu systems to manage SSL certificates with Let's Encrypt. This is part of the recommended approach for securing your Outpost installation.
```bash
# Install Certbot (Debian/Ubuntu with Nginx)
sudo apt install certbot python3-certbot-nginx
```
--------------------------------
### Full Blog List Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/loops/collection-loops.html
A complete implementation of a blog list featuring pagination, filtering, and an empty state.
```html
```
--------------------------------
### Start PHP Development Server
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/quick-start.html
Use PHP's built-in server for local development. Ensure you are in your project directory and specify the document root and router script.
```bash
php -S localhost:8080 -t . outpost/front-router.php
```
--------------------------------
### JSON-LD Article Schema Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
Example of the JSON-LD structure generated automatically for collection single pages.
```json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Item title",
"description": "Resolved description",
"image": "https://example.com/outpost/uploads/featured.jpg",
"datePublished": "2024-02-01T08:00:00+00:00",
"dateModified": "2024-02-10T12:00:00+00:00",
"url": "https://example.com/post/my-article",
"author": { "@type": "Person", "name": "Author Name" }
}
```
--------------------------------
### Implement Job Board Template
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/channels.html
Full template example for a careers page using a channel loop.
```liquid
{#--- Template: Careers | Route: /careers ---#}
{% include 'head' %}
{% include 'nav' %}
{% endfor %}
{% include 'footer' %}
```
--------------------------------
### Example: Hero Section with Globals
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/template-syntax/index.html
An example demonstrating the use of global fields and conditionals in a hero section.
```APIDOC
## Example: Hero Section with Globals
```html
We build things people love.
Get started
```
```
--------------------------------
### Outpost Channel Loop with Options
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/llms.txt
This example demonstrates how to limit the number of items displayed and sort them by a specific field within a channel loop.
```html
```
--------------------------------
### User grants response example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/api/admin-api.html
Example JSON response for a user's granted collection IDs.
```json
{
"grants": [1, 3, 5]
}
```
--------------------------------
### URL Filter Example
Source: https://github.com/tonyshawjr/outpost/blob/main/php/docs/features/compass.html
Example of a URL query string representing active search and category filters.
```text
/explore?q=pizza&category=restaurants&city=jacksonville&sort=rating:desc
```
--------------------------------
### POST /outpost/sync-api.php?action=push
Source: https://context7.com/tonyshawjr/outpost/llms.txt
Deploys site files to the server and optionally pushes database content.
```APIDOC
## POST /outpost/sync-api.php?action=push
### Description
Deploys site files to the server. Automatically creates a backup before writing. Only allowed file extensions are accepted.
### Method
POST
### Endpoint
/outpost/sync-api.php?action=push
### Parameters
#### Query Parameters
- **action** (string) - Required - Must be 'push'
#### Request Body
- **files** (object) - Required - Map of file paths to base64-encoded content
- **push_content** (boolean) - Optional - Set true to also push database
### Response
#### Success Response (200)
- **backup_id** (string) - ID of the created backup
- **diff** (object) - Summary of added, modified, and skipped files
```
--------------------------------
### Example Usage in head.html
Source: https://github.com/tonyshawjr/outpost/blob/main/test-site/outpost/docs/template-syntax/meta-tags.html
Illustrates how to integrate `` and `` within the `head.html` file for a typical web page.
```APIDOC
## `head.html` Example
### Description
Shows practical implementation of Outpost meta components within the HTML head section.
### Example with ``
```html
```
### Example with ``
```html
```
```