No description
Find a file
Vadym Samoilenko a3680f6c64 Fix logo URL path: ensure slash between BASE_URL and filename
BASE_URL may not have a trailing slash (e.g. /barclays-banner-builder),
causing the logo src to be /barclays-banner-buildercopygen-barclays-logo.png.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 16:21:16 +01:00
.claude Implement 6-format banner spec, fix CTA colours, add custom sizes 2026-04-28 22:28:56 +01:00
apache Add full Sprint 0+1 implementation: Docker, FastAPI, React, RAG, deploy 2026-04-17 12:01:42 +01:00
assets/illustrations AC3 in-situ banner visualisation — Medium/Large model, icons, themes, BannerPreview 2026-04-28 20:30:43 +01:00
backend Disable auth for testing (AUTH_BYPASS=True) 2026-05-10 16:13:31 +01:00
deploy Fix Apache config: use <Location> for ProxyPass, FallbackResource for SPA 2026-04-17 12:53:11 +01:00
Design Assets/Illustrations Implement 6-format banner spec, fix CTA colours, add custom sizes 2026-04-28 22:28:56 +01:00
Display Banner - Prompts and RAG Implement 6-format banner spec, fix CTA colours, add custom sizes 2026-04-28 22:28:56 +01:00
docs Add Oliver rebrand, character counts, delete variants, 6-format spec validation 2026-05-10 15:35:25 +01:00
frontend Fix logo URL path: ensure slash between BASE_URL and filename 2026-05-10 16:21:16 +01:00
rag-corpus Add full Sprint 0+1 implementation: Docker, FastAPI, React, RAG, deploy 2026-04-17 12:01:42 +01:00
.env.example Add full Sprint 0+1 implementation: Docker, FastAPI, React, RAG, deploy 2026-04-17 12:01:42 +01:00
.gitignore Remove tsconfig.tsbuildinfo from tracking, add to .gitignore 2026-04-28 22:37:24 +01:00
AGENTS.md Add Oliver rebrand, character counts, delete variants, 6-format spec validation 2026-05-10 15:35:25 +01:00
CLAUDE.md Add full Sprint 0+1 implementation: Docker, FastAPI, React, RAG, deploy 2026-04-17 12:01:42 +01:00
CopyGen BMB App Banner Visualiser Requirements.docx Implement 6-format banner spec, fix CTA colours, add custom sizes 2026-04-28 22:28:56 +01:00
deploy.sh Fix deploy.sh: target sites-enabled, not sites-available 2026-04-17 12:57:52 +01:00
docker-compose.prod.yml Mount rag-corpus/ into api and worker containers 2026-04-17 12:22:03 +01:00
docker-compose.yml Mount rag-corpus/ into api and worker containers 2026-04-17 12:22:03 +01:00
README.md Add README with setup, deploy, and project structure 2026-04-17 12:03:04 +01:00

Barclays BMB Banner Visualiser

AI-powered banner creation tool for Barclays Mobile Banking campaign managers.

Brief → compliant copy variants → DAM image + icon → in-situ preview → PDF contact sheet + Workfront CSV

Live: https://optical-dev.oliver.solutions/barclays-banner-builder/


Stack

Layer Tech
Frontend React 18 + Vite + TypeScript + TailwindCSS + shadcn/ui
Backend FastAPI (Python 3.12) + SQLAlchemy 2.0 async
Queue RQ + Redis (HTTP polling — no WebSocket)
DB PostgreSQL 16 + pgvector
AI OpenAI gpt-5.4-mini + text-embedding-3-small (RAG)
PDF WeasyPrint
Deploy Docker Compose + Apache reverse proxy

Quick start (dev)

cp .env.example .env
# Set OPENAI_API_KEY in .env

docker compose up -d --build
docker compose exec api alembic upgrade head
docker compose exec api python scripts/seed_admin.py
docker compose exec api python scripts/ingest_rag.py
docker compose exec api python scripts/index_icons.py

Deploy (Ubuntu + Apache)

# Clone once:
git clone <repo> /opt/barclays-banner-builder

# Every deploy (idempotent):
bash /opt/barclays-banner-builder/deploy.sh

# Options:
bash deploy.sh --reindex        # force re-embed RAG + icons
bash deploy.sh --skip-frontend  # backend-only update

The script handles: Docker build (with cache), DB migrations, first-run seeding, npm build, Apache config patching.


Key rules

  • No WebSocket — all async work uses POST → 202 + job_id → GET /api/jobs/{id} polling
  • OpenAI only — model gpt-5.4-mini, key in .env only (never committed)
  • System prompt editable from /admin — full version history kept for FCA audit
  • Character limits enforced server-side — short_title ≤ 32, long_body ≤ 128, cta ≤ 50
  • DAM mock mode — if ADOBE_DAM_API_BASE_URL is empty, mock client is used automatically

Project structure

backend/app/
  api/         — FastAPI routers
  models/      — SQLAlchemy models
  services/    — copy_generation, exporter, adobe_dam_client
  llm/         — OpenAI client wrapper
  rag/         — pgvector cosine retrieval
  workers/     — RQ tasks (generate_copy, render_pdf)
  prompts/     — system_prompt.md (initial seed)

frontend/src/
  pages/       — BriefEditor, VariantsGrid, BannerEditor, ExportPage, AdminPage, LoginPage
  lib/         — jobPolling.ts
  store/       — Zustand auth store

rag-corpus/    — Consumer Duty, Consumer Understanding, Regulators .docx
assets/        — illustrations/ (PNG icons) + templates/
deploy/        — apache-barclays.conf (Apache Include fragment)
scripts/       — index_icons.py, ingest_rag.py, seed_admin.py