Initial scaffold: CLAUDE.md, docs, and MCP config
- 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>
This commit is contained in:
12
.claude/settings.json
Normal file
12
.claude/settings.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"playwright": {
|
||||
"command": "npx",
|
||||
"args": ["@anthropic-ai/mcp-playwright@latest"]
|
||||
},
|
||||
"fetch": {
|
||||
"command": "npx",
|
||||
"args": ["@anthropic-ai/mcp-fetch@latest"]
|
||||
}
|
||||
}
|
||||
}
|
||||
81
CLAUDE.md
Normal file
81
CLAUDE.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# Acai CMS — Project Instructions
|
||||
|
||||
This is an Acai CMS website project. Follow these instructions when working with the codebase.
|
||||
|
||||
## Environment
|
||||
|
||||
- The site runs in Docker, typically at **http://localhost:8080**
|
||||
- You can make HTTP requests to test pages, APIs, or form submissions
|
||||
- If you need to inspect the live site, use browser tools or HTTP requests to localhost:8080
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
.
|
||||
├── template/estandar/
|
||||
│ ├── modulos/ # Builder modules (visual components)
|
||||
│ │ └── <module-id>/
|
||||
│ │ ├── index-base.tpl # Twig template (source)
|
||||
│ │ ├── index.tpl # Compiled template (auto-generated, do NOT edit)
|
||||
│ │ ├── style.css # Module styles
|
||||
│ │ └── script.js # Module JavaScript
|
||||
│ ├── css/ # Global CSS
|
||||
│ └── js/ # Global JavaScript
|
||||
├── hooks/ # PHP hooks (server-side logic)
|
||||
├── cms/
|
||||
│ ├── data/schema/ # Database table schemas (JSON)
|
||||
│ ├── lib/plugins/ # CMS plugins
|
||||
│ └── uploads/ # Uploaded media files
|
||||
├── .acai # Project config (domain, tokens, DB credentials)
|
||||
├── .docker/
|
||||
│ ├── .env # Docker environment (DB credentials)
|
||||
│ ├── docker-compose.yml
|
||||
│ ├── tunnel-url.txt # Public tunnel URL (if active)
|
||||
│ └── bore-db-url.txt # Database tunnel URL (if active)
|
||||
└── database.sql # Database dump
|
||||
```
|
||||
|
||||
## Key Concepts
|
||||
|
||||
### Modules (`template/estandar/modulos/`)
|
||||
Visual components that the site builder uses. Each module is a self-contained unit with its own template (Twig), CSS, and JS. Modules are placed on pages via the drag-and-drop builder.
|
||||
|
||||
See [docs/modular-system.md](docs/modular-system.md) for detailed rules.
|
||||
|
||||
### General Sections
|
||||
Reusable layout blocks (header, footer, sidebars) that appear across multiple pages. They use the same Twig engine as modules but serve a structural purpose.
|
||||
|
||||
See [docs/modular-system.md](docs/modular-system.md) for details.
|
||||
|
||||
### Hooks (`hooks/`)
|
||||
PHP files that execute server-side logic at specific points: before/after page load, on form submission, on API calls, scheduled tasks, etc. Hooks extend the CMS behavior without modifying the core.
|
||||
|
||||
See [docs/hooks-and-api.md](docs/hooks-and-api.md) for usage.
|
||||
|
||||
## Database Access
|
||||
|
||||
When the site is running in Docker, you can connect to the database:
|
||||
|
||||
- **Host:** `127.0.0.1`
|
||||
- **Port:** Check `.docker/.env` or `docker-compose.yml` for the mapped port (usually 3307+)
|
||||
- **Credentials:** Read from `.docker/.env`:
|
||||
- `DB_USERNAME`
|
||||
- `DB_PASSWORD`
|
||||
- `DB_DATABASE`
|
||||
|
||||
You can also exec into the container:
|
||||
```bash
|
||||
docker exec -it dw-<project-name>-db mysql -u root -p<password> <database>
|
||||
```
|
||||
|
||||
## Acai Core (web-base)
|
||||
|
||||
The project workspace contains only the **customization layer** (modules, hooks, schemas, uploads). The CMS core (routing, rendering engine, admin panel, APIs) lives in a separate directory called **web-base** that is mounted as a Docker volume.
|
||||
|
||||
If you need to understand core behavior (Twig filters, CmsApi methods, routing, etc.), the web-base path can be obtained from the plugin settings. Do NOT modify web-base files — they are shared across all projects.
|
||||
|
||||
## Documentation
|
||||
|
||||
- [docs/modular-system.md](docs/modular-system.md) — Modules, general sections, Twig syntax, builder vars, custom filters
|
||||
- [docs/hooks-and-api.md](docs/hooks-and-api.md) — PHP hooks, CmsApi, CocoDB, database operations
|
||||
- [docs/builder-fields.md](docs/builder-fields.md) — Builder field types, c-form, c-if/c-for/c-class, data-field-type
|
||||
32
docs/builder-fields.md
Normal file
32
docs/builder-fields.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Builder Fields & Attributes
|
||||
|
||||
## Field Types (`data-field-type`)
|
||||
|
||||
The builder uses `data-field-type` attributes to define editable areas in module templates.
|
||||
|
||||
<!-- TODO: Document available field types (text, image, richtext, link, repeater, etc.) -->
|
||||
|
||||
|
||||
## Conditional Attributes
|
||||
|
||||
### `c-if`
|
||||
|
||||
<!-- TODO: Document c-if syntax and usage for conditional rendering -->
|
||||
|
||||
### `c-for`
|
||||
|
||||
<!-- TODO: Document c-for syntax for repeating elements -->
|
||||
|
||||
### `c-class`
|
||||
|
||||
<!-- TODO: Document c-class for conditional CSS classes -->
|
||||
|
||||
|
||||
## Forms (`c-form`)
|
||||
|
||||
<!-- TODO: Document c-form usage for builder-integrated forms -->
|
||||
|
||||
|
||||
## Builder Variables Access
|
||||
|
||||
<!-- TODO: Document how to access and use builder variables in templates -->
|
||||
44
docs/hooks-and-api.md
Normal file
44
docs/hooks-and-api.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# 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 -->
|
||||
54
docs/modular-system.md
Normal file
54
docs/modular-system.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Acai Modular System
|
||||
|
||||
## Modules
|
||||
|
||||
Modules are the visual building blocks of Acai websites. Each module lives in `template/estandar/modulos/<module-id>/`.
|
||||
|
||||
### File structure
|
||||
|
||||
```
|
||||
<module-id>/
|
||||
├── index-base.tpl # Source Twig template (EDIT THIS)
|
||||
├── index.tpl # Compiled output (auto-generated, do NOT edit)
|
||||
├── style.css # Module-scoped styles
|
||||
└── script.js # Module JavaScript
|
||||
```
|
||||
|
||||
### Twig Templates
|
||||
|
||||
<!-- TODO: Document Twig syntax, variable access, builder vars -->
|
||||
|
||||
### Custom Twig Filters
|
||||
|
||||
<!-- TODO: Document custom filters available in Acai (e.g., |translate, |slugify, etc.) -->
|
||||
|
||||
### Builder Variables
|
||||
|
||||
<!-- TODO: Document how builder vars work, how to access them in templates -->
|
||||
|
||||
### Calling Modules from Other Modules
|
||||
|
||||
<!-- TODO: Document how to include/call modules from other modules or general sections -->
|
||||
|
||||
|
||||
## General Sections
|
||||
|
||||
General sections are reusable layout blocks (headers, footers, sidebars) shared across pages.
|
||||
|
||||
<!-- TODO: Document how general sections differ from modules, where they live, how to create/edit them -->
|
||||
|
||||
|
||||
## CSS & JavaScript
|
||||
|
||||
### Module Styles (`style.css`)
|
||||
|
||||
<!-- TODO: Document scoping rules, CSS conventions -->
|
||||
|
||||
### Module Scripts (`script.js`)
|
||||
|
||||
<!-- TODO: Document JS conventions, lifecycle, event handling -->
|
||||
|
||||
|
||||
## Builder Field Types
|
||||
|
||||
<!-- TODO: Document data-field-type usage, c-form, c-if, c-for, c-class attributes -->
|
||||
Reference in New Issue
Block a user