Codebase Map

Presentation Intelligence Tool v2.1
CLIENT FLASK ROUTES PROCESSING AI CLIENT AI PROVIDERS STORAGE

Technology Stack

Core

  • LanguagePython 3.12+
  • FrameworkFlask 3.0
  • WSGI ServerWerkzeug 3.0
  • Package ManagerUV (recommended)
  • Configpython-dotenv 1.0

Document Processing

  • PDF ParsingPyMuPDF (fitz) 1.24+
  • PPTX Parsingpython-pptx 0.6.23
  • Web ScrapingBeautifulSoup4 4.12+
  • HTTP Clientrequests 2.31+
  • Image SupportPillow 10.0

AI Providers

  • Anthropicanthropic 0.40+
  • OpenAIopenai 1.0+
  • Googlegoogle-generativeai 0.3+
  • Ollamaollama 0.1+ (local)
  • xAIopenai 1.0+ (compat)

Output Generation

  • Markdownmarkdown2 2.4.10
  • PDF RenderingWeasyPrint 61.0+
  • TemplatesJinja2 (Flask built-in)

Frontend

  • TemplatesJinja2 HTML
  • StylingCustom CSS
  • JSVanilla (minimal)
  • Pagesindex.html, results.html

Infrastructure

  • StorageLocal filesystem
  • DatabaseNone (stateless)
  • AuthNone (local use)
  • Max Upload50 MB
  • Port5000

User Journeys

Journey 1: Analyze Presentation via Web UI

User Action
Opens browser to http://localhost:5000
GET /
Flask renders the upload form
app.py:54 → templates/index.html
User Action
Fills in title, presenters, notes, selects analysis template, uploads PDF/PPTX + optional transcript, adds resource URLs
POST /analyze
Validates form, saves uploaded files to uploads/, determines content sources
app.py:60-359
extract_content()
Routes to PDF/PPTX/TXT/VTT extractor based on file type. Extracts text, page counts, speaker notes.
utils/document_parser.py:208-232
fetch_multiple_urls()
Fetches each resource URL, strips HTML with BeautifulSoup, returns cleaned text (max 10k chars/URL)
utils/web_scraper.py:100-161
load_prompt_template()
Reads selected JSON template from prompts/ directory (presales_engineer, network_engineer, or security_analyst)
utils/prompt_loader.py:54-78
analyze_presentation()
Builds prompt from template + context, initializes AI client, sends for generation
utils/ai_analyzer.py:108-180
AIClient.generate()
Dispatches to configured provider (Anthropic/OpenAI/Google/Ollama/xAI), returns response text
utils/ai_client.py:111-148
create_outputs()
Generates formatted Markdown file, then converts to styled PDF via WeasyPrint. Saves both to outputs/
utils/output_generator.py:185-225
Render results.html
Displays analysis with metadata, download buttons for MD and PDF. Client-side JS renders markdown formatting.
templates/results.html
User Action
Reviews analysis, clicks Download Markdown or Download PDF
GET /download/<type>/<file>
Serves file from outputs/ directory as attachment download
app.py:362-385

Journey 2: Analyze via REST API

API Client
Sends POST /api/v1/analyze with JSON body: title, presenters, notes, resource_urls, prompt_template
POST /api/v1/analyze
Validates JSON fields, checks Content-Type, ensures resource_urls array has at least one URL
app.py:417-552
fetch_multiple_urls()
Fetches all resource URLs, collects successes and failures
utils/web_scraper.py:100-161
analyze_presentation()
Builds prompt, calls AI provider, returns raw response
utils/ai_analyzer.py:108-180
AIClient.generate()
Calls configured AI provider API
utils/ai_client.py:111-148
JSON Response
Returns {success, analysis, metadata, warnings} as JSON. No file output for API route.
app.py:524-545

Journey 3: Browse Available Templates

API Client
Sends GET /api/v1/prompts
GET /api/v1/prompts
Calls prompt loader to list available templates
app.py:394-414
get_available_prompts()
Scans prompts/ directory, reads each JSON file, returns list of {id, name, description}
utils/prompt_loader.py:17-51
prompts/*.json
Reads presales_engineer.json, network_engineer.json, security_analyst.json
prompts/
JSON Response
Returns {success: true, prompts: [{id, name, description}, ...]}