- CLAUDE.md with project structure, DB access, and environment info - docs/ with placeholder files for modular system, hooks/API, and builder fields - .claude/settings.json with Playwright and Fetch MCP servers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.1 KiB
Markdown
45 lines
1.1 KiB
Markdown
# Hooks & Server-Side API
|
|
|
|
## Hooks
|
|
|
|
Hooks are PHP files in the `hooks/` directory that execute server-side logic at specific lifecycle points.
|
|
|
|
### Hook Types
|
|
|
|
<!-- TODO: Document hook types (before_page, after_page, on_form, on_api, cron, etc.) -->
|
|
|
|
### Hook File Naming
|
|
|
|
<!-- TODO: Document naming conventions and how the CMS discovers hooks -->
|
|
|
|
### Hook Examples
|
|
|
|
<!-- TODO: Add practical examples of common hooks -->
|
|
|
|
|
|
## CmsApi
|
|
|
|
The `CmsApi` class provides methods to interact with the CMS from hooks.
|
|
|
|
<!-- TODO: Document main CmsApi methods (getPage, getRecord, createRecord, updateRecord, etc.) -->
|
|
|
|
|
|
## CocoDB
|
|
|
|
`CocoDB` is the database abstraction layer for Acai.
|
|
|
|
<!-- TODO: Document CocoDB usage (query, insert, update, delete, transactions) -->
|
|
|
|
|
|
## Database Operations
|
|
|
|
### Direct Queries
|
|
|
|
<!-- TODO: Document how to run raw SQL queries from hooks -->
|
|
|
|
### Table Schemas
|
|
|
|
Table schemas are stored as JSON files in `cms/data/schema/`. Each file defines the fields, types, and configuration of a CMS table.
|
|
|
|
<!-- TODO: Document schema format and how to create/modify tables -->
|