PromptMetrics analyzes how AI systems (ChatGPT, Gemini, Perplexity) perceive and describe brands across the web. Companies can understand and optimize their digital presence in AI-generated responses.
- AI Brand Monitoring: Track how AI systems describe your brand vs competitors
- Competitive Intelligence: Understand positioning in AI-generated recommendations
- Real-time Analysis: Live dashboard updates from automated AI analysis workflows
- Multi-LLM Comparison: Comprehensive dashboards comparing multiple AI models
- Document Ranking: Advanced reranking using state-of-the-art RankLLM models
- Enterprise Security: Comprehensive audit logs, rate limiting, and access control
Well-organized structure for maintainability:
βββ π build/ # Build configs (Vite, Tailwind, PostCSS, Vitest)
βββ π ci/ # CI/CD configs (.github, Lighthouse)
βββ π config/ # App configs (ESLint, TypeScript, Components)
βββ π docs/ # Documentation and guides
βββ π env/ # Environment templates
βββ π public/ # Static assets and PWA files
βββ π rank-llm-service/ # RankLLM microservice (Python/FastAPI)
βββ π scripts/ # Utility scripts (security checks)
βββ π src/ # Application source code
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ pages/ # Route components
β βββ services/ # API and external services
β βββ types/ # TypeScript definitions
β βββ utils/ # Utility functions
β βββ test/ # Test files
βββ π supabase/ # Supabase configs and migrations
- Node.js 18+ or Bun
- Supabase CLI
# Clone repository
git clone https://github.com/adriannoes/promptmetrics.git
cd promptmetrics
# Install dependencies
npm install
# Configure environment
cp env/env.example .env.local
# Edit .env.local with your Supabase credentials
# Run security check
npm run security-check
# Start development server
npm run dev-
Copy environment template:
cp env/env.example .env.local
-
Configure Supabase:
- Get your project URL and anon key from Supabase Dashboard
- Update
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYin.env.local
-
Security validation:
npm run security-check # Validates environment and security configs
# Development
npm run dev # Development server
npm run preview # Preview production build
# Building
npm run build # Production build
npm run build:prod # Optimized production build
npm run build:analyze # Bundle analysis with visualizer
# Testing
npm run test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:coverage # Test coverage report
npm run test:ui # Test UI interface
# Quality & Security
npm run lint # Run ESLint
npm run security-check # Security validation
npm run quality-check # Full quality check (lint + test + security)
npm run lighthouse # Performance audit
# Deployment
npm run deploy:check # Pre-deployment validation- Local:
http://localhost:5173 - Demo: Click "Try Demo" on landing page
- β Secure Logging: Automatic sanitization of sensitive data
- β Rate Limiting: Protection against spam and abuse
- β Environment Validation: Strict validation of required variables
- β Audit Trail: Complete user action monitoring
- β Access Control: Role-based permissions with audit logging
- β CSP Headers: Content Security Policy with strict defaults
- β CORS Hardening: Tightened CORS policies for edge functions
- β Timing-Safe Comparison: Secure secret comparison in edge functions
- β Input Sanitization: DOMPurify for HTML/SVG sanitization
- β Credential Protection: No secrets exposed in frontend code
- Environment Variables: All sensitive data in environment variables
- Gitignore Protection: Comprehensive .gitignore prevents credential leaks
- Dependency Security: Regular security audits with
npm audit - Code Splitting: Reduces attack surface through modular architecture
- Type Safety: Full TypeScript coverage prevents runtime vulnerabilities
- Framework: React 18.3.1 + TypeScript 5.9.2 + Vite 7.1.7
- UI: Shadcn/ui + Radix UI + Tailwind CSS
- State: React Query + Context API
- Charts: Recharts
- Routing: React Router v6 with lazy loading
- Forms: React Hook Form + Zod validation
- Testing: Vitest + Testing Library + Jest DOM
- Performance: Bundle analyzer + Lighthouse CI
- Database: Supabase PostgreSQL with RLS
- Auth: Supabase Auth + Google OAuth + invite codes
- Edge Functions: Supabase (Deno runtime)
- Microservices: RankLLM Python/FastAPI service
- Containerization: Docker + Docker Compose
- Workflow Automation: n8n for AI analysis
- Email: Supabase Auth
- Monitoring: Core Web Vitals + Lighthouse CI
- Supabase Auth + Google OAuth + invite codes
- Demo mode for instant access
- Role-based access (
client/admin)
- Real-time domain analysis via n8n workflows
- Multi-LLM comparison (OpenAI, Gemini, Claude)
- Live dashboard updates
- English (default) + Portuguese (BR)
- Context-based translations
- Document Reranking: Advanced ranking using state-of-the-art LLM models
- Multiple Models: MonoT5, RankZephyr, RankVicuna, DuoT5 support
- Microservice Architecture: Independent Python/FastAPI service
- Organization Control: Configurable analysis methods per organization
- Real-time Processing: Live document ranking with performance metrics
- 40+ lazy-loaded chunks for optimal performance
- Bundle size reduced by ~80% vs monolithic builds
- Strategic chunking: vendor libs, UI components, pages
- Suspense boundaries with loading states
- React.memo, useMemo, useCallback applied
- Heavy components lazy loaded
- Database queries optimized
- Automated Testing: 20+ tests with Vitest + Testing Library
- Code Coverage: 100% coverage on utility functions
- Performance Monitoring: Lighthouse CI with 90+ scores
- Accessibility Auditing: Axe-core integration
- Bundle Analysis: Visual bundle analyzer with Rollup
- DOCS.md - Complete technical documentation
- DEPLOYMENT.md - Production deployment guide
- N8N Workflows - AI analysis pipeline guide
- RankLLM Integration - Document ranking system guide
- Architecture - Enterprise architecture patterns
- Final Report - Complete project status
- Landing:
/ - Demo:
/demo(or click "Try Demo") - Analysis:
/analysis - Document Ranking:
/document-ranking(RankLLM integration) - Admin:
/admin(admin role required)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- No sensitive data exposed in repository
- Environment variables properly configured with validation
- Dependencies audited (4 low-severity vulnerabilities in dev dependencies only)
- Gitignore comprehensive - prevents credential leaks
- CSP and CORS hardened for production security
- Rate limiting implemented across all endpoints
- Audit logging enabled for all user actions
- Input sanitization with DOMPurify
- Service role keys are never exposed in frontend code
- All secrets must be configured via environment variables
- Regular security audits recommended with
npm audit - Production deployment requires proper environment configuration
- 4 low-severity vulnerabilities in development dependencies only
- Affected packages:
tmp,inquirer,external-editor(via@lhci/cli) - Impact: Development environment only, no production risk
- Fix available:
npm audit fix --force(may cause breaking changes)
This project is private and proprietary. All rights reserved.