Skip to content

Repository files navigation

OptiSight

AI-powered RGAA accessibility and SEO auditing tool. This web application automatically crawls websites, analyzes each page with Lighthouse and pa11y, then uses an LLM (Mistral AI) to generate a synthesis report with actionable recommendations.

Features

  • Automated crawling — Page discovery via a configurable BFS crawler (max pages, depth, delay)
  • Lighthouse analysis — Performance, accessibility, SEO and best practices scores for each page
  • RGAA/WCAG auditing — Accessibility error and warning detection via pa11y (WCAG 2.1 AA)
  • AI-powered analysis — Summary and prioritized recommendations generated by a configurable LLM (Mistral, OpenAI, etc.)
  • Per-page AI analysis — Detailed per-page analysis with streaming progress and relaunch capability
  • Real-time streaming — Live analysis progress display via Server-Sent Events
  • PDF & Markdown export — Report generation via Dompdf and Markdown export
  • MCP Server — Model Context Protocol server for AI agent integration (Cursor, Claude Desktop, etc.)
  • Multi-authentication — SQL, CAS and OpenID Connect support
  • Protected site crawling — Cookie-based and form-based (Puppeteer) authentication for restricted sites
  • User management — CRUD with role assignment (ROLE_USER, ROLE_ADMIN, ROLE_MASTER)

Tech Stack

Component Technology
Backend PHP 8.2+, Symfony 7.2
Database MariaDB (Doctrine ORM 3.3)
Frontend Bootstrap 5, jQuery, DataTables, Chart.js
Auditing Google Lighthouse, pa11y (WCAG 2.1 AA)
AI Configurable provider (Mistral, OpenAI, etc.)
Authentication SQL, CAS (Apereo phpCAS), OpenID Connect
Protected sites Cookie auth (manual) or form-based auth (Puppeteer-core)
Containerization Docker, Docker Compose

Prerequisites

  • Docker and Docker Compose (recommended installation)
  • PHP 8.2+ and Composer (for local development)
  • Node.js and npm (for Lighthouse and pa11y)

Installation

With Docker (recommended)

# Clone the repository
git clone <repository-url>
cd optisight

# Configure the environment
cp .env .env.local
# Edit variables in .env.local (AI_API_KEY, BASE_URL, etc.)

# Start the services
docker compose up -d

The application is available at http://localhost:8025. Adminer (database admin) is available at http://localhost:6025.

Local development

# Install PHP dependencies
composer install

# Create the database schema
php bin/console doctrine:schema:create --force

# Create the admin user
php bin/console app:init

# Start the development server
symfony serve

Configuration

Default values are defined in .env. All variables can be overridden by creating a .env.local file (not versioned). This includes database credentials, authentication settings, audit parameters, and AI provider configuration.

Variable Description Default
DATABASE_URL Database connection string mysql://user:changeme@mariadb:3306/optisight
MODE_AUTH Authentication mode (SQL, CAS, OIDC) SQL
CRAWL_MAX_PAGES Maximum number of pages to crawl 500
CRAWL_MAX_DEPTH Maximum crawl depth 10
CRAWL_DELAY_MS Delay between requests (ms) 1000
PA11Y_STANDARD Accessibility standard WCAG2AA
AI_PROVIDER AI provider name mistral
AI_MODEL LLM model name mistral-small-latest
AI_API_KEY AI provider API key changeme
AI_BASE_URL AI provider API endpoint https://api.mistral.ai/v1
CHROME_BINARY Path to Chrome/Chromium binary (for Puppeteer auth) /usr/bin/chromium
CAS_* CAS authentication settings see .env
OIDC_* OpenID Connect settings see .env

Usage

Audit workflow

  1. Create a site — Enter a root URL, a name, and optionally configure authentication for protected sites
  2. Start the crawl — Automatic page discovery (with authentication if configured)
  3. Run the analysis — Execute Lighthouse and pa11y on each page
  4. Generate AI synthesis — Global summary and recommendations via AI
  5. Per-page AI analysis — Drill into individual pages for detailed AI analysis (click "Analyser cette page avec l'IA")
  6. View results — Detailed scores per page, accessibility errors, SEO metadata
  7. Export to PDF — Download the full report

Protected sites

The tool supports auditing sites that require authentication:

  • Cookie mode — Manually provide a cookie header value (works with SSO, 2FA, any authentication mechanism)
  • Form mode — Automated login via Puppeteer-core: specify a login URL, form field selectors, and credentials

To use cookie mode, open your browser's developer tools, copy the Cookie header value, and paste it in the site's authentication form.

Form mode requires a headless Chrome/Chromium binary accessible via CHROME_BINARY (default: /usr/bin/chromium).

Per-page AI analysis

From a page report view, you can launch an individual AI analysis that considers the page's specific Lighthouse scores, accessibility errors, and RGAA violations. Results are streamed in real time and persisted for future viewing.

MCP Server

Optiight exposes a Model Context Protocol (MCP) server for AI agent integration. Configure your AI agent (Cursor, Claude Desktop, etc.) to connect to Optiight and query audit data programmatically.

Endpoint: POST /mcp

Authentication: Bearer token via Authorization header

Available tools:

Tool Description
optisight.sites.list List all sites
optisight.site.get Get site details
optisight.audits.list List audits (optionally filtered by siteId)
optisight.audit.get Get audit details with scores
optisight.audit.trigger Trigger a new audit for a site
optisight.pages.list List all pages of an audit
optisight.page.get Get detailed page analysis
optisight.page.analyze Re-run Lighthouse + RGAA on a page
optisight.page.ai_analyze Re-run AI analysis on a page
optisight.ai.summary Get AI summary of an audit
optisight.ai.trigger Generate AI summary for an audit

API Keys management: Navigate to MCP > Clés API in the navigation menu to create, view, and revoke API keys.

Example curl request:

# Initialize MCP connection
curl -X POST http://localhost:8027/mcp/initialize \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'

# List sites
curl -X POST http://localhost:8027/mcp \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"optisight.sites.list","arguments":{}}}'

Console commands

# Application initialization (create admin)
php bin/console app:init

# Crawl a site
php bin/console app:crawl <site_id>

# RGAA + Lighthouse analysis
php bin/console app:rgaa <analysis_id>

# AI synthesis
php bin/console app:ai <analysis_id>

# Full analysis pipeline
php bin/console app:run-analysis <site_id>

# Assign roles
php bin/console app:role <username> <role>

Project Structure

src/
├── Command/          # Console commands (crawl, analysis, AI, etc.)
├── Controller/       # Web controllers (audit, admin, upload, stream)
├── Entity/           # Doctrine entities (Site, Analysis, PageReport, AiSummary, User)
├── Repository/       # Doctrine repositories
├── Security/         # Dynamic authentication (SQL/CAS/OIDC)
├── Service/          # Business services (Crawler, Lighthouse, pa11y, AI, Image)
├── Form/             # Forms
└── EventListener/    # Event listeners
templates/            # Twig templates
config/               # Symfony configuration
migrations/           # Doctrine migrations
misc/docker/          # Dockerfile and Apache config

Code Quality

# Static analysis (PHPStan level 6)
vendor/bin/phpstan analyse

# Fix code style
vendor/bin/php-cs-fixer fix

# Unit tests
vendor/bin/phpunit

License

Proprietary — All rights reserved.

About

AI-powered RGAA accessibility and SEO auditing tool. This web application automatically crawls websites, analyzes each page with Lighthouse and pa11y, then uses an LLM (Mistral AI) to generate a synthesis report with actionable recommendations.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages