Skip to content

metadist/Synaads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synaplan SynaAds Plugin

AI-powered marketing campaign generator for Synaplan. Creates landing pages, Google Ads campaigns, ad copy, social media graphics, and videos — all from a single campaign brief.

Features

  • Landing Pages — AI-generated, multilingual HTML pages with SEO metadata
  • Google Ads — Campaign plans with keywords, negative keywords, and ad groups
  • Ad Copy — Platform-specific copy for Google, LinkedIn, Facebook, Instagram
  • Media Generation — Social graphics (LinkedIn, Instagram) and video via Google Veo
  • Compliance — Cookie consent, privacy policy, and imprint link enforcement
  • ZIP Export — Download all campaign assets including media, keywords, and ad data

Repository Structure

synaplan-synaads/
├── synaads-plugin/       # Plugin source code (install into Synaplan)
│   ├── backend/          #   Symfony controllers & services
│   ├── frontend/         #   Plugin UI (vanilla JS)
│   ├── migrations/       #   Database setup
│   └── manifest.json     #   Plugin metadata
├── _devextras/           # Development extras (planning docs, test scripts, examples)
├── LICENSE               # Apache 2.0
└── README.md

Prerequisites

  • A running Synaplan instance (see its README for setup)
  • Docker Compose

Installation & Activation

Synaplan uses automatic plugin discovery — no config file edits are needed. Drop the plugin into the plugins/ directory, clear the cache, and run the install command.

1. Clone both repositories

git clone https://github.com/metadist/synaplan.git
git clone https://github.com/metadist/synaplan-synaads.git

Your directory layout should look like:

your-workspace/
├── synaplan/                 # Main application
└── synaplan-synaads/         # This repo

2. Copy the plugin into Synaplan

cp -r synaplan-synaads/synaads-plugin synaplan/plugins/synaads

Synaplan's Kernel scans plugins/*/manifest.json on boot to auto-register services and routes. No changes to composer.json, routes.yaml, or services.yaml are required.

3. Start Synaplan (if not already running)

cd synaplan
docker compose up -d

4. Clear cache and activate

docker compose exec backend php bin/console cache:clear
docker compose exec backend php bin/console app:plugin:install <userId> synaads

Replace <userId> with the target user's ID (typically 1 for the first admin user). This command:

  • Runs the migration in migrations/001_setup.sql which writes default settings to BCONFIG with group P_synaads
  • Calls the SynaAdsInstallService::seedDefaults hook to create a sample campaign
  • Enables the plugin for that user (P_synaads.enabled = 1)

5. Access the plugin

Open Synaplan in your browser and navigate to Plugins > SynaAds in the sidebar, or go directly to:

http://localhost:5173/plugins/synaads

Activate for all existing users (production)

To install the plugin for every active, verified user at once:

docker compose exec backend php bin/console app:plugin:install-verified-users synaads

Auto-activate for new users

To have the plugin automatically installed when new users register, set the DEFAULT_USER_PLUGINS environment variable in the backend .env:

DEFAULT_USER_PLUGINS='["synaads"]'

This is a JSON array — add alongside any other default plugins.

Verify activation

Check that the plugin is responding:

curl -s -H "X-API-Key: <your-api-key>" \
  http://localhost:8000/api/v1/user/<userId>/plugins/synaads/setup-check

A successful response returns { "success": true, ... } with the plugin's configuration status.

Updating the Plugin

After pulling new changes from this repository:

rm -rf synaplan/plugins/synaads
cp -r synaplan-synaads/synaads-plugin synaplan/plugins/synaads
cd synaplan
docker compose exec backend php bin/console cache:clear

No re-install is needed — the install command only needs to run once per user.

How Auto-Discovery Works

Synaplan's plugin system requires zero core code changes to add a new plugin:

  1. BootKernel::getPlugins() scans /plugins/*/manifest.json for plugin metadata
  2. Autoloading — PSR-4 mapping is registered: Plugin\SynaAds\* resolves to plugins/synaads/backend/*
  3. Services — All classes under backend/ are autowired into Symfony's DI container
  4. Routes — Controller attributes in backend/Controller/ are auto-imported
  5. Security — The public page endpoint (/api/v1/synaads/public/*) is already configured in Synaplan's security.yaml for anonymous access
  6. Per-user gate — Every API call checks BCONFIG P_synaads.enabled = 1 for the requesting user

Configuration

The plugin stores its settings per-user in the Synaplan database. Configure these in the plugin's Settings tab:

Setting Description
Brand name Your company/product name
Brand description Short description for AI context
Logo URL Logo for landing pages
Accent color Brand color for generated pages
CTA target URL Where the call-to-action links to
Privacy policy URL Required for compliance
Imprint URL Required for compliance

API Routes

All endpoints are under /api/v1/user/{userId}/plugins/synaads/:

Method Path Description
GET /setup-check Check plugin installation status
POST /setup Initialize plugin with defaults
GET /config Get plugin configuration
PUT /config Update plugin configuration
GET /dashboard Campaign overview
POST /campaigns Create a new campaign
GET /campaigns List all campaigns
GET /campaigns/{id} Get campaign details
PUT /campaigns/{id} Update campaign
DELETE /campaigns/{id} Delete campaign
POST /campaigns/{id}/generate Generate landing page
POST /campaigns/{id}/generate-media Generate social graphics/video
GET /campaigns/{id}/download Download campaign ZIP

Related Repositories

Repository Description
synaplan Main application
synaplan-platform Production deployment
synaplan-sortx Document sorting plugin
synaplan-extension BroGent browser agent plugin
synaplan-memories AI memory service

License

Apache-2.0

About

Marketing plugin for Synaplan to create Campaigns and material

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors