A Laravel application that analyzes Amazon product reviews to detect fake reviews using AI. Supports Amazon products from 14+ countries including US, Canada, Germany, France, UK, Japan, Mexico, Brazil, India, Singapore, and more. The service includes multiple data collection methods with BrightData's managed web scraping, direct Amazon scraping, and comprehensive AI analysis with multi-provider support.
Visit nullfake.com to try it out.
Read our blog post about how nullfake works
- Getting Started
- How It Works
- Supported Countries
- Features
- Data Collection Methods
- Database Schema
- Technology Stack
- Configuration
- Management Commands
- Usage
- Development
- License
- Shift8
Before setting up Null Fake, ensure you have the following installed:
- PHP 8.2 or higher with the following extensions:
- BCMath
- Ctype
- cURL
- DOM
- Fileinfo
- JSON
- Mbstring
- OpenSSL
- PCRE
- PDO
- Tokenizer
- XML
- Composer (for PHP dependency management)
- Node.js 18+ and npm (for frontend asset compilation)
- MySQL 8.0+ or PostgreSQL 13+
- Redis (optional, for caching and queue management)
-
Clone the repository:
git clone https://github.com/stardothosting/nullfake.git cd nullfake
-
Install PHP dependencies:
composer install
-
Install Node.js dependencies:
npm install
-
Build frontend assets:
npm run build
-
Copy the environment file:
cp .env.example .env
-
Generate application key:
php artisan key:generate
-
Configure your
.env
file with the following essential settings:# Application APP_NAME="Null Fake" APP_ENV=local APP_DEBUG=true APP_URL=http://localhost:8000 # Database DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=nullfake DB_USERNAME=your_db_user DB_PASSWORD=your_db_password # Queue Configuration QUEUE_CONNECTION=database ANALYSIS_ASYNC_ENABLED=true # Choose your LLM provider (required for analysis) # Option 1: OpenAI LLM_PRIMARY_PROVIDER=openai OPENAI_API_KEY=sk-proj-your-openai-key-here OPENAI_MODEL=gpt-4o-mini # Option 2: DeepSeek (cost-effective) # LLM_PRIMARY_PROVIDER=deepseek # DEEPSEEK_API_KEY=sk-your-deepseek-key-here # DEEPSEEK_MODEL=deepseek-v3 # Option 3: Self-hosted Ollama (free) # LLM_PRIMARY_PROVIDER=ollama # OLLAMA_BASE_URL=http://localhost:11434 # OLLAMA_MODEL=qwen2.5:7b # Amazon Review Service (choose one) AMAZON_REVIEW_SERVICE=brightdata # or 'scraping' or 'ajax' # If using BrightData BRIGHTDATA_SCRAPER_API=your-brightdata-api-key # If using direct scraping (add multiple sessions for rotation) # AMAZON_COOKIES_1=your-session-cookies-here # AMAZON_COOKIES_2=your-session-cookies-here # Captcha (for production) CAPTCHA_ENABLED=false # Set to true in production # RECAPTCHA_SITE_KEY=your-recaptcha-site-key # RECAPTCHA_SECRET_KEY=your-recaptcha-secret-key
-
Create your database:
# For MySQL mysql -u root -p -e "CREATE DATABASE nullfake CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" # For PostgreSQL createdb nullfake
-
Run migrations:
php artisan migrate
-
Seed the database (optional):
php artisan db:seed
-
Start the Laravel development server:
php artisan serve
The application will be available at
http://localhost:8000
-
Start the queue worker (in a separate terminal):
php artisan queue:work --queue=analysis
-
For development with hot reloading (optional, in a separate terminal):
npm run dev
- Visit
http://localhost:8000
- Enter an Amazon product URL (e.g.,
https://amazon.com/dp/B08N5WRWNW
) - Complete the captcha if enabled
- Watch the analysis process in real-time
Choose one of the following AI providers for review analysis:
Perfect for development and cost-conscious deployments:
-
Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
-
Pull a model:
# Lightweight model (3B parameters) ollama pull llama3.2:3b # Better quality model (7B parameters) ollama pull qwen2.5:7b
-
Configure in
.env
:LLM_PRIMARY_PROVIDER=ollama OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_MODEL=qwen2.5:7b
Most reliable, requires API key:
LLM_PRIMARY_PROVIDER=openai
OPENAI_API_KEY=sk-proj-your-openai-key-here
OPENAI_MODEL=gpt-4o-mini
94% cheaper than OpenAI with comparable quality:
LLM_PRIMARY_PROVIDER=deepseek
DEEPSEEK_API_KEY=sk-your-deepseek-key-here
DEEPSEEK_MODEL=deepseek-v3
Common Issues:
- "Class not found" errors: Run
composer dump-autoload
- Permission errors: Ensure
storage/
andbootstrap/cache/
are writable - Queue jobs not processing: Make sure
php artisan queue:work
is running - LLM provider errors: Test your provider with
php artisan llm:manage test
- Amazon scraping fails: Check your cookies/API keys and test with
php artisan test:amazon-scraping
Logs and Debugging:
- Application logs:
storage/logs/laravel.log
- Queue jobs:
php artisan queue:failed
to see failed jobs - Debug mode: Set
APP_DEBUG=true
in.env
- User submits an Amazon product URL from any supported country and completes a captcha
- Null Fake automatically detects the country and retrieves the ASIN from the URL
- Database check: If a review analysis for the given ASIN and country exists in the database (and is less than 30 days old), the cached analysis is returned instantly
- If fresh data is needed, the service fetches reviews using the configured data collection method (BrightData, direct scraping, or AJAX bypass)
- Reviews are analyzed using AI with configurable thresholds for fake review detection
- Results are displayed including fake review percentage, grade, explanation, and ratings
Null Fake supports Amazon product analysis from the following countries:
Country | Amazon Domain | Status |
---|---|---|
๐บ๐ธ United States | amazon.com | โ Full Support |
๐จ๐ฆ Canada | amazon.ca | โ Full Support |
๐ฉ๐ช Germany | amazon.de | โ Full Support |
๐ซ๐ท France | amazon.fr | โ Full Support |
๐ฌ๐ง United Kingdom | amazon.co.uk | โ Full Support |
๐ฎ๐น Italy | amazon.it | โ Full Support |
๐ช๐ธ Spain | amazon.es | โ Full Support |
๐ฏ๐ต Japan | amazon.co.jp | โ Full Support |
๐ฆ๐บ Australia | amazon.com.au | โ Full Support |
๐ฎ๐ณ India | amazon.in | โ Full Support |
๐ฒ๐ฝ Mexico | amazon.com.mx | โ Full Support |
๐ง๐ท Brazil | amazon.com.br | โ Full Support |
๐ธ๐ฌ Singapore | amazon.sg | โ Full Support |
๐ณ๐ฑ Netherlands | amazon.nl | โ Full Support |
Additional domains supported: Turkey, UAE, Saudi Arabia, Sweden, Poland, Egypt, Belgium
Note: All countries use the same sophisticated AI analysis and data collection methods. Product metadata, review extraction, and fake review detection work consistently across all supported Amazon domains.
- BrightData Integration: Professional web scraping with managed infrastructure and anti-bot protection
- Direct Amazon Scraping: Custom scraping with proxy support and session management
- AJAX Bypass: Alternative method using Amazon's internal endpoints
- Multi-session Management: Cookie rotation across multiple Amazon sessions for reliability
- Rate Limiting: Configurable delays and request throttling
- Multi-provider Support: OpenAI, DeepSeek, or self-hosted Ollama
- Configurable Thresholds: Adjustable fake review detection sensitivity (default: 85+ score)
- Comprehensive Scoring: Heuristic analysis combined with LLM evaluation
- Grade System: Letter grades (A-F) with detailed explanations
- Real-time Progress: Job-based processing with live progress updates
- Asynchronous Processing: Queue-based analysis for better performance
- Captcha Protection: reCAPTCHA and hCaptcha support with session persistence
- Product Metadata: Title, image, and description extraction for complete product pages
- Shareable URLs: SEO-optimized product analysis pages
- Database Caching: Fast repeat lookups with 30-day cache validity
- Comprehensive Alerting: Pushover notifications for API errors and system issues
- Command Line Tools: Management commands for data processing and system maintenance
- Test Coverage: Extensive test suite with 396+ tests covering all major functionality
The application supports three primary methods for collecting Amazon review data:
Professional managed scraping service with enterprise-grade infrastructure:
AMAZON_REVIEW_SERVICE=brightdata
BRIGHTDATA_SCRAPER_API=your-api-key-here
Benefits:
- Managed anti-bot protection
- High success rates for data collection
- Professional infrastructure
- Built-in retry mechanisms
Custom scraping implementation with advanced session management:
AMAZON_REVIEW_SERVICE=scraping
AMAZON_COOKIES_1=your-session-cookies-here
AMAZON_COOKIES_2=your-session-cookies-here
# Up to AMAZON_COOKIES_10 for rotation
Features:
- Multi-session cookie rotation
- CAPTCHA detection and alerting
- Proxy integration support
- Bandwidth optimization
Alternative method using Amazon's internal AJAX endpoints:
AMAZON_REVIEW_SERVICE=ajax
Note: Currently disabled pending optimization. Uses Amazon's review rendering endpoints to bypass traditional page scraping.
The asin_data
table stores:
asin
- Amazon Standard Identification Numbercountry
- Country code (e.g., 'us', 'ca')product_title
- Product title from Amazonproduct_description
- Product description from Amazonproduct_image_url
- Product image URLreviews
- JSON array of fetched reviewsopenai_result
- JSON of full AI analysis with detailed scorestotal_reviews_on_amazon
- Total review count reported by Amazonhave_product_data
- Boolean indicating complete product metadata
The model calculates:
fake_percentage
- Percentage of reviews flagged as potentially fake (score โฅ 85)grade
- Letter grade (A-F) based on fake review percentageexplanation
- Human-readable analysis summaryamazon_rating
- Original average rating from all reviewsadjusted_rating
- Adjusted rating excluding fake reviews
- Backend: Laravel 12 with Livewire 3
- Database: MySQL/PostgreSQL with JSON columns
- Queue System: Database-driven job processing for asynchronous analysis
- Session Management: Multi-provider session rotation for Amazon access
- AI Integration: Multi-provider LLM support with automatic failover
- Security: reCAPTCHA/hCaptcha integration with session persistence
- Monitoring: Comprehensive alerting via Pushover for system health
The application supports three AI providers for review analysis:
LLM_PRIMARY_PROVIDER=openai
OPENAI_API_KEY=sk-proj-your-openai-key-here
OPENAI_MODEL=gpt-4o-mini
LLM_PRIMARY_PROVIDER=deepseek
DEEPSEEK_API_KEY=sk-your-deepseek-key-here
DEEPSEEK_MODEL=deepseek-v3
- Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
- Pull a model:
ollama pull qwen2.5:7b
orollama pull llama3.2:3b
- Configure:
LLM_PRIMARY_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=qwen2.5:7b
LLM_AUTO_FALLBACK=true
Control job-based vs immediate processing:
ANALYSIS_ASYNC_ENABLED=true # Use job queues (recommended for production)
QUEUE_CONNECTION=database # Database-backed job processing
For immediate processing (development):
ANALYSIS_ASYNC_ENABLED=false
- Check provider status:
php artisan llm:manage status
- Switch providers:
php artisan llm:manage switch --provider=ollama
- Compare costs:
php artisan llm:manage costs --reviews=100
- Test providers:
php artisan llm:manage test
- Process existing products:
php artisan asin:process-existing --missing-any
- Clean zero-review products:
php artisan products:cleanup-zero-reviews
- Backfill total review counts:
php artisan backfill:total-review-counts
- Check Amazon sessions:
php artisan amazon:cookie-sessions
- Test scraping functionality:
php artisan test:amazon-scraping
- Test international URLs:
php artisan test:international-urls
- Debug proxy connections:
php artisan debug:amazon-scraping
- Start queue worker:
php artisan queue:work --queue=analysis
- Restart workers:
php artisan queue:restart
- Enter an Amazon product URL from any supported country (US, Canada, Germany, France, UK, Japan, Mexico, Brazil, India, Singapore, etc.)
- Complete the captcha (production only)
- View real-time progress as analysis processes
- Review detailed results including:
- Fake review percentage with adjustable thresholds
- Letter grade (A-F) based on authenticity
- Detailed explanation of findings
- Original vs adjusted ratings
- Product metadata and images
- Country-specific analysis results
Run the comprehensive test suite:
php artisan test
The application includes 396+ tests covering:
- Unit tests for all major services
- Feature tests for user workflows
- Integration tests for external services
- Mock-based testing to prevent external API calls
Maintain code quality with Laravel Pint:
./vendor/bin/pint
MIT
Developed in Toronto, Canada by Shift8 Web