Skip to content

Walid-Khalfa/AutoUX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’‘ AutoUX – AI-Powered UX Analysis with Web3 Verification

AutoUX is an intelligent UX analysis platform that combines AI-powered log analysis with blockchain verification. Upload logs in multiple formats, get instant AI-driven insights about UX issues, and anchor cryptographic proof of your reports on Ethereum's Sepolia testnet.

🎬 Demo & Presentation

πŸ“Ή Watch the 3-minute demo: AutoUX Demo on Loom

πŸ“Š View the pitch deck: AutoUX Pitch Deck

AutoUX Demo Pitch Deck


🌟 Key Features

  • 🧠 AI-Powered Analysis - Google Gemini 2.0 Flash analyzes logs and generates actionable recommendations
  • πŸ“ Multi-Format Support - JSON, NDJSON, CSV, XML, HTML, HAR, TXT, LOG
  • πŸ”— Web3 Verification - Anchor report hashes on Ethereum Sepolia for immutable proof
  • πŸ“Š Interactive Dashboard - Animated UX score gauge with visual metrics
  • β™Ώ WCAG 2.2 Compliant - Built with accessibility in mind
  • 🎯 Smart Recommendations - Prioritized fixes with WCAG and Web Vitals references

Kiroween Kiro AI License

Version Tests AI WCAG Web3


πŸŽƒ Kiroween Hackathon Submission

Category: Frankenstein 🧟 - Stitching together AI, Blockchain, and Web Technologies

Built with: Kiro AI (Spec-Driven Development + Vibe Coding)

Demo Video: Watch on Loom

Kiro Usage: See KIRO_USAGE.md for detailed documentation


πŸš€ Built with Kiro AI

This project was developed entirely using Kiro AI as the primary development partner. Kiro AI helped with:

  • πŸ—οΈ Architecture Design - Structured the full-stack application with Web3 integration
  • πŸ’» Code Generation - Generated React components, Express routes, and Solidity contracts
  • πŸ§ͺ Test Creation - Built comprehensive test suites (67 tests across backend and frontend)
  • πŸ”’ Security Review - Identified and fixed security vulnerabilities
  • πŸ“š Documentation - Created detailed technical documentation and user guides
  • πŸ› Debugging - Resolved complex issues with LLM integration and Web3 transactions

Development Impact:

  • ⚑ 40% faster development with AI-assisted coding
  • 🎯 60% reduction in debugging time
  • βœ… 100% test coverage with AI-generated test suites
  • πŸ” Zero security vulnerabilities after AI review

πŸ“‹ Table of Contents


πŸš€ Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js >= 18.0.0 (Download)
  • npm >= 8.0.0 (comes with Node.js)
  • Git (Download)
  • MetaMask browser extension (for Web3 features) (Install)

Step 1: Clone the Repository

git clone https://github.com/yourusername/autoux.git
cd autoux

Step 2: Install Dependencies

The project uses npm workspaces to manage frontend, backend, and web3 dependencies:

npm install

This single command installs all dependencies for:

  • Frontend (React + Vite)
  • Backend (Express + Gemini AI)
  • Web3 (Hardhat + Ethers.js)

Step 3: Configure Environment Variables

Create environment files for each workspace:

Backend Configuration

cd backend
cp .env.example .env

Edit backend/.env:

# Google Gemini API Configuration
GEMINI_API_KEY=your_gemini_api_key_here

# Server Configuration
PORT=3001
CORS_ORIGIN=http://localhost:5173

Frontend Configuration

cd ../frontend
cp .env.example .env

Edit frontend/.env:

# API Configuration
VITE_API_BASE_URL=http://localhost:3001/api

# Web3 Configuration (after deploying contracts)
VITE_REGISTRY_ADDRESS=0xYOUR_CONTRACT_ADDRESS
VITE_NFT_ADDRESS=0xYOUR_NFT_CONTRACT_ADDRESS
VITE_CHAIN_NAME=Sepolia
VITE_CHAIN_ID=11155111
VITE_ETHERSCAN_URL=https://sepolia.etherscan.io

Web3 Configuration (Optional - for deploying contracts)

cd ../web3
cp .env.example .env

Edit web3/.env:

# Sepolia RPC URL (get from Alchemy or Infura)
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY

# Your wallet private key (NEVER commit this!)
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

