How humzah-kiani/fca_marketing_app works
This Streamlit application drafts financial-promotion copy grounded in cached FCA guidance, validates it, and records each generation for later review. Advisers can also create visual posts, inspect generation history, and run a compliance monitor that flags posts tied to outdated guidance. The main flow is visible in the app and sampled modules; monitor fetching and database behavior are also sampled. The design editor’s internal UI details and some app routes are only partially excerpted, so the graph omits uncertain wiring.
Main entry points: app.py Streamlit app · db.py Database access · generator.py Copy generation · compliance_validator.py Copy validation
Components 13
Drafting and Design
- Streamlit app
app.py - Copy generation
generator.py - Visual post editor
post_studio.py
Compliance Monitoring
- Copy validation
compliance_validator.py - FCA reference cache
fca_monitor.py - Change detection
fca_monitor.py - Scheduled checks
monitor_cli.py
Persistence
- PostgreSQL
schema.sql - Database access
db.py
External Services
- FCA pages and PDFs
- Google Gemini
- Ollama service
Other components
- Financial adviser
Connections 21
- Financial adviser → Streamlit app: provides request
- Streamlit app → Copy generation: requests drafts
- Copy generation → FCA reference cache: reads guidance
- Copy generation → Google Gemini: generates with
- Copy generation → Ollama service: generates with
- Copy generation → Streamlit app: returns drafts
- Streamlit app → Copy validation: validates drafts
- Copy validation → FCA reference cache: reads guidance
- Copy validation → Google Gemini: reviews with
- Copy validation → Ollama service: reviews with
- Copy validation → Streamlit app: returns review
- Streamlit app → Database access: stores batches
- Streamlit app → Database access: reads history
- Streamlit app → Visual post editor: opens editor
- Streamlit app → Change detection: runs check
- Scheduled checks → Database access: initializes tables
- Scheduled checks → Change detection: runs check
- Change detection → FCA pages and PDFs: fetches guidance
- Change detection → Database access: reads and updates
- FCA reference cache → Database access: reads cached text
- Database access → PostgreSQL: queries and writes