"They don't do it like they used to..."
Open-source government transparency platform tracking quality decline and consumer protection issues across industries using real-time federal data and AI-powered analysis.
This project is built for Open Source Hackfest, competing in:
- π Code for Good - Using open source tools for consumer protection and social impact
- π€ Best Use of Gemini API - AI-powered complaint analysis and trend prediction
- π Best Documentation - Comprehensive docs following government design standards
- Consumers lack centralized access to government complaint data across agencies
- Quality decline goes unnoticed until it's too late
- No AI-powered tools to predict emerging consumer issues and fraud patterns
- Fraud and scams are hard to track across multiple federal databases
- π Live Data Dashboard - Real-time statistics from 4 major federal agencies (CFPB, NHTSA, CPSC, FTC)
- π Enhanced Smart Search - Advanced search with filtering, sorting, and live API integration
- π Sector Analysis - Visual charts showing complaint trends by industry
- π’ Company Rankings - Grade-based rankings with detailed metrics
β οΈ Recent Alerts - Latest complaints and recalls with severity indicators
- π― Advanced Filters - Filter by sector (Financial, Automotive, Consumer Products, Technology, Healthcare)
- π Dynamic Sorting - Sort results by Most Complaints, Most Recalls, or Company Name
- π Real-Time Search - Instant results as you type with result counters
- β¨οΈ Keyboard Navigation - Press Enter to search quickly
- π‘ Live API Integration - Fetches real-time data from CFPB, NHTSA, FTC, and CPSC federal databases
- π¨ Collapsible Filters - Toggle advanced filters panel for cleaner interface
- β‘ Loading States - Visual feedback during API calls and processing
- π€ AI Complaint Analyzer - Analyzes trends and identifies recurring issues
- π¬ Natural Language Search - Ask questions in plain English like "Which financial companies have the most complaints?"
- π¨ Fraud Pattern Detection - Identifies emerging scam types and vulnerable demographics
- π€ Consumer Protection Chatbot - Personalized advice based on complaint data
- β¨ AI Search Toggle - Enable/disable AI-powered search with visual indicator
- π§ Smart Intent Detection - AI understands search context and provides relevant results
- π¨ Government Design Systems - Follows USWDS, GOV.UK, and California DS standards
- βΏ WCAG 2.1 AA Compliant - Fully accessible interface
- π± Responsive Design - Works seamlessly on desktop, tablet, and mobile
- Node.js 18 or higher
- npm or yarn
- Google Gemini API Key - Get it here
-
Clone the repository
git clone https://github.com/bruhdev1290/Quality-control-Portal- cd Quality-control-Portal -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envand add your API keys:VITE_GEMINI_API_KEY=your_gemini_api_key_here VITE_FTC_API_KEY=DEMO_KEY # Optional
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173
npm run buildThe production-ready files will be in the dist/ directory.
npm run previewClick the button below to deploy this project to Netlify instantly:
-
Fork this repository to your GitHub account
-
Sign up/Login to Netlify
-
Create a new site from Git
- Click "Add new site" β "Import an existing project"
- Choose "GitHub" and authorize Netlify
- Select your forked repository
-
Configure build settings (these are already set in
netlify.toml):- Build command:
npm install && npm run build - Publish directory:
dist - Node version:
18
- Build command:
-
Deploy!
- Click "Deploy site"
- Your site will be live in minutes with a unique URL
- You can customize the domain in site settings
Once connected to Netlify, every push to the main branch automatically triggers a new deployment. No manual intervention needed!
The search functionality has been completely overhauled with advanced features, live API integration, and AI-powered natural language processing.
- Sector Filter: Filter results by Financial, Automotive, Consumer Products, Technology, or Healthcare sectors
- Dynamic Sorting: Sort by Most Complaints, Most Recalls, or Company Name (A-Z)
- Collapsible Panel: Toggle advanced filters to keep the interface clean
- Real-time Updates: Filters apply instantly as you change selections
The search now queries real federal databases:
- CFPB API (
src/services/cfpbAPI.ts): Fetches live consumer complaint data - NHTSA API (
src/services/nhtsaAPI.ts): Retrieves current vehicle recall information - Automatic Fetching: APIs are called automatically when you search
- Error Handling: Graceful fallbacks if APIs are unavailable
When enabled (requires Gemini API key):
- Conversational Queries: Ask questions like "show me automotive recalls"
- Intent Detection: AI understands what you're looking for
- Smart Results: Get contextually relevant data
- Visual Feedback: See AI's interpretation of your search
- Keyboard Support: Press Enter to trigger search
- Loading States: Visual spinner during API calls
- Result Counters: See how many companies, events, and sectors match
- Empty States: Clear messaging when no results found
- Responsive Design: Works perfectly on mobile devices
Enhanced Search with Advanced Filters
Toggle filters to refine your search by sector and sort results dynamically
Live Search Results
Real-time filtering showing companies, events, and sectors matching your query
- Basic Search: Type a company name or sector in the search box
- Advanced Filters: Click the "Filters" button to show filtering options
- AI Search: Click the sparkles β¨ button to enable natural language queries
- Sort Results: Use the "Sort Results By" dropdown to organize data
- View Results: See filtered companies, events, and sectors below
Standard Search:
Wells Fargo- Find all data related to Wells FargoFinancial- Show all financial sector companiesNHTSA recalls- Filter by NHTSA recall events
AI-Powered Search (requires Gemini API key):
Which financial companies have the most complaints?Show me automotive recallsWhat are recent fraud reports?
Enshitification-V2/
βββ src/
β βββ enshitification-portal.tsx # Main application component with enhanced search
β βββ services/
β β βββ geminiAI.ts # Google Gemini AI integration
β β βββ cfpbAPI.ts # CFPB API service (live data)
β β βββ nhtsaAPI.ts # NHTSA API service (live data)
β β βββ ftcAPI.ts # FTC API service (live data)
β β βββ cpscAPI.ts # CPSC Recall Retrieval API service (NEW!)
β β βββ cpscAPI.demo.ts # CPSC API usage examples
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ docs/
β βββ API_INTEGRATION.md # Complete API integration guide
β βββ CPSC_API_INTEGRATION.md # CPSC API documentation (NEW!)
β βββ CPSC_INTEGRATION_EXAMPLE.md # CPSC integration examples (NEW!)
βββ dist/ # Production build (generated)
βββ index.html # HTML template
βββ netlify.toml # Netlify configuration
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite bundler configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ .env.example # Environment variables template
βββ CODE_OF_CONDUCT.md # Community standards
βββ CONTRIBUTING.md # Contribution guidelines
βββ DEPLOYMENT.md # Deployment guide
βββ README.md # You are here!
- Framework: React 18 with TypeScript
- AI Integration: Google Gemini API for intelligent analysis
- Build Tool: Vite 5
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- APIs: CFPB, NHTSA, CPSC, FTC federal databases
- Deployment: Netlify (optimized configuration included)
- Design Systems: USWDS, GOV.UK, California DS, Massachusetts Mayflower
This platform aggregates data from four major U.S. federal agencies:
- API: CFPB Consumer Complaint Database API
- Data: Financial complaints, company responses, resolution rates
- Stats: 1.8M+ complaints tracked
- No API key required
- API: NHTSA Datasets and APIs
- Data: Vehicle safety recalls, defect investigations
- Stats: 14K+ recalls tracked
- No API key required
- API: CPSC Recall Retrieval API
- Data: Product recalls, hazards, injuries, manufacturer information
- Implementation: Full TypeScript support with XML/JSON formats in
src/services/cpscAPI.ts - Stats: 8K+ violations tracked
- No API key required
- Documentation: See CPSC API Integration Guide
- API: FTC Consumer Sentinel API
- Data: HSR Early Termination Notices and robocall complaints
- Stats: 5.8M+ fraud/scam complaints
- DEMO_KEY available for testing
To enable browser-based access to federal APIs, we use a CORS proxy service:
- Proxy Service: corsproxy.io
- Affected APIs: CFPB, FTC (and potentially CPSC for some endpoints)
- Why Needed: Federal government APIs don't include CORS headers, preventing direct browser access
- Implementation: See
src/services/cfpbAPI.tsandsrc/services/ftcAPI.ts
For Production Deployment: Consider setting up your own CORS proxy or backend service for better reliability and performance. Alternative proxy services include:
- CORS Anywhere (self-hosted)
- AllOrigins
- Custom backend proxy (recommended for production)
All AI features are fully implemented in src/services/geminiAI.ts with complete error handling and graceful fallbacks.
Analyzes consumer complaints to identify:
- Top 3 recurring issues for any company
- Severity assessment (Low/Medium/High/Critical)
- Trend analysis (Improving/Stable/Worsening)
- Personalized consumer recommendations
Usage: Enable AI search toggle and query company complaint data
Ask questions in plain English and get intelligent results:
- "What are the most common complaints about Wells Fargo?"
- "Show me recent recalls in the automotive sector"
- "Which companies have the worst fraud records?"
- "Which financial companies have the most complaints?"
How it works: AI parses your natural language query, detects intent, and filters results accordingly
AI-powered analysis of FTC data to identify:
- Emerging scam types
- Geographic hotspots
- Most vulnerable demographics
- Preventive recommendations
Usage: Query fraud-related data from FTC database
Get personalized advice based on real complaint data:
- Risk assessments for specific companies
- Guidance on filing complaints
- Understanding your consumer rights
Usage: Ask questions about specific companies or consumer protection topics
To enable AI-powered features:
- Get API Key: Sign up for Google Gemini API
- Add to .env: Set
VITE_GEMINI_API_KEY=your_key_here - Toggle AI Search: Click the sparkles β¨ icon in the search interface
- Ask Questions: Use natural language queries
Note: The app works without AI features but provides enhanced intelligence when configured.
Built following government design system principles inspired by:
- U.S. Web Design System (USWDS)
- GOV.UK Design System
- California Design System
- Massachusetts Mayflower Design System
- Color Palette: Unit-Connect green gradient hero, CFPB professional tables, Massachusetts bay blue accents
- Typography: Public Sans (California DS standard)
- Accessibility: WCAG 2.1 AA compliance
- Components: UK GOV.UK beta banner, left-bordered cards, government-style data tables
Focus on:
- β Accessibility (WCAG 2.1 AA compliance)
- β Usability and clarity
- β Trust and transparency
- β Mobile-first responsive design
- Real consumer protection - Helps vulnerable populations avoid fraud and unsafe products
- Open source tools - Built entirely with open source technologies
- Social impact - Empowers millions of consumers with government data
- Community driven - Welcomes contributors and scales to additional data sources
- First of its kind - Only platform combining 4 federal agencies with AI analysis
- Predictive insights - Gemini AI identifies emerging issues before they escalate
- Natural language - Makes complex government data accessible to everyone
- Personalized advice - Tailored recommendations based on real complaint patterns
- No user data collection
- No tracking or analytics
- All data sourced from public government databases
- Open source and transparent
Contributions are welcome! We're building a platform to empower consumers through transparency.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- π Additional data source integrations (FDA, EPA, etc.)
- π€ AI model improvements and new Gemini features
- βΏ Accessibility enhancements
- π Translation/internationalization
- π Data visualization improvements
- π§ͺ Test coverage expansion
See CONTRIBUTING.md for detailed guidelines.
Problem: Access to fetch has been blocked by CORS policy
Solution: The application now uses a CORS proxy (corsproxy.io) to handle this automatically. If you still see CORS errors:
- Check your browser's network tab to ensure the proxy is being used
- Try clearing browser cache and reloading
- For production deployments, consider setting up a custom backend proxy
Problem: Error 404: models/gemini-2.5-flash is not found for API version v1
Solution: This has been fixed by updating to @google/generative-ai v0.24.1+ and using the gemini-2.5-flash model. To enable AI features:
- Get an API key from Google Gemini
- Add it to your
.envfile:VITE_GEMINI_API_KEY=your_key_here - Restart the development server
Problem: Gemini API not configured
Solution: This is expected behavior when no API key is provided. The app will work without AI features using standard search.
Problem: ERR_CERT_AUTHORITY_INVALID when accessing FTC API
Solution: This has been fixed by routing FTC API calls through the CORS proxy, which also handles SSL certificate issues.
Problem: Too many requests to federal APIs
Solution:
- CFPB, NHTSA: No rate limits on public APIs
- FTC: Use DEMO_KEY for testing, get a real API key for production
- Gemini: Free tier has usage limits, upgrade for production use
Problem: "Some chunks are larger than 500 kB after minification"
Solution: This is a warning, not an error. The app builds successfully. To optimize:
- Consider code splitting with dynamic imports (future enhancement)
- Use
build.rollupOptions.output.manualChunksin vite.config.ts
We are committed to providing a welcoming and inclusive environment for all contributors. Please read our Code of Conduct before participating.
This project is licensed under the MIT License - see the LICENSE file for details.
- Data provided by U.S. federal agencies (CFPB, NHTSA, CPSC, FTC)
- AI powered by Google Gemini API
- Design inspired by government design systems (USWDS, GOV.UK, California DS, Massachusetts Mayflower)
- Built for Open Source Hackfest 2024
- Built for transparency and citizen empowerment
Watch our 2-minute demo showcasing the platform's features and AI capabilities: https://vimeo.com/1128404863?fl=pl&fe=sh
This project was created for Open Source Hackfest 2024 with these goals:
- Empower Consumers - Provide free access to critical government safety and complaint data
- Democratize AI - Make advanced AI analysis accessible for consumer protection
- Open Source Impact - Build a scalable, community-driven platform for social good
- Government Transparency - Aggregate and visualize data from multiple federal agencies
- Prevent Harm - Help consumers avoid fraud, recalls, and unsafe products
If you have questions or need help:
- π¬ Open an issue on GitHub
- π Check our documentation
- π€ Read our contributing guidelines
Made for government transparency and citizen empowerment πΊπΈ
Built for Open Source Hackfest 2024 | Version 2.0.0

