Skip to content

Repository files navigation

a-audit Banner

πŸš€ ARENA BUILDER v2.0

Universal Audit & App Prompt Builder Β· 100% Client-Side

Refactored & Modernized to TypeScript + React 19 + Tailwind v4 + Clean Modular Architecture

React 19 TypeScript Tailwind CSS v4 Vite Vitest License: MIT

🌐 LIVE ON GITHUB PAGES β€’ πŸ“– ARCHITECTURE LABS


πŸ›οΈ Executive Refactoring & Code Modernization Overview

Under the Refactoring & Code Modernization Directive (July 28, 2026), Arena Builder (a-audit) has been transformed from a legacy 3,412-line monolithic HTML/JavaScript single file into a clean, modular, production-grade TypeScript + React 19 + Tailwind CSS v4 single-page web application.

Key Architectural Improvements:

  1. 100% Behavioral Parity & Zero Breaking Changes: All 15 audit categories, 14 expert roles, 6 required deliverables, advanced generation rules, quick presets (master, seo, aso, perf), target type detection, and shareable URL query syncing (?t=...&y=...) were preserved with zero regressions.
  2. Clean Modular Domain Layer (src/domain/):
    • Extracted all constants (TYPES, CATEGORIES, ROLES, DELIVERABLES, ADVANCED, PRESET_DEFS) into strongly-typed data structures (src/domain/constants.ts).
    • Isolate file-type inference and local evidence manifest analysis in src/domain/fileIntel.ts.
    • Created a 100% pure, deterministic prompt builder engine (src/domain/promptBuilder.ts) with zero DOM side-effects and zero global mutable variables.
  3. Strict Type Safety (src/types/index.ts): Replaced implicit any types and DOM lookups with strict TypeScript interfaces for BuilderState, TargetTypeId, AppMode, ResolvedType, and PromptResult.
  4. Automated Regression Verification (src/tests/): Established a Vitest + @testing-library/react 20-test suite covering Audit mode, Create App mode, Refactor mode, file-type inference, subdomain vs reverse-TLD package detection, shareable URL query syncing, and UI mode switching.
  5. Zero-Vulnerability Security Posture & Accessibility: Upgraded dependencies to eliminate VM Context Escape CVEs (0 vulnerabilities in npm audit), enhanced reverse-TLD package regex matching (com.company.app), and added a WCAG 2.2 AA compliant Skip-to-Main-Content keyboard link.
  6. Offline-First Service Worker (sw.js): Continues to support zero-network local file inspection and offline prompt generation.
  7. World-Class AI Agent Integration (SEND TO ARENA.AI AGENT): One-click prominent button in the prompt toolbar opens https://arena.ai/agent with the generated prompt preloaded in the query string (?prompt=...) while automatically copying the markdown to the clipboard for zero-friction execution.

πŸ—‚οΈ Canonical Project Structure

a-audit/
β”œβ”€β”€ .github/workflows/
β”‚   └── deploy.yml                       # Vite + GitHub Pages automated deployment pipeline
β”œβ”€β”€ assets/                              # Brand banner, preview cards & SVG icon assets
β”œβ”€β”€ legacy/                              # Backed-up legacy monolithic index.html reference
β”œβ”€β”€ public/                              # Vite static root assets (robots.txt, sitemap.xml, etc.)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── index.ts                     # Strict TypeScript interfaces & typed state contracts
β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”œβ”€β”€ constants.ts                 # TYPES, CATEGORIES, ROLES, DELIVERABLES, ADVANCED, PRESETS
β”‚   β”‚   β”œβ”€β”€ helpers.ts                   # Pure domain helpers & target normalization
β”‚   β”‚   β”œβ”€β”€ fileIntel.ts                 # File-type inference & local dropzone evidence reader
β”‚   β”‚   └── promptBuilder.ts             # Deterministic prompt generation engine
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useBuilderState.ts           # Main React 19 state hook & preset action handlers
β”‚   β”‚   └── useShareUrl.ts               # Syncs URLSearchParams (?t=...&y=...) with React state
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx               # Top banner & mode segment buttons (Audit/Create/Refactor)
β”‚   β”‚   β”‚   └── MobileTabSwitcher.tsx    # Responsive mobile view switcher (Configure / Preview)
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”œβ”€β”€ ConfigSidebar.tsx        # Left configuration sidebar container
β”‚   β”‚   β”‚   β”œβ”€β”€ TargetSection.tsx        # Target input, type dropdown & dynamic type fields
β”‚   β”‚   β”‚   β”œβ”€β”€ DepthStylePresets.tsx    # Audit depth, style & quick preset filters
β”‚   β”‚   β”‚   β”œβ”€β”€ OptionsSection.tsx       # Category, Role, Deliverables & Advanced toggle grids
β”‚   β”‚   β”‚   └── EvidenceUploadSection.tsx# Local browser file/folder drag-and-drop evidence zone
β”‚   β”‚   └── preview/
β”‚   β”‚       └── PromptPreview.tsx        # Live Markdown display, Copy, Download MD & Manifest
β”‚   β”œβ”€β”€ tests/
β”‚   β”‚   β”œβ”€β”€ promptBuilder.test.ts        # Unit & regression tests for prompt engines
β”‚   β”‚   β”œβ”€β”€ typeDetector.test.ts         # Reverse-TLD vs subdomain domain detection tests
β”‚   β”‚   β”œβ”€β”€ shareUrl.test.ts             # URLSearchParams shareable link encoding/decoding tests
β”‚   β”‚   └── regression.test.tsx          # React 19 UI component hierarchy & mode transition tests
β”‚   β”œβ”€β”€ App.tsx                          # Root responsive layout
β”‚   β”œβ”€β”€ main.tsx                         # React 19 DOM entry point & Service Worker registration
β”‚   β”œβ”€β”€ index.css                        # Tailwind v4 utility imports & cyberpunk scrollbar rules
β”‚   └── vite-env.d.ts                    # Vite environment type declarations
β”œβ”€β”€ index.html                           # Clean Vite HTML entry point with SEO & JSON-LD
β”œβ”€β”€ package.json                         # NPM scripts & dependencies
β”œβ”€β”€ tsconfig.json                        # Strict TypeScript 5.7 configuration
└── vite.config.ts                       # Vite 6 + React 19 + Vitest configuration

⚑ Quick-Start Instructions

1. Local Development Sandbox

# Clone the modernized repository
git clone https://github.com/DLinacre/a-audit.git
cd a-audit

# Install dependencies
npm install

# Start local development server (http://localhost:5173)
npm run dev

2. Verification & Regression Testing

# Run strict TypeScript type-checking
npm run lint

# Execute Vitest regression suite (prompt engine + React UI)
npm test

# Build optimized production bundle
npm run build

πŸ”’ Security & Privacy Notice

  • 100% Client-Side Architecture: All evidence files, directory scans, and prompt customizations occur entirely inside your browser's local memory.
  • Zero Network Uploads: No files, prompts, or target URLs are ever transmitted to an external server.

πŸ“œ License & Author

  • Author: David Linacre (@DLinacre / @LIN4CRE)
  • License: Released under the MIT License.

About

πŸ” Arena Audit β€” Automated accessibility, metadata, performance & content audit tool rendered as a static GitHub Pages report.

Topics

Resources

Security policy

Stars

Watchers

Forks

Contributors

Languages