feat: initial project structure

Adds the initial directory structure, configuration files, and stub scripts for the Grav CMS and Dolibarr project.
This commit is contained in:
2025-09-09 16:28:57 -05:00
parent 8774a01928
commit 4868941c03
7 changed files with 118 additions and 0 deletions

93
STARTHERE.md Executable file
View File

@@ -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. ❌ Dont
| ✅ Do | ❌ Dont |
|------|---------|
| ✅ 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.

View File

@@ -0,0 +1,4 @@
{
"last_completed_step": null,
"last_run_timestamp": null
}

13
project-config.yaml Normal file
View File

@@ -0,0 +1,13 @@
project_name: STLPWebsite
services:
- name: dolibarr
type: app
- name: grav
type: web
env:
dolibarr:
- DOLIBARR_API_KEY
grav:
[]

2
scripts/01_deploy_dolibarr.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
# Deploy Dolibarr

2
scripts/01_verify_dolibarr.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
# Verify Dolibarr

2
scripts/02_deploy_grav.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
# Deploy Grav CMS

2
scripts/02_verify_grav.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
# Verify Grav CMS