Refactored & Modernized to TypeScript + React 19 + Tailwind v4 + Clean Modular Architecture
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.
- 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. - 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.
- Extracted all constants (
- Strict Type Safety (
src/types/index.ts): Replaced implicitanytypes and DOM lookups with strict TypeScript interfaces forBuilderState,TargetTypeId,AppMode,ResolvedType, andPromptResult. - Automated Regression Verification (
src/tests/): Established a Vitest +@testing-library/react20-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. - Zero-Vulnerability Security Posture & Accessibility: Upgraded dependencies to eliminate VM Context Escape CVEs (
0 vulnerabilitiesinnpm audit), enhanced reverse-TLD package regex matching (com.company.app), and added a WCAG 2.2 AA compliant Skip-to-Main-Content keyboard link. - Offline-First Service Worker (
sw.js): Continues to support zero-network local file inspection and offline prompt generation. - World-Class AI Agent Integration (
SEND TO ARENA.AI AGENT): One-click prominent button in the prompt toolbar openshttps://arena.ai/agentwith the generated prompt preloaded in the query string (?prompt=...) while automatically copying the markdown to the clipboard for zero-friction execution.
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
# 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# 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- 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.
- Author: David Linacre (
@DLinacre/@LIN4CRE) - License: Released under the MIT License.
