Skip to content

ayaz7964/AllyCheck

Repository files navigation

AllyCheck - AI-Powered Website Accessibility Scanner

Automated accessibility testing for websites with AI-powered explanations and fix recommendations.

Next.js Gemini AI axe-core License Status


🎯 What is AllyCheck?

AllyCheck is a production-ready web accessibility testing platform that helps developers build inclusive digital experiences. It combines:

  • axe-core - Industry-standard accessibility scanning
  • Puppeteer - Automated browser testing
  • Gemini AI - Natural language explanations of issues
  • Beautiful UI - Modern, accessible results dashboard

✨ Features

Core Scanning

  • βœ… WCAG 2.1 AA compliance checking
  • βœ… Automated issue detection with descriptions
  • βœ… Impact severity classification (Critical/Serious/Moderate/Minor)
  • βœ… HTML code snippets for affected elements

AI-Powered Enhancements

  • πŸ€– AI-generated explanations for each issue
  • πŸ€– Why users are affected (visual, keyboard, screen reader users, etc.)
  • πŸ€– Step-by-step fix recommendations with code examples
  • πŸ€– Best practices to prevent issues
  • πŸ€– Executive summary of overall accessibility
  • πŸ€– Prioritized improvement roadmap

User Experience

  • πŸ“Š Real-time scan progress tracking
  • πŸ“ˆ Accessibility score (0-100%)
  • 🎨 Dark mode support
  • πŸ“± Fully responsive design
  • β™Ώ Accessible UI (WCAG 2.1 AA compliant)
  • πŸ“₯ JSON export of results
  • πŸ”„ Re-scan functionality

Production Ready

  • πŸ”’ Security headers configured
  • ⚑ Rate limiting (10 req/min default)
  • πŸ“ Structured logging system
  • 🚨 Error handling & recovery
  • πŸͺ΅ Request tracking with IDs
  • πŸ”‘ Environment-based configuration

πŸš€ Quick Start

Prerequisites

Installation

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

# Install dependencies
npm install

# Configure environment
cp .env.example .env.local
# Edit .env.local and add your NEXT_PUBLIC_GEMINI_API_KEY

# Run development server
npm run dev

Open http://localhost:3000 in your browser.

Build for Production

npm run build
npm start

πŸ“– Usage

  1. Enter Website URL - Type any website URL (e.g., example.com)
  2. Start Scan - Click "Start Test" button
  3. View Results - See:
    • Overall accessibility score
    • Breakdown by severity (Critical, Serious, Moderate, Minor)
    • Detailed issue explanations
    • AI-powered fix recommendations
    • Improvement roadmap
  4. Export - Download results as JSON for records/CI-CD integration

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js Frontend                  β”‚
β”‚   - Landing page (URL input)        β”‚
β”‚   - Real-time progress modal        β”‚
β”‚   - Results dashboard               β”‚
β”‚   - Dark mode + Accessibility       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Backend API (/api/scan)           β”‚
β”‚   - Rate limiting                   β”‚
β”‚   - Input validation                β”‚
β”‚   - Security headers                β”‚
β”‚   - Error handling                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Scan Services                     β”‚
β”‚   - Puppeteer (browser automation)  β”‚
β”‚   - axe-core (WCAG testing)         β”‚
β”‚   - Gemini AI (explanations)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Configuration

Environment Variables

# Required
NEXT_PUBLIC_GEMINI_API_KEY=your_api_key

# Optional
NODE_ENV=production
NEXT_PUBLIC_APP_NAME=AllyCheck
NEXT_PUBLIC_APP_URL=https://yourdomain.com
NEXT_PUBLIC_SCAN_TIMEOUT=60000
NEXT_PUBLIC_PAGE_LOAD_TIMEOUT=45000
RATE_LIMIT_REQUESTS_PER_MINUTE=10
LOG_LEVEL=info

See .env.example for all options.

πŸ“¦ Project Structure

