How dilip-sheesh/creativerse-rocketium works
1. Overall shape
- This repository is a server-rendered Flask application for automated ad compliance review.
- The core architecture is a simple pipeline: web upload → image analysis → LLM-based policy review → HTML result page.
2. Entry point and app boundary
- run.py is the runtime entrypoint.
- The actual Flask app lives under app/, which separates configuration, route handlers, services, templates, and static assets.
- There is also a top-level routes.py, but the main application structure is clearly organized in app/routes/*.
3. UI / presentation layer
- The frontend is built with server-side HTML templates in app/templates/.
- There are two main user flows reflected in the templates:
- company/* for company/brand-guideline review
- design/* for design/project review
- app/static/styles.css provides styling, and uploaded images are stored under app/static/uploads/.
4. Route organization
- app/routes/main.py likely handles the landing page and shared navigation.
- app/routes/company.py and app/routes/design.py split the application into two domain-specific workflows.
- The route layer is the orchestration boundary: it receives uploads, calls services, and renders results.
5. Review pipeline
- The app’s main data flow starts when a user uploads an ad creative through one of the review forms.
- The uploaded image is processed by an AWS vision step first, then passed into an LLM review step.
- The output is a structured compliance report containing a score, violations, and a safe / not safe verdict.
6. Computer vision / OCR subsystem
- app/services/rekognition_service.py encapsulates AWS Rekognition usage.
- This service is responsible for extracting image content such as text, labels, and likely object-level cues from the ad creative.
- This layer is the vision boundary between raw image input and language-model reasoning.
7. LLM review subsystem
- app/services/bedrock_services.py encapsulates AWS Bedrock integration.
- The readme says it uses Meta Llama 3 to evaluate the ad against brand and platform rules.
- This service is where extracted visual/textual evidence plus guideline text are turned into a structured compliance decision.
8. Guidelines and policy data
- app/static/guidelines/ad_guidelines.csv is a local policy artifact used as the review reference.
- The app appears to combine brand guidance and platform rules such as Facebook/Google/Instagram-style constraints.
- This CSV is an important domain input, not just static content.
9. Domain-specific templates and outputs
- The company templates include pages like requirements_display, submission_details, review, and result, suggesting a workflow focused on submitting and evaluating company requirements.
- The design templates include ongoing_projects, upload, review, and result, suggesting a workflow for design teams to submit creatives and track review status.
- Both flows converge on the same core review engine, but present different UX around it.
10. State and storage
- The repo does not show a database layer.
- State appears to be mostly local and file-based: uploaded files, guideline CSVs, and rendered results.
- That means the architecture is lightweight and likely stateless across requests aside from filesystem artifacts.
11. External dependencies
- The two material external services are:
- AWS Rekognition for image text/label extraction
- AWS Bedrock for compliance reasoning and structured feedback
- boto3 is the AWS SDK glue between the Flask app and those services.
- Pillow is present for image handling.
12. What to draw in an architecture diagram
- Draw three layers: Flask routes/UI, service layer, and AWS dependencies.
- Show the image upload entering the Flask route layer, flowing into Rekognition, then Bedrock, then back to rendered HTML results.
- Include the guideline CSV as a local policy input feeding the review logic.
- Treat company and design as two front-door workflows sharing the same backend review pipeline.
Main entry points: company.py company routes · design.py design routes · __init__.py app · main.py main routes
Components 24
App Core
Flask package, routing, and services
- app · Application package boundary and setup
AdReview/app/__init__.py - config · Runtime configuration and environment settings
AdReview/app/config.py - routes.py · Top-level routing module / compatibility boundary
AdReview/routes.py - main routes · Shared landing page and navigation
AdReview/app/routes/main.py - company routes · Brand-guideline submission and review flow
AdReview/app/routes/company.py - design routes · Creative upload and project review flow
AdReview/app/routes/design.py - Rekognition · Extracts text and labels from uploaded creatives
AdReview/app/services/rekognition_service.py - Bedrock · Runs policy reasoning and structured compliance review
AdReview/app/services/bedrock_services.py
Company UI
Company/brand-guideline review screens
- company home · Company workflow landing page
AdReview/app/templates/company/index.html - requirements · Displays company requirements and guidelines
AdReview/app/templates/company/requirements_display.html - submission · Shows submission details before review
AdReview/app/templates/company/submission_details.html - company review · Company review form and evidence summary
AdReview/app/templates/company/review.html - company result · Final compliance result page
AdReview/app/templates/company/result.html
Design UI
Design/project review screens
- design home · Design workflow landing page
AdReview/app/templates/design/index.html - projects · Lists ongoing design projects
AdReview/app/templates/design/ongoing_projects.html - upload · Creative upload form
AdReview/app/templates/design/upload.html - design review · Design review form and evidence summary
AdReview/app/templates/design/review.html - design result · Final review outcome page
AdReview/app/templates/design/result.html
Assets
Static files, uploads, and policy data
- guidelines CSV · Local ad rules and brand guidance reference
AdReview/app/static/guidelines/ad_guidelines.csv - styles.css · Shared server-rendered UI styling
AdReview/app/static/styles.css - uploads · Persisted uploaded ad creatives
AdReview/app/static/uploads
AWS Services
Managed vision and LLM dependencies
- AWS Rekognition · Managed image analysis service
- AWS Bedrock · Managed LLM reasoning service
Connections 28
- run.py → app: boot app · Launches the Flask package
- app → config: loads config · Initializes app settings
- app → main routes: registers · Attaches shared routes
- app → company routes: registers · Attaches company workflow routes
- app → design routes: registers · Attaches design workflow routes
- routes.py → main routes: dispatches · Top-level route boundary forwards to app routes
- main routes → company home: renders · Shows company entry page
- main routes → design home: renders · Shows design entry page
- company routes → requirements: renders · Displays policy/requirements context
- company routes → submission: renders · Shows submission details
- company routes → company review: renders · Presents company review UI
- company routes → company result: renders · Displays final compliance result
- design routes → projects: renders · Shows project list
- design routes → upload: renders · Presents upload form
- design routes → design review: renders · Presents design review UI
- design routes → design result: renders · Displays final outcome
- company routes → uploads: reads/writes · Stores uploaded creatives and artifacts
- design routes → uploads: reads/writes · Stores uploaded creatives and artifacts
- company routes → guidelines CSV: uses policy · Loads local review criteria
- design routes → guidelines CSV: uses policy · Loads local review criteria
- company routes → Rekognition: analyzes image · Extracts visual evidence from uploads
- design routes → Rekognition: analyzes image · Extracts visual evidence from uploads
- Rekognition → AWS Rekognition: calls · Delegates image analysis to AWS
- company routes → Bedrock: reviews · Generates compliance decision
- design routes → Bedrock: reviews · Generates compliance decision
- Bedrock → AWS Bedrock: calls · Delegates reasoning to AWS LLM service
- company routes → styles.css: styles · Shared page styling
- design routes → styles.css: styles · Shared page styling