Skip to content

vkresch/reviewjanitor

Repository files navigation

Review Janitor - AI-Powered Amazon Review Management System

Alt text

Project Overview

Review Janitor is a full-stack web application designed to help Amazon sellers identify and remove policy-violating reviews from their products. The system leverages Google's Gemini AI to analyze reviews against Amazon's Community Guidelines and generates professional removal requests.

Architecture

  • Backend: FastAPI-based REST API with async patterns
  • Frontend: Next.js 16 application with React and TypeScript
  • Database: MongoDB with Motor async driver
  • AI Engine: Google Gemini 3 for review analysis
  • Authentication: JWT-based with Google OAuth support
  • Containerization: Docker and Docker Compose for deployment

Key Features

  • AI-powered review analysis against Amazon's Community Guidelines
  • Automated generation of professional removal requests
  • Case management system for tracking removal requests
  • User authentication and authorization
  • Real-time dashboard with analytics
  • Support for bulk review analysis

Technology Stack

Backend Technologies

  • Python 3.11: Main programming language
  • FastAPI: Modern, fast web framework with async support
  • MongoDB: NoSQL database for storing reviews, users, and cases
  • Motor: Async MongoDB driver for Python
  • Pydantic: Data validation and settings management
  • Google Generative AI: Gemini 3 for AI analysis
  • JWT: Authentication tokens
  • Passlib: Password hashing

Frontend Technologies

  • Next.js 16: React framework for production applications
  • React 19: UI library
  • TypeScript: Static type checking
  • Tailwind CSS: Utility-first CSS framework
  • Radix UI: Accessible UI components
  • Lucide React: Icon library
  • Zod: Schema validation
  • React Hook Form: Form management

Infrastructure

  • Docker: Containerization platform
  • Docker Compose: Multi-container orchestration
  • Redis: Caching and rate limiting (optional)

Building and Running

Prerequisites

  • Docker and Docker Compose
  • Node.js (for local development without containers)
  • Python 3.11 (for local development without containers)

Development Setup

Using Docker (Recommended)

# Clone the repository
git clone <repository-url>
cd reviewjanitor

# Create environment file
cp .env.example .env
# Edit .env with your API keys and credentials

# Start the entire stack
docker-compose up --build

The application will be available at:

Local Development

# Backend setup
cd backend
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

# Frontend setup
cd frontend
npm install
npm run dev

Environment Variables

The application requires several environment variables:

Backend Configuration

  • MONGODB_URL: MongoDB connection string
  • JWT_SECRET_KEY: Secret key for JWT tokens
  • GEMINI_API_KEY: Google Gemini API key
  • GOOGLE_CLIENT_ID: Google OAuth client ID
  • GOOGLE_CLIENT_SECRET: Google OAuth client secret

Frontend Configuration

  • NEXT_PUBLIC_API_URL: Backend API URL
  • NEXT_PUBLIC_GOOGLE_CLIENT_ID: Google OAuth client ID

API Endpoints

Authentication (/api/auth)

  • POST /register - User registration
  • POST /login - User login
  • GET /me - Get current user info
  • POST /google - Google OAuth login

Reviews (/api/reviews)

  • GET / - Get all reviews with filtering options
  • POST / - Create a new review
  • GET /{review_id} - Get a specific review
  • DELETE /{review_id} - Delete a review
  • POST /{review_id}/analyze - Analyze a review for violations
  • POST /bulk-analyze - Analyze multiple reviews

Cases (/api/cases)

  • GET / - Get all cases
  • POST / - Create a new case
  • GET /{case_id} - Get a specific case
  • PUT /{case_id} - Update a case
  • DELETE /{case_id} - Delete a case

Evidence (/api/evidence)

  • POST /generate - Generate evidence package for removal request

Analytics (/api/analytics)

  • GET /dashboard - Get dashboard statistics
  • GET /roi - Calculate ROI for review removal

Development Conventions

Backend

  • Follow FastAPI best practices for route definition and dependency injection
  • Use Pydantic models for request/response validation
  • Implement async patterns where possible for better performance
  • Use MongoDB aggregation pipelines for complex queries
  • Follow the repository pattern for database operations

Frontend

  • Use TypeScript for type safety
  • Follow Next.js 16 file-based routing conventions
  • Use Tailwind CSS for styling with consistent design tokens
  • Implement form validation with Zod and React Hook Form
  • Use Radix UI components for accessibility

Testing

  • Write unit tests using pytest for backend
  • Use async tests for database and API operations
  • Implement integration tests for critical workflows

Security

  • Validate all inputs using Pydantic models
  • Use JWT tokens with proper expiration times
  • Hash passwords with bcrypt
  • Implement proper CORS configuration
  • Sanitize user-generated content before AI processing

Project Structure

reviewjanitor/
├── backend/                 # FastAPI backend
│   ├── ai_engine.py         # Gemini 3 AI integration
│   ├── auth.py              # Authentication logic
│   ├── config.py            # Application settings
│   ├── database.py          # MongoDB connection and utilities
│   ├── main.py              # Application entry point
│   ├── models.py            # Pydantic data models
│   └── routers/             # API route definitions
│       ├── auth.py
│       ├── reviews.py
│       ├── cases.py
│       ├── evidence.py
│       └── analytics.py
├── frontend/                # Next.js frontend
│   ├── app/                 # Next.js 16 file-based routes
│   ├── components/          # Reusable UI components
│   ├── hooks/               # Custom React hooks
│   ├── lib/                 # Shared utilities
│   ├── public/              # Static assets
│   └── styles/              # Global styles
├── scripts/                 # Utility scripts
├── docker-compose.yml       # Multi-container orchestration
└── QWEN.md                 # This file

AI Analysis Capabilities

The system uses Google's Gemini 3 model to analyze reviews against Amazon's Community Guidelines. It can detect:

  • Shipping and fulfillment complaints
  • Promotional content
  • Personally identifiable information (PII)
  • Competitor attacks
  • Profanity and inappropriate content
  • Unverified purchase reviews
  • Irrelevant content

The AI provides confidence scores and detailed reasoning for each violation detection, along with specific citations from Amazon's guidelines.

Deployment

The application is designed for containerized deployment using Docker. Production deployments should:

  • Use environment variables for configuration
  • Implement SSL/TLS termination
  • Set up proper logging and monitoring
  • Configure backup strategies for MongoDB
  • Use production-grade reverse proxy (nginx, traefik)

About

Fix Amazon Reviews

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors