Skip to content

Repository files navigation

ADA WCAG Scanner (Monorepo)

Accessibility scanning SaaS for ADA/WCAG workflows.
This repo is a Turborepo monorepo with:

  • a Next.js web app (apps/web)
  • a worker app (apps/worker)
  • shared scanner/types utilities (packages/shared)

Current MVP flow is web-first: core scan and AI routes run from apps/web.
Worker/queue deployment is phase-based and can be added when you enable background processing.

1) Project Overview

  • Purpose: scan websites for accessibility issues and provide fix guidance.
  • Primary stack: Next.js + TypeScript + Drizzle + Neon Postgres.
  • Shared package: @shared/types is consumed by both web and worker.
  • Active API routes in web app now:
    • POST /api/scan
    • POST /api/fix-guide
    • POST /api/ai-scan

2) Monorepo Structure

apps/
  web/        # Next.js app + API routes
  worker/     # Queue/worker app (phase-based)
packages/
  shared/     # Shared types/scanner/scoring utilities (@shared/types)
docs/
  PROJECT.md  # Architecture and project context
  PHASES.md   # Phase-by-phase implementation plan

3) Prerequisites

  • Node.js >=20 (see root package.json and .nvmrc)
  • npm (workspace-aware; repo uses npm workspaces)
  • Optional but recommended for full setup:
    • Neon Postgres account
    • Redis provider (Railway Redis / Upstash) for queue phases

4) Quick Start

git clone <your-repo-url>
cd ada-wasg-test
npm install

Create local env file:

cp .env.example .env.local

Start dev mode (all workspaces via turbo):

npm run dev

Open:

  • Web app: http://localhost:3000

5) Environment Variables

Copy from .env.example and fill what you need for your current phase.

Core / Local Web

Variable Required Now Notes
DATABASE_URL Yes (for DB-backed routes) Neon pooled connection string
NEXTAUTH_SECRET For auth flows NextAuth secret
NEXTAUTH_URL Yes Local default is http://localhost:3000
APP_URL Yes Used by report-related flows; local default http://localhost:3000

Phase 2 (Queue)

Variable Required Notes
REDIS_URL When queue/worker is enabled Redis connection URL

Phase 3 (AI)

Variable Required Notes
ANTHROPIC_API_KEY Optional (future model routing)
OPENAI_API_KEY Optional fallback
WAVE_API_KEY Optional Enables WAVE checks when used
DISABLE_INSECURE_TLS_FALLBACK Optional Local/dev only toggle for /api/ai-scan TLS retry behavior

Phase 4 (Storage)

Variable Required Notes
BLOB_READ_WRITE_TOKEN When PDF/blob flow is enabled Vercel Blob token

Phase 5 (Billing + Email)

Variable Required Notes
STRIPE_SECRET_KEY When billing enabled
STRIPE_WEBHOOK_SECRET When billing enabled
RESEND_API_KEY When email enabled

6) Database Setup (Drizzle + Neon)

drizzle.config.ts points to:

  • schema: ./apps/web/src/db/schema.ts
  • output: ./drizzle

Run migrations:

npm run db:generate
npm run db:migrate

Optional DB studio:

npm run db:studio

7) Run Commands

Root (Turborepo):

npm run dev
npm run build
npm run test
npm run lint

Workspace-specific:

# web
npm run dev --workspace=@app/web
npm run build --workspace=@app/web
npm run lint --workspace=@app/web

# worker
npm run dev --workspace=@app/worker
npm run build --workspace=@app/worker
npm run lint --workspace=@app/worker
npm run test --workspace=@app/worker

8) Current Runtime Behavior

  • apps/web is the active runtime for scanning and AI routes in the current setup.
  • apps/worker exists for queue/background architecture and is phase-based.
  • packages/shared (@shared/types) is shared by both apps to keep scanner/types logic consistent.

9) Deployment Blueprint

Recommended production split:

  1. apps/web -> Vercel
  2. apps/worker -> Railway
  3. Postgres -> Neon
  4. Redis -> managed Redis (Railway/Upstash)

Deployment model:

  • One GitHub repository
  • Separate deploy targets per app (apps/web and apps/worker)
  • Shared code (packages/shared) comes from the same commit for both services

Start-cheap path:

  • Deploy only apps/web first (if queue/worker is not enabled yet)
  • Add worker + Redis when you move to background scan execution

10) Troubleshooting

/api/ai-scan TLS/certificate fetch error

If you see a certificate-chain error like local issuer issues during HTML fetch, this project includes a dev-friendly fallback retry path for non-production.
If needed, set:

DISABLE_INSECURE_TLS_FALLBACK=false

Never disable TLS verification behavior in production.

next lint asks interactive setup on first run

In a fresh setup, next lint may prompt for ESLint initialization in apps/web. Complete that once, then rerun lint commands.

Common env issues

  • Missing DATABASE_URL: DB routes/migrations fail.
  • Missing AI keys: AI endpoints return configuration errors.
  • Incorrect NEXTAUTH_URL or APP_URL: auth/report-related behavior can break.

11) Screenshots

Main:

Main UI

Recent scan:

Recent Scan

Scan result:

Scan Result

Scan result (detail):

Scan Result Detail

12) Scan Result PDF

13) Deeper Docs

About

AI-powered ADA/WCAG compliance scanner built with Next.js and TypeScript, featuring automated accessibility audits, actionable fix guides, and agency-ready reporting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages