Authored-by: Moko Consulting
2.8 KiB
CLAUDE.md
This file provides guidance to Claude Code when working with this repository.
Project Overview
MokoDoliJoomShop -- A Joomla 4/5 storefront component that interfaces with Dolibarr ERP for products, orders, and invoicing. Dolibarr is the backend commerce engine; Joomla is the frontend presentation layer.
| Field | Value |
|---|---|
| Platform | joomla |
| Extension type | component |
| Element | com_mokodolijoomshop |
| Language | PHP |
| Default branch | main |
| License | GPL-3.0-or-later |
| Wiki | MokoDoliJoomShop Wiki |
| Standards | MokoStandards |
Architecture
This component follows a headless commerce pattern:
- Dolibarr handles: products, pricing, inventory, customers (thirdparties), orders, invoices
- Joomla handles: product catalog display, shopping cart (session), checkout flow, user-facing UI
- Integration: Dolibarr REST API v2 (
/api/index.php/...)
Key Layout
src/admin/-- administrator MVC (dashboard, products sync, orders view, settings)src/site/-- frontend MVC (product catalog, product detail, cart, checkout)src/admin/src/Helper/DolibarrClient.php-- Dolibarr REST API clientsrc/admin/src/Service/-- service layer bridging Dolibarr data to Joomla models
Dolibarr API Endpoints Used
| Joomla Feature | Dolibarr Endpoint | Method |
|---|---|---|
| Product catalog | /products |
GET |
| Product detail | /products/{id} |
GET |
| Product categories | /categories |
GET |
| Product stock | /products/{id}/stock |
GET |
| Create customer | /thirdparties |
POST |
| Create order | /orders |
POST |
| Create invoice | /invoices |
POST |
| Payment | /invoices/{id}/payments |
POST |
Common Commands
make build # Build installable ZIP
make lint # Run PHP linter
make validate # Lint + validation
make release # Full release pipeline
make clean # Clean build artifacts
Rules
-
Workflow directory:
.mokogitea/(not.gitea/or.github/) -
Never commit
.claude/,.mcp.json,TODO.md, or*.min.css/*.min.js -
Attribution: use
Authored-by: Moko Consultingin commits -
Branch strategy: develop on
dev/, merge tomainfor release -
Wiki: documentation lives in the Gitea wiki, not in
docs/files -
Standards: this repo follows MokoStandards
-
PHP minimum: 8.1
-
Joomla table operations: always use bind() -> check() -> store(), never save()
-
Never store Dolibarr credentials in code -- always use component params
-
Namespace:
Moko\Component\MokoDoliJoomShop