allycheck/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/scan/route.js          # Main scan endpoint
β”‚   β”‚   β”œβ”€β”€ results/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.jsx               # Results page (Suspense wrapper)
β”‚   β”‚   β”‚   └── ResultsContent.jsx     # Results client component
β”‚   β”‚   β”œβ”€β”€ layout.js                  # Root layout with metadata
β”‚   β”‚   └── page.js                    # Home/landing page
β”‚   β”œβ”€β”€ component/
β”‚   β”‚   └── LandingPage.jsx            # URL input & progress modal
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ accessibilityScanner.js    # Puppeteer + axe-core
β”‚   β”‚   β”œβ”€β”€ gemini.js                  # Gemini AI API
β”‚   β”‚   β”œβ”€β”€ logger.js                  # Structured logging
β”‚   β”‚   └── rateLimiter.js             # Rate limiting service
β”‚   └── Test/
β”‚       └── page.jsx                   # Test page (can be deleted)
β”œβ”€β”€ .env.example                        # Environment template
β”œβ”€β”€ DEPLOYMENT.md                       # Production guide
β”œβ”€β”€ next.config.mjs                     # Next.js config
β”œβ”€β”€ package.json                        # Dependencies
└── README.md                           # This file

πŸ” Security

  • API Key: Stored in environment variables, never exposed to client
  • Rate Limiting: 10 requests/minute per IP (configurable)
  • Input Validation: URL format checked, timeout protection
  • Security Headers: XSS, Clickjacking, Content-Type protections
  • Error Messages: Safe, non-revealing error responses
  • Request Tracking: All scans logged with request IDs

πŸ“Š Performance

  • Average scan time: 10-30 seconds (depends on site complexity)
  • AI explanation generation: 5-15 seconds per violation
  • Memory usage: ~200-500MB per scan (Puppeteer)
  • Network calls: 3 API calls per full scan (axe-core, explanations, summary/plan)

Recommendation: 2GB+ RAM for production deployments

πŸš€ Deployment

Vercel (Recommended)

npm install -g vercel
vercel
# Add NEXT_PUBLIC_GEMINI_API_KEY in environment variables
vercel deploy --prod

Docker

docker build -t allycheck .
docker run -p 3000:3000 -e NEXT_PUBLIC_GEMINI_API_KEY=key allycheck

Other Platforms

See DEPLOYMENT.md for AWS, GCP, Digital Ocean, etc.

πŸ› Troubleshooting

Build Error: "useSearchParams() should be wrapped in a suspense boundary"

Fixed! Results page now uses proper Suspense wrapper.

Gemini API Errors

  1. Verify API key is correct
  2. Ensure Gemini API is enabled in Google Cloud
  3. Check quota limits

Timeout on Slow Websites

Configure in .env.local:

NEXT_PUBLIC_PAGE_LOAD_TIMEOUT=60000
NEXT_PUBLIC_SCAN_TIMEOUT=90000

High Memory Usage

  • Ensure 2GB+ RAM available
  • Consider implementing queue system for high-traffic scenarios
  • Implement caching for frequently scanned sites

πŸ“š API Reference

POST /api/scan

Scans a website for accessibility violations.

Request:

{
  "url": "https://example.com"
}

Response (200 OK):

{
  "requestId": "scan-1234567890",
  "url": "https://example.com",
  "violations": [...],
  "passes": [...],
  "summary": "AI-generated executive summary",
  "improvementPlan": "AI-generated roadmap",
  "stats": {
    "total": 15,
    "critical": 2,
    "serious": 5,
    "moderate": 8,
    "minor": 0
  },
  "timestamp": "2025-02-07T10:30:00.000Z"
}

πŸ“ Production Checklist

  • Security headers configured
  • Rate limiting implemented
  • Error handling in place
  • Logging system set up
  • Environment variables for secrets
  • Input validation on all endpoints
  • API timeout protection
  • Browser safety (sandboxing)
  • Dark mode support
  • Accessibility compliant UI
  • JSON export feature
  • Request ID tracking
  • Suspense boundaries for dynamic content
  • Next.js build optimization

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ‘₯ Team

AllyCheck Team - Building accessible digital experiences


Made with β™Ώ accessibility in mind

Read Full Deployment Guide β†’

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors