← All work
Application AI product SaaS NDA · architecture only

PentagonBrief Platform

A paid AI tool that turns a founder's questionnaire into a positioning and go-to-market brief: WordPress sells and stores it, a Python service writes it.

Role
Full stack developer
Year
2025 — now
Stack
Celery · Flask · Python · Redis · Svelte · Woocommerce
Links
Architecture — one report, start to archive
Browser
Client · Svelte Questionnaire app
WordPress
Plugin · sessions pentagon-app-access
Theme · REST WordPress bridge
WooCommerce Orders · private reports
Python service
Service · core Flask / Gunicorn API
Broker · state Redis
Celery workers
API OpenAI
Worker AI workflows
Worker Screenshots
Playwright Competitor sites
Architecture — one report, start to archive: 1. client → access: save draft; 2. client → orders: checkout; 3. client → bridge: start report; 4. bridge → api: signed call; 5. api → redis: guard · enqueue; 6. redis → ai: ai_workflows; redis → shots: screenshots; 7. ai → openai: prompts; shots → web: render; 8. api → bridge: status poll; 9. bridge → orders: archive report
01 — Problem

Minutes of AI work behind a checkout

One brief is a chain of LLM prompts plus screenshots of the customer's competitors. That takes minutes, not a request, it costs money per run, and the result is private customer data. It had to be paid for first, resumable if the tab closes, and archived where it can't expire.

02 — Role & team
  • Python / Flask API and the Celery workflows (AI and screenshot queues)
  • pentagon-app-access plugin: pre-purchase sessions, state machine, optimistic locking
  • WordPress / WooCommerce theme and its REST bridge to the service
  • Svelte questionnaire, prestart and chatbot apps (Vite)
  • Manual release runbook: staging first, systemd workers
03 — Stack
Front end
Svelte Vite SCSS

Three small apps (prestart, questionnaire, chatbot) mounted inside WordPress pages.

CMS · commerce
WordPress WooCommerce PHP

Users, payments and the durable record of every paid report.

AI service
Python Flask Gunicorn

Prompt workflows and response checks live next to the AI code, not in PHP.

Async
Celery Redis Playwright

Long jobs leave the request; Redis holds only running state.

04 — Key decisions
D-01 WordPress keeps the report, Redis only the run
Why

Redis state expires, so a finished report is archived into WordPress as a private file tied to the order.

Trade-off

Archiving waits for the next status poll; a run nobody polls stays in Redis until it does.

D-02 Two queues, two workers
Why

AI workflows and Chromium screenshots run on separate Celery queues, so a slow page render never blocks paid AI work.

Trade-off

Two more systemd services to deploy and watch.

D-03 Sessions as a state machine
Why

The pre-purchase questionnaire is a session with explicit states and optimistic locking, so two tabs can't overwrite each other's answers.

Trade-off

More code than saving answers in user meta.

D-04 Signed calls between PHP and Python
Why

The theme sends an internal token and a request ID; the API rate-limits paid work and rejects replays.

Trade-off

A shared secret to rotate on both servers.