diff --git a/STARTHERE.md b/STARTHERE.md new file mode 100755 index 0000000..ed303cc --- /dev/null +++ b/STARTHERE.md @@ -0,0 +1,93 @@ +# πŸš€ Gemini Agent Task: Grav CMS + Dolibarr Prospect Integration (v1.0) + +You are an autonomous software development agent operating inside the Gemini CLI environment. Your task is to deliver a clean, containerized integration between **Grav CMS** and **Dolibarr**, enabling email capture on the website and automatic creation of prospect records in Dolibarr. + +This is a v1.0 implementation. Keep it simple, modular, and extensible. Do not install anything on the host system. + +--- + +## 🧱 Environment Constraints + +- βœ… All operations must occur inside Docker containers. +- ❌ Do not use `apt`, `yum`, `brew`, or any host-level package manager. +- βœ… Use `docker-compose` to orchestrate services. +- βœ… Use named volumes and health checks. +- βœ… Log all actions to `logs/integration.log`. + +--- + +## 🌐 Project Context + +- **Website:** StartingLineProductions.com +- **CMS:** Grav (PHP-based, flat-file) +- **CRM:** Dolibarr (self-hosted via Cloudron) +- **Goal:** Capture email addresses via a form on the Grav site and push them into Dolibarr as new prospects. + +--- + +## 🧩 Functional Requirements + +- Create a form in Grav that collects: + - Email (required) + - First name (optional) + - Consent checkbox (required for GDPR) + +- On submission: + - Validate input + - Send data to Dolibarr via REST API (`/thirdparties`) + - Create a new prospect with status β€œDraft” or β€œTo Qualify” + - Log success/failure with timestamp + +--- + +## πŸ” Dolibarr API Integration + +- Authenticate using API token (stored in containerized config file) +- Required fields: + - `email` + - `name` (fallback to β€œUnknown”) + - `status` = 1 (prospect) + +--- + +## πŸ› οΈ Deliverables + +- `docker-compose.yml` with Grav and Dolibarr services +- `user/plugins/prospectform/` Grav plugin or override +- `README.md` with setup and usage instructions +- `integration.log` with sample entries +- `config.yaml` with API token placeholder +- `form.html.twig` for frontend form + +--- + +## βœ… Do vs. ❌ Don’t + +| βœ… Do | ❌ Don’t | +|------|---------| +| βœ… Use containerized Grav and Dolibarr images | ❌ Install PHP or Grav on the host | +| βœ… Use documented Dolibarr API endpoints | ❌ Modify Dolibarr core or database directly | +| βœ… Log errors and retry up to 3 times | ❌ Silently fail or discard submissions | +| βœ… Keep code modular and extensible | ❌ Hardcode credentials or logic | + +--- + +## 🧭 Agent Behavior + +- Confirm understanding before starting +- Ask for clarification if API access fails or endpoint is ambiguous +- Propose fallback options if Dolibarr is unreachable +- Document any assumptions in `README.md` + +--- + +## πŸ“¦ Future Enhancements (v1.1+) + +- Add CAPTCHA or spam protection +- Sync additional fields (phone, company, etc.) +- Enable double opt-in email confirmation +- Add dashboard widget in Dolibarr for new signups + +--- + +Begin with the Grav form and Dolibarr API integration. Keep it lean, reliable, and containerized. diff --git a/docs/agent-state/workflow-state.json b/docs/agent-state/workflow-state.json new file mode 100644 index 0000000..565b46e --- /dev/null +++ b/docs/agent-state/workflow-state.json @@ -0,0 +1,4 @@ +{ + "last_completed_step": null, + "last_run_timestamp": null +} diff --git a/project-config.yaml b/project-config.yaml new file mode 100644 index 0000000..c298dfa --- /dev/null +++ b/project-config.yaml @@ -0,0 +1,13 @@ +project_name: STLPWebsite + +services: + - name: dolibarr + type: app + - name: grav + type: web + +env: + dolibarr: + - DOLIBARR_API_KEY + grav: + [] diff --git a/scripts/01_deploy_dolibarr.sh b/scripts/01_deploy_dolibarr.sh new file mode 100755 index 0000000..3a36e02 --- /dev/null +++ b/scripts/01_deploy_dolibarr.sh @@ -0,0 +1,2 @@ +#!/bin/bash +# Deploy Dolibarr diff --git a/scripts/01_verify_dolibarr.sh b/scripts/01_verify_dolibarr.sh new file mode 100755 index 0000000..ccbdd98 --- /dev/null +++ b/scripts/01_verify_dolibarr.sh @@ -0,0 +1,2 @@ +#!/bin/bash +# Verify Dolibarr diff --git a/scripts/02_deploy_grav.sh b/scripts/02_deploy_grav.sh new file mode 100755 index 0000000..312f9cd --- /dev/null +++ b/scripts/02_deploy_grav.sh @@ -0,0 +1,2 @@ +#!/bin/bash +# Deploy Grav CMS diff --git a/scripts/02_verify_grav.sh b/scripts/02_verify_grav.sh new file mode 100755 index 0000000..facd402 --- /dev/null +++ b/scripts/02_verify_grav.sh @@ -0,0 +1,2 @@ +#!/bin/bash +# Verify Grav CMS