# Etherscan API key (for contract verification)
ETHERSCAN_API_KEY=YOUR_ETHERSCAN_API_KEY

⚠️ Security Warning: Never commit .env files or share private keys!


⚑ Quick Start

Start Development Servers

From the project root, run:

npm run dev

This starts both servers concurrently:

The terminal will show color-coded logs for each service.

Alternative: Start Services Individually

# Backend only
npm run dev --prefix backend

# Frontend only
npm run dev --prefix frontend

Your First Analysis

  1. Open http://localhost:5173 in your browser
  2. Drag and drop a log file (or click to browse)
  3. Wait for AI analysis (~5-10 seconds)
  4. View your UX score and recommendations!

Try with sample data:

# Use one of the test files
# Upload: test-data/1-logs-complet.json

πŸ“¦ Project Structure

autoux/
β”œβ”€β”€ backend/                      # Express API Server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”‚   β”‚   β”œβ”€β”€ gemini.js        # Google Gemini API config
β”‚   β”‚   β”‚   β”œβ”€β”€ paths.js         # File paths
β”‚   β”‚   β”‚   └── server.js        # Server config
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   └── analyze.js       # POST /api/analyze endpoint
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ fileParser.js    # Multi-format log parser
β”‚   β”‚   β”‚   β”œβ”€β”€ geminiAnalyzer.js # Google Gemini AI integration
β”‚   β”‚   β”‚   └── reportGenerator.js # Report formatting
β”‚   β”‚   β”œβ”€β”€ schemas/
β”‚   β”‚   β”‚   └── index.js         # Zod validation schemas
β”‚   β”‚   └── server.js            # Entry point
β”‚   β”œβ”€β”€ .env                     # Backend environment variables
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/                     # React Application (Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/          # React Components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx    # UX score gauge & metrics
β”‚   β”‚   β”‚   β”œβ”€β”€ FileUploader.jsx # Drag-drop file upload
β”‚   β”‚   β”‚   β”œβ”€β”€ OnChainProof.jsx # Web3 wallet & anchoring
β”‚   β”‚   β”‚   β”œβ”€β”€ OnChainHistory.jsx # Past anchored reports
β”‚   β”‚   β”‚   β”œβ”€β”€ Recommendations.jsx # AI recommendations
β”‚   β”‚   β”‚   β”œβ”€β”€ ReportViewer.jsx # Issue list & details
β”‚   β”‚   β”‚   β”œβ”€β”€ QRCodeShare.jsx  # QR code sharing
β”‚   β”‚   β”‚   └── ErrorBoundary.jsx # Error handling
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── api.js           # Backend API client
β”‚   β”‚   β”œβ”€β”€ web3/
β”‚   β”‚   β”‚   β”œβ”€β”€ hashUtils.js     # SHA-256 utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ abiAutoUXRegistry.json # Contract ABI
β”‚   β”‚   β”‚   └── abiNFTBadge.json # NFT contract ABI
β”‚   β”‚   β”œβ”€β”€ App.jsx              # Root component
β”‚   β”‚   └── main.jsx             # Entry point
β”‚   β”œβ”€β”€ .env                     # Frontend environment variables
β”‚   └── package.json
β”‚
β”œβ”€β”€ web3/                         # Smart Contracts (Hardhat)
β”‚   β”œβ”€β”€ contracts/
β”‚   β”‚   β”œβ”€β”€ AutoUXRegistry.sol   # Hash storage contract
β”‚   β”‚   └── UXBadgeNFT.sol       # ERC-721 NFT contract
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   β”œβ”€β”€ deploy.js            # Deployment script
β”‚   β”‚   └── verify.js            # Etherscan verification
β”‚   β”œβ”€β”€ hardhat.config.js        # Hardhat configuration
β”‚   β”œβ”€β”€ .env                     # Web3 environment variables
β”‚   └── package.json
β”‚
β”œβ”€β”€ test-data/                    # Sample log files
β”‚   β”œβ”€β”€ 1-logs-complet.json      # Complete test (all types)
β”‚   β”œβ”€β”€ 2-logs-latence.json      # Latency tests
β”‚   β”œβ”€β”€ 3-logs-a11y.json         # Accessibility tests
β”‚   β”œβ”€β”€ 4-logs-contrast-js.json  # Contrast & JS errors
β”‚   β”œβ”€β”€ 5-logs-invalids.json     # Validation tests
β”‚   └── 6-logs-clean.json        # No issues (clean)
β”‚
β”œβ”€β”€ .kiro/specs/autoux/          # Technical Specifications
β”‚   β”œβ”€β”€ requirements.md          # Functional requirements
β”‚   β”œβ”€β”€ design.md                # Architecture & design
β”‚   └── tasks.md                 # Implementation plan
β”‚
β”œβ”€β”€ package.json                 # Root workspace config
└── README.md                    # This file

Key Directories

  • backend/ - Express server that handles file uploads, parses logs, and communicates with Google Gemini AI
  • frontend/ - React SPA with modern UI, Web3 integration, and interactive dashboard
  • web3/ - Solidity smart contracts and deployment scripts for Ethereum Sepolia
  • test-data/ - Sample log files for testing different scenarios
  • .kiro/specs/ - Complete technical documentation and specifications

βš™οΈ Configuration

Environment Variables Explained

Backend (backend/.env)

Variable Description Default Required
GEMINI_API_KEY Google Gemini API key for AI analysis - Yes
PORT Backend server port 3001 No
CORS_ORIGIN Allowed CORS origin http://localhost:5173 No

Frontend (frontend/.env)

Variable Description Default Required
VITE_API_BASE_URL Backend API URL http://localhost:3001/api No
VITE_REGISTRY_ADDRESS AutoUXRegistry contract address - For Web3
VITE_NFT_ADDRESS UXBadgeNFT contract address - For NFT
VITE_CHAIN_NAME Blockchain network name Sepolia For Web3
VITE_CHAIN_ID Blockchain network ID 11155111 For Web3
VITE_ETHERSCAN_URL Etherscan base URL https://sepolia.etherscan.io For Web3

Web3 (web3/.env)

Variable Description Required
SEPOLIA_RPC_URL Ethereum Sepolia RPC endpoint Yes
PRIVATE_KEY Wallet private key for deployment Yes
ETHERSCAN_API_KEY Etherscan API key for verification No

πŸ“‘ API Documentation

POST /api/analyze

Analyzes uploaded log files and returns AI-generated UX report.

Request

Endpoint: POST http://localhost:3001/api/analyze

Content-Type: multipart/form-data

Body:

file: <File> (required)

Supported Formats:

  • JSON (.json)
  • NDJSON (.ndjson, .jsonl)
  • CSV (.csv)
  • XML (.xml)
  • HTML (.html)
  • HAR (.har)
  • Plain text (.txt, .log)

File Size Limit: 10 MB

Response

Success (200 OK):

{
  "report": {
    "id": "report-abc123",
    "timestamp": "2025-11-14T10:30:00Z",
    "uxScore": 72,
    "issues": [
      {
        "id": "issue-001",
        "type": "latency",
        "severity": "high",
        "description": "API response time exceeds 5000ms",
        "category": "Performance",
        "metadata": {
          "responseTime": 5200,
          "endpoint": "/api/users",
          "webVitalsMetric": "LCP"
        }
      }
    ],
    "categories": {
      "Performance": 3,
      "Accessibility": 5,
      "JavaScript Errors": 1
    },
    "recommendations": [
      {
        "priority": 1,
        "title": "Optimize API Response Times",
        "description": "Reduce server response time to under 2.5s",
        "why": "Slow responses impact LCP and user experience",
        "references": [
          "https://web.dev/lcp/"
        ],
        "estimatedImpact": "high"
      }
    ],
    "metadata": {
      "totalIssues": 9,
      "criticalCount": 2,
      "highCount": 3,
      "mediumCount": 3,
      "lowCount": 1,
      "analysisModel": "gemini-2.0-flash-exp"
    }
  },
  "markdown": "# AutoUX Analysis Report\n\n..."
}

Error Responses:

Status Code Description
400 FILE_TOO_LARGE File exceeds 10MB limit
400 UNSUPPORTED_FORMAT File format not supported
400 PARSE_ERROR Failed to parse log file
500 LLM_API_ERROR Gemini API request failed
500 LLM_TIMEOUT Analysis exceeded 60s timeout
429 RATE_LIMIT_EXCEEDED Too many requests

Error Response Format:

{
  "error": {
    "message": "User-friendly error description",
    "code": "ERROR_CODE",
    "timestamp": "2025-11-14T10:30:00Z"
  }
}

Example Usage

cURL:

curl -X POST http://localhost:3001/api/analyze \
  -F "file=@test-data/1-logs-complet.json"

JavaScript (Fetch API):

const formData = new FormData();
formData.append('file', fileInput.files[0]);

const response = await fetch('http://localhost:3001/api/analyze', {
  method: 'POST',
  body: formData
});

const { report, markdown } = await response.json();
console.log('UX Score:', report.uxScore);

πŸ§ͺ Testing

Run All Tests

From the project root:

npm test

This runs:

  1. Backend tests (Jest) - 43 tests
  2. Frontend tests (Vitest) - 24 tests

Total: 67 tests, 100% passing

Run Tests Separately

# Backend tests only (Jest)
npm run test:backend

# Frontend tests only (Vitest)
npm run test:frontend

Test Coverage

Backend Tests (backend/src/**/__tests__/):

  • βœ… File parser (all 8 formats)
  • βœ… LLM analyzer (Google Gemini integration)
  • βœ… Report generator (JSON + Markdown)
  • βœ… Schema validation (Zod)
  • βœ… API routes (POST /api/analyze)
  • βœ… Error handling

Frontend Tests (frontend/src/**/__tests__/):

  • βœ… Dashboard component
  • βœ… FileUploader component
  • βœ… OnChainProof component
  • βœ… Recommendations component
  • βœ… Web3 utilities (hash computation)
  • βœ… API service (retry logic, caching)

Accessibility Tests:

  • βœ… ARIA labels on all interactive elements
  • βœ… Keyboard navigation (Tab, Enter, Space)
  • βœ… Color contrast (WCAG AA minimum)
  • βœ… Screen reader compatibility

Manual Testing

Use the sample files in test-data/:

# Start the app
npm run dev

# Upload test files and verify:
# 1. test-data/1-logs-complet.json β†’ 7 issues
# 2. test-data/2-logs-latence.json β†’ 4 issues
# 3. test-data/3-logs-a11y.json β†’ 6 issues
# 4. test-data/6-logs-clean.json β†’ 0 issues

Available Scripts

Script Description
npm install Install all dependencies (frontend + backend + web3)
npm run dev Start frontend and backend in development mode
npm start Alias for npm run dev
npm test Run all tests (backend + frontend)
npm run test:backend Run backend tests only (Jest)
npm run test:frontend Run frontend tests only (Vitest)

πŸ”§ Troubleshooting

Common Issues

"Unable to contact server" / "Network Error"

Problem: Frontend can't reach backend API

Solutions:

  1. Ensure backend is running: npm run dev --prefix backend
  2. Check backend is on port 3001: http://localhost:3001
  3. Verify VITE_API_BASE_URL in frontend/.env
  4. Check CORS settings in backend/.env

"File too large" Error

Problem: Uploaded file exceeds 10MB limit

Solutions:

  1. Compress or split the log file
  2. Filter logs to include only relevant entries
  3. Use NDJSON format (more compact than JSON)

"Unsupported format" Error

Problem: File format not recognized

Solutions:

  1. Ensure file has correct extension (.json, .csv, etc.)
  2. Verify file content is valid (not corrupted)
  3. Try converting to JSON format
  4. Check file encoding (should be UTF-8)

"LLM API Error" / "Analysis Failed"

Problem: Gemini API request failed

Solutions:

  1. Check GEMINI_API_KEY in backend/.env
  2. Verify API key is valid: https://aistudio.google.com/apikey
  3. Check rate limits (free tier has limits)
  4. Try again in a few minutes
  5. Check backend logs for detailed error

"LLM Timeout" Error

Problem: Analysis took longer than 60 seconds

Solutions:

  1. Reduce log file size
  2. Split into smaller batches
  3. Try again (may be temporary API slowness)

Web3 Issues

"MetaMask not found"

Problem: MetaMask extension not detected

Solutions:

  1. Install MetaMask: https://metamask.io/
  2. Refresh the page after installation
  3. Ensure MetaMask is enabled for the site

"Wrong network" / "Please switch to Sepolia"

Problem: MetaMask is on wrong network

Solutions:

  1. Open MetaMask
  2. Click network dropdown
  3. Select "Sepolia Test Network"
  4. If not listed, add manually:

"Insufficient funds for gas"

Problem: Not enough Sepolia ETH for transaction

Solutions:

  1. Get free testnet ETH from faucet:
  2. Wait ~15 seconds for confirmation
  3. Check balance: https://sepolia.etherscan.io/

"Transaction rejected by user"

Problem: You declined the MetaMask transaction

Solutions:

  1. Click "πŸ“Œ Anchor Hash" again
  2. Click "Confirm" in MetaMask popup
  3. Wait for transaction confirmation

"Contract not configured"

Problem: VITE_REGISTRY_ADDRESS not set

Solutions:

  1. Deploy contract: cd web3 && npm run deploy:sepolia
  2. Copy contract address from output
  3. Update frontend/.env:
    VITE_REGISTRY_ADDRESS=0xYOUR_CONTRACT_ADDRESS
  4. Restart frontend: npm run dev --prefix frontend

"Verification failed" / Hash Mismatch

Problem: Computed hash doesn't match on-chain record

Solutions:

  1. Ensure you're verifying the same report that was anchored
  2. Check if report was modified after anchoring
  3. Try anchoring again with current report

Development Issues

Port Already in Use

Problem: Port 3001 or 5173 already in use

Solutions:

Windows:

# Find process using port
netstat -ano | findstr :3001
# Kill process (replace PID)
taskkill /PID <PID> /F

Linux/Mac:

# Find and kill process
lsof -ti:3001 | xargs kill -9

Or change ports in configuration files.

Hot Reload Not Working

Problem: Changes not reflected automatically

Solutions:

  1. Restart dev server: Ctrl+C then npm run dev
  2. Clear browser cache: Ctrl+Shift+R
  3. Check file watcher limits (Linux):
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p

Tests Failing

Problem: Tests not passing

Solutions:

  1. Install dependencies: npm install
  2. Clear cache: npm run test:backend -- --clearCache
  3. Check Node version: node --version (should be >=18)
  4. Run tests individually to isolate issue

Getting Help

If you're still stuck:

  1. Check Logs:

    • Backend: Terminal running npm run dev
    • Frontend: Browser DevTools Console (F12)
    • MetaMask: Click extension β†’ Activity
  2. Documentation:

  3. Common Solutions:

    • Restart everything: Ctrl+C then npm run dev
    • Clear caches: Browser cache + sessionStorage
    • Reinstall: rm -rf node_modules && npm install

πŸ”— Web3 Setup

AutoUX supports blockchain-based verification of AI-generated reports using Ethereum smart contracts. This provides immutable proof that a report hasn't been tampered with, while keeping your logs completely private.

Why Web3?

  • βœ… Immutable Proof - Reports can't be altered without detection
  • βœ… Privacy-Preserved - Only SHA-256 hashes stored on-chain, logs stay local
  • βœ… Public Verification - Anyone can verify report authenticity
  • βœ… Audit Trail - Includes uploader address and timestamp
  • βœ… Decentralized - No central authority required

Prerequisites

  1. MetaMask Browser Extension

  2. Sepolia Testnet ETH

  3. RPC Provider (for contract deployment)

Step-by-Step Setup

1. Deploy Smart Contract

cd web3
npm install
cp .env.example .env

Edit web3/.env:

SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

Deploy the contract:

npm run deploy:sepolia

Expected output:

πŸš€ Deploying AutoUXRegistry to Sepolia...
βœ… AutoUXRegistry deployed to: 0x1234567890abcdef...

2. Configure Frontend

Copy the deployed contract address and update frontend/.env:

VITE_REGISTRY_ADDRESS=0x1234567890abcdef...
VITE_CHAIN_NAME=Sepolia
VITE_CHAIN_ID=11155111
VITE_ETHERSCAN_URL=https://sepolia.etherscan.io

3. Configure MetaMask

  1. Open MetaMask
  2. Click network dropdown β†’ "Add Network"
  3. Select "Sepolia Test Network"
  4. Get testnet ETH from faucet (link above)

4. Use Web3 Features

  1. Start the application: npm run dev
  2. Upload logs and generate a report
  3. Scroll to "On-Chain Proof" section
  4. Click "Connect Wallet" β†’ Approve in MetaMask
  5. Click "πŸ“Œ Anchor Hash" β†’ Confirm transaction
  6. Wait ~15 seconds for confirmation
  7. Click "πŸ” Verify Hash" to verify authenticity

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Upload Logs β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ AI Analysis     β”‚
β”‚ (Gemini Flash)  β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Compute SHA-256 Hash    β”‚
β”‚ hash = SHA256(report)   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Store Hash On-Chain     β”‚
β”‚ (Sepolia Testnet)       β”‚
β”‚ - reportId β†’ hash       β”‚
β”‚ - uploader address      β”‚
β”‚ - timestamp             β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Verify Anytime          β”‚
β”‚ Compare computed hash   β”‚
β”‚ with on-chain record    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Smart Contract Details

AutoUXRegistry.sol - Main contract for hash storage

// Store a report hash
function storeHash(string reportId, bytes32 contentHash) external

// Verify a report hash
function verifyHash(string reportId, bytes32 contentHash) external view returns (bool)

// Get stored record
function getRecord(string reportId) external view returns (bytes32, address, uint64)

Network: Ethereum Sepolia Testnet
Chain ID: 11155111
Gas Cost: 50,000 gas ($0.10 on testnet)
Hash Algorithm: SHA-256 (32 bytes)

Optional: NFT Badges

Deploy the NFT contract to mint badges for verified reports:

cd web3
npm run deploy:nft

Update frontend/.env:

VITE_NFT_ADDRESS=0xYOUR_NFT_CONTRACT_ADDRESS

Users can then mint ERC-721 NFT badges with their UX score and report hash.

Troubleshooting Web3

See the Troubleshooting section below for common Web3 issues.

Full Documentation: web3/README.md


πŸ“ Supported Log Formats

AutoUX can parse and analyze logs in multiple formats. The system automatically detects the format based on file content and extension.

1. JSON (.json)

Standard JSON array of log entries.

Example:

[
  {
    "id": "log-001",
    "timestamp": "2025-11-14T10:30:00Z",
    "type": "performance",
    "category": "api",
    "message": "High response time",
    "metadata": {
      "responseTime": 4500,
      "endpoint": "/api/data"
    }
  },
  {
    "id": "log-002",
    "timestamp": "2025-11-14T10:31:00Z",
    "type": "accessibility",
    "category": "images",
    "message": "Image missing alt text",
    "metadata": {
      "element": "img#hero-banner",
      "page": "/home"
    }
  }
]

2. NDJSON (.ndjson, .jsonl)

Newline-delimited JSON (one JSON object per line).

Example:

{"id":"log-001","timestamp":"2025-11-14T10:30:00Z","type":"performance","message":"Slow API"}
{"id":"log-002","timestamp":"2025-11-14T10:31:00Z","type":"accessibility","message":"Missing alt"}

3. CSV (.csv)

Comma-separated values with header row.

Example:

id,timestamp,type,category,message,responseTime,element
log-001,2025-11-14T10:30:00Z,performance,api,High response time,4500,
log-002,2025-11-14T10:31:00Z,accessibility,images,Missing alt text,,img#hero

4. XML (.xml)

XML log structure.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<logs>
  <log>
    <id>log-001</id>
    <timestamp>2025-11-14T10:30:00Z</timestamp>
    <type>performance</type>
    <message>High response time</message>
    <metadata>
      <responseTime>4500</responseTime>
    </metadata>
  </log>
</logs>

5. HTML (.html)

HTML tables containing log data.

Example:

<table>
  <tr>
    <th>ID</th><th>Timestamp</th><th>Type</th><th>Message</th>
  </tr>
  <tr>
    <td>log-001</td>
    <td>2025-11-14T10:30:00Z</td>
    <td>performance</td>
    <td>High response time</td>
  </tr>
</table>

6. HAR (.har)

HTTP Archive format (browser network logs).

Example:

{
  "log": {
    "version": "1.2",
    "entries": [
      {
        "startedDateTime": "2025-11-14T10:30:00Z",
        "time": 4500,
        "request": {
          "method": "GET",
          "url": "https://api.example.com/data"
        },
        "response": {
          "status": 200
        }
      }
    ]
  }
}

7. Plain Text (.txt, .log)

Unstructured text logs (parsed line by line).

Example:

[2025-11-14 10:30:00] ERROR: Image missing alt text on /home
[2025-11-14 10:31:00] WARN: API response time 4500ms exceeds threshold
[2025-11-14 10:32:00] ERROR: JavaScript TypeError in main.js:42

Detection Logic

The parser automatically detects format using:

  1. File extension (.json, .csv, .xml, etc.)
  2. Content inspection (JSON structure, CSV headers, XML tags)
  3. Fallback to plain text parsing

Sample Files

Test files are available in test-data/:

File Description Expected Issues
1-logs-complet.json Complete test (all types) 7 issues
2-logs-latence.json Latency tests 4 issues
3-logs-a11y.json Accessibility tests 6 issues
4-logs-contrast-js.json Contrast & JS errors 4 issues
5-logs-invalids.json Validation tests 4 issues
6-logs-clean.json No issues (clean) 0 issues

πŸ“– Usage Guide

1. Upload Logs

Drag & Drop:

  • Drag a log file onto the upload zone
  • File is automatically validated and uploaded

Click to Browse:

  • Click the upload zone
  • Select a file from your computer

Supported: JSON, NDJSON, CSV, XML, HTML, HAR, TXT, LOG (max 10MB)

2. View Dashboard

After analysis, the dashboard displays:

  • UX Score Gauge - Animated circular gauge (0-100)

    • 90-100: 🟒 Excellent (green)
    • 70-89: 🟠 Fair (amber)
    • <70: πŸ”΄ Critical (red)
  • Summary Cards

    • Total issues detected
    • Breakdown by severity (Critical, High, Medium, Low)
    • Category distribution
  • Quick Filters

    • Filter by category (Performance, Accessibility, Contrast, JS Errors)
    • Filter by severity
    • Search issues

3. Review Recommendations

The AI generates prioritized recommendations with:

  • Title & Description - What to fix
  • Why It Matters - Impact explanation
  • WCAG References - Links to WCAG 2.2 criteria
  • Web Vitals References - Links to Core Web Vitals docs
  • Code Examples - Before/after code snippets

View Modes:

  • Markdown view (formatted)
  • JSON view (raw data)

4. Anchor Hash On-Chain (Optional)

Connect Wallet:

  1. Click "Connect Wallet"
  2. Approve MetaMask connection
  3. Ensure you're on Sepolia network

Anchor Hash:

  1. Click "πŸ“Œ Anchor Hash"
  2. Confirm transaction in MetaMask
  3. Wait ~15 seconds for confirmation
  4. View transaction on Etherscan

Verify Hash:

  1. Click "πŸ” Verify Hash"
  2. See verification status (βœ… Verified or ⚠️ Not Found)

5. View History

The "Your On-Chain Anchors" section shows:

  • All reports you've anchored
  • UX scores
  • Timestamps
  • Transaction links

6. Share Results

QR Code:

  • Generate QR code with report hash
  • Download or share via social media

Export:

  • Download full report as JSON
  • Download Markdown summary

✨ Features Overview

🧠 Intelligent Detection

AutoUX automatically detects 4 categories of UX issues:

  1. ⏱️ Latency - Response time > 3000ms

    • High severity: >5000ms
    • Medium severity: 3000-5000ms
    • References: Web Vitals (LCP, FID, CLS)
  2. β™Ώ Accessibility - WCAG 2.2 compliance

    • Missing alt text on images
    • Invalid ARIA attributes
    • Keyboard navigation issues
    • References: WCAG 2.2 (1.1.1, 2.1.1, 4.1.2)
  3. 🎨 Contrast - Color contrast ratio < 4.5:1

    • WCAG AA minimum standard
    • References: WCAG 2.2 – 1.4.3
  4. 🚨 JavaScript Errors - Runtime errors

    • Stack traces included
    • Error context and location

πŸ€– AI-Powered Recommendations

  • Prioritized action items
  • "Why it matters" explanations
  • WCAG 2.2 and Web Vitals references
  • Before/after code examples
  • Estimated impact assessment

πŸ“Š Interactive Dashboard

  • Animated UX score gauge (0-100)
  • Color-coded severity (🟒 Excellent, 🟠 Fair, πŸ”΄ Critical)
  • Summary cards with metrics
  • Category distribution charts
  • Quick filters and search
  • Responsive design

πŸ”— Web3 Integration

  • Privacy-preserving hash anchoring
  • Immutable proof on Ethereum Sepolia
  • Public verification
  • Transaction history
  • Optional NFT badges

πŸ› οΈ Technologies

AI & Development

Technology Purpose Version
Kiro AI Primary development assistant Latest
Google Gemini API AI-powered log analysis 2.0 Flash
Gemini 2.0 Flash Free AI model for analysis Latest

Frontend

Technology Purpose Version
React UI framework 18.3.1
Vite Build tool & dev server 5.4.2
Ethers.js Web3 integration 6.15.0
Framer Motion Animations 12.23.24
Tailwind CSS Styling 3.4.18
Vitest Testing framework 4.0.8
React Testing Library Component testing 16.3.0

Backend

Technology Purpose Version
Node.js Runtime environment 18+
Express Web framework 4.18.2
@google/generative-ai Google Gemini SDK Latest
Multer File upload handling 2.0.2
Zod Schema validation 3.22.4
Jest Testing framework 29.7.0
csv-parse CSV parsing 6.1.0
xml2js XML parsing 0.6.2

Web3 & Blockchain

Technology Purpose Version
Hardhat Smart contract development Latest
Solidity Contract language 0.8.20
Ethereum Sepolia Testnet blockchain -
Etherscan Block explorer -

Development Tools

Tool Purpose
npm workspaces Monorepo management
concurrently Run multiple processes
nodemon Backend hot reload
ESLint Code linting
Prettier Code formatting

Quality Assurance

  • βœ… 67 tests (43 backend + 24 frontend)
  • βœ… 100% passing test suite
  • βœ… WCAG 2.2 AA accessibility compliance
  • βœ… Zod validation on all inputs/outputs
  • βœ… Error boundaries for graceful failures
  • βœ… Security headers (CSP, X-Frame-Options)

🎯 Project Highlights

What Makes AutoUX Unique?

  1. AI-First Approach

    • Real-time AI analysis with Google Gemini 2.0 Flash
    • Context-aware recommendations
    • WCAG 2.2 and Web Vitals integration
  2. Multi-Format Flexibility

    • 8 supported log formats
    • Automatic format detection
    • Handles up to 10MB files
  3. Blockchain Verification

    • Privacy-preserving hash anchoring
    • Immutable proof of integrity
    • Public verification without exposing data
  4. Modern UX

    • Animated UX score gauge
    • Interactive dashboard
    • Real-time filtering and search
    • Responsive design
  5. Production-Ready

    • 67 comprehensive tests
    • Error handling and retry logic
    • Security best practices
    • Accessibility compliant

Use Cases

  • QA Teams - Automated UX issue detection in test logs
  • Developers - Quick accessibility and performance audits
  • Product Managers - Track UX quality metrics over time
  • Compliance - Verify WCAG compliance with blockchain proof
  • Auditors - Verify report authenticity without accessing raw data

πŸ“š Additional Documentation


🀝 Contributing

This project was developed as part of the AWS Hackathon with Kiro AI as the primary development assistant.

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: npm test
  5. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. Open a Pull Request

Code Standards

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Ensure accessibility compliance
  • Run linter before committing

πŸ“„ License

MIT License - See LICENSE file for details


πŸ™ Acknowledgments

  • Kiro AI - Primary development assistant
  • Google Gemini - Free AI API access
  • Ethereum Foundation - Sepolia testnet
  • AWS - Hackathon organization
  • Open Source Community - Amazing tools and libraries

πŸ“ž Support


πŸ—ΊοΈ Roadmap

v2.1 (Planned)

  • Support for more log formats (Syslog, Apache, Nginx)
  • Real-time log streaming
  • Custom detection rules
  • Report comparison (diff between versions)

v2.2 (Planned)

  • Multi-chain support (Polygon, Arbitrum)
  • IPFS integration for decentralized storage
  • Team collaboration features
  • API rate limiting dashboard

v3.0 (Future)

  • Machine learning for custom issue detection
  • Integration with CI/CD pipelines
  • Slack/Discord notifications
  • Enterprise features (SSO, RBAC)

Made with ❀️ and lots of β˜• during AWS Hackathon

Powered by Kiro AI

⭐ Star on GitHub | πŸ“– Documentation | πŸ› Report Bug

About

AutoUX analyzes UX logs with AI, detects issues instantly, and anchors a cryptographic proof of each report on Ethereum Sepolia.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors