How ananyap-wdw/adtestpro works
Main Components
a) Frontend Layer:
• Web Interface (Templates directory indicates a server-side rendered application)
• Key pages: Dashboard, Persona Generation, Ad Creative Upload, Survey Management
• Templates structure showing the relationship between main pages and partials
b) Backend Layer:
• FastAPI/Python Application (indicated by the app structure)
• Core Processing Modules:
• Persona Generation Engine (audience.py)
• Analysis Engine (analyze.py)
• Experiment Management (experiment.py)
• Data Extraction Service (extract.py)
c) Database Layer:
• PostgreSQL Database (indicated by init-db.sql and alembic migrations)
• Alembic Migration System
d) External Services:
• OpenAI API Integration (mentioned in .env configuration)
• Image Processing Services (for ad creative analysis)
Analysis Pipeline Flow
• Ad Creative Upload → Visual Analysis → Information Extraction
• Target Audience Input → Persona Generation → Focus Group Simulation
• Results Collection → Analysis → Report Generation
Specific Architectural Elements
Key architectural patterns:
• MVC Pattern (evident from the templates and models separation)
• Service-based architecture (src directory structure)
• Prompt-driven processing (prompts directory)
• Database migration system (alembic)
[User Interface Layer]
• ↓
[API Gateway/Router]
• ↓
[Core Services Layer]
• Persona Generation
• Ad Analysis
• Focus Group Simulation
• Results Processing
• ↓
[External Services Layer]
• OpenAI API
• Image Processing
• ↓
[Data Persistence Layer]
Additional Elements
• Docker container boundaries (shown by Dockerfile and docker-compose.yml)
• API endpoints and their relationships
• Database schema references
• Prompt template management system
• Future scalability components (Redis, Celery - mentioned in TODO)
Technical Stack Indicators
• Python 3.11
• FastAPI
• PostgreSQL
• Docker
• OpenAI
• Alembic
This system design should clearly communicate both the current architecture and the planned scalability improvements mentioned in the TODO section.