Skip to main content

AWS S3 (File Storage)

Purpose: Store Lighthouse audit results (JSON), HTML reports, and AI-generated solutions. Library: boto3 Config Variables:
File Structure in S3:
Usage in code: auditor_app/utils/aws_functions.py

AWS SES (Transactional Email)

Purpose: Send transactional emails (legacy — now mostly replaced by Mailersend/Resend). Library: boto3 (SESv2) Config Variables:
Usage in code: auditor_app/utils/aws_functions.py

Mailersend (Primary Email Service)

Purpose: All outgoing transactional emails — OTP verification, scan complete notifications, invites. Library: mailersend Python SDK Config Variables:
Emails Sent: Usage in code: auditor_app/utils/email_sms_functions.py

Resend (Email API)

Purpose: Alternative email service (used for report emails). Config Variables:
Usage: HTTP POST to the API URL with email template data.

Stripe (Payments & Billing)

Purpose: Subscription management, checkout, webhooks, transaction history. Library: stripe Python SDK Config Variables:
Key Operations (auditor_app/utils/stripe_functions.py): Webhook Events Handled at POST /api/stripe/webhook: Webhook Verification:
The webhook endpoint at /api/stripe/webhook does not require JWT auth — it uses Stripe’s signature verification instead. Make sure ENDPOINT_SECRET is set correctly.

Google Gemini AI (Accessibility Solutions)

Purpose: Generate AI-powered code fixes for accessibility issues. Library: google-generativeai Config Variables:
Flow (auditor_app/services/solutions/):
  1. Route POST /api/solutions/ receives an IssueObjectDTO
  2. AccessibilitySolutions class selects the right prompt builder:
    • prompt_for_image_alt() — missing alt text on images
    • prompt_for_label() — missing form labels
    • prompt_for_aria_required_parent() — ARIA parent-child issues
    • prompt_for_common_issue() — fallback for any other rule
  3. Prompt is sent to Gemini API
  4. Response is parsed as JSON: {current_code, correct_code, explanation}
  5. Result is stored in S3 (aws_s3_solution_bucket_name)
  6. Presigned URL returned to frontend (valid for 180 days)
Response Format:

Slack (Internal Notifications)

Purpose: Internal team notifications — new signups, scan completions, errors. Library: slack-sdk Config Variables:
Usage in code: auditor_app/utils/slack_functions.py
Events that trigger Slack messages:
  • New user registration
  • First scan completion
  • Payment events

Google Search Console

Purpose: Fetch organic search performance data for scanned websites. Library: google-auth-oauthlib, google-generativeai Config Variables:
OAuth Flow:
  1. GET /api/search-console/auth → Redirect to Google consent
  2. GET /api/search-console/auth/callback → Exchange code for tokens
  3. Tokens stored in SearchConsoleIntegrationSettings model
  4. GET /api/search-console/ → Use stored tokens to fetch metrics

Lighthouse Scanner (External Service)

Purpose: The actual website crawling and scanning is performed by an external Lighthouse scanner service, not within this backend. Config Variables:
Scan Flow:

Uptime Monitoring (External Service)

Purpose: Monitor website uptime and alert on downtime. Config Variables:
Usage: The backend authenticates with the uptime service and creates monitors on behalf of users. Settings stored in UptimeMonitorSettings model.

Real User Monitoring (External Service)

Purpose: Collect performance metrics from real end-user browsers visiting monitored websites. Config Variables:
Usage: The RUM SDK (VITE_RUM_SDK_URL) is injected into monitored websites. It sends metrics to VITE_RUM_ENDPOINT. The backend fetches and aggregates this data via the RUM API.

OpenTelemetry (Observability)

Purpose: Distributed tracing for requests, database queries, and Redis operations. Library: opentelemetry-sdk, opentelemetry-instrumentation-fastapi Config Variable:
Instrumented:
  • FastAPI HTTP requests (method, path, status, duration)
  • SQLAlchemy queries
  • Redis operations
Not instrumented (excluded):
  • Health check endpoint
  • OpenAPI / Swagger endpoints
If AUDITOR_APP_OPENTELEMETRY_ENDPOINT is not set, observability is disabled.