# ReviewGuard

ReviewGuard is a single administrator Laravel application for responsible Google Business Profile reputation work. It scans public review data from a Google Maps link, lets the administrator select specific one and two star reviews, highlights possible policy signals, prepares evidence based report drafts, tracks Google decisions and appeals, and keeps a permanent activity record.

It does not delete customer reviews. Google makes removal decisions after assessing reports against its policies.

## Included features

1. Single administrator login with no public registration
2. Business workspace management
3. One and two star review queue
4. Public link scanning through an Outscraper provider key
5. Selectable review queue and bulk report preparation
6. Manual review entry and CSV import
7. Optional authorized Google Business Profile API sync
8. Rule based signal assessment
9. Review specific policy category and evidence workflow
10. Tracked report batches
11. Submission, decision, appeal, and removal tracking
12. Actual success rate calculated from decided cases
13. Permanent activity record with administrator and timestamps
14. Genuine rating growth calculator
15. Responsive modern interface
16. MySQL migrations and environment based administrator seeding

## Requirements

1. PHP 8.2 or newer
2. MySQL 8 or MariaDB 10.6 or newer
3. Composer 2
4. PHP extensions commonly required by Laravel, including BCMath, Ctype, cURL, DOM, Fileinfo, JSON, Mbstring, OpenSSL, PDO, PDO MySQL, Tokenizer, and XML

No Node build is needed. The compiled application styles and JavaScript are already in the public directory.

## Local installation

```bash
cp .env.example .env
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan migrate --force
php artisan db:seed --force
php artisan optimize
```

Set the database and administrator values in `.env` before running the seeder. Change the example administrator password.

## Review CSV format

The required headers are `reviewer_name` and `rating`. Supported optional headers are `review_text`, `review_url`, `reviewed_at`, `reviewer_profile_url`, and `google_review_id`.

Only one and two star rows are imported. Other ratings are skipped intentionally.

## Public review scanner

Create an Outscraper account and API key, then open Public scanner inside ReviewGuard and save the key. It is encrypted in the database and never displayed again. You can alternatively set `OUTSCRAPER_API_KEY` in `.env`.

Add a business with its public Google Maps URL, open the business, and run Scan one and two star reviews. No client email, password, Google ownership access, account ID, or location ID is required for this provider based collection method.

The provider collects public data only. It does not delete reviews and does not guarantee that Google will remove a report. Provider usage and charges are controlled by your own Outscraper account.

## Selection and reporting

Select individual reviews in the low review queue and choose Prepare selected reviews. Every selected item requires its own Google policy category and factual evidence. ReviewGuard then creates an individual report case and groups the cases in a tracked batch.

Submission remains a deliberate administrator action through Google's official tools. Record each submission, reference, appeal, rejection, or removal in the case tracker. The dashboard success rate is based only on actual decided cases and is never guaranteed or preset.

## Activity record

The Activity record stores access events, business changes, scan and import results, review analysis, report preparation, status transitions, and provider configuration changes. Provider keys and passwords are never written to this record.

## Google connection

The Google Business Profile API requires an approved Google Cloud project, OAuth web credentials, and access to the profiles being managed. Configure:

```dotenv
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI="https://your-domain.com/settings/google/callback"
```

After connecting, add the Google account ID and location ID to each business. The sync imports one and two star reviews only.

This authorized connection is optional when the public scanner is configured.

Google does not expose an API endpoint that deletes customer reviews or submits removal reports. ReviewGuard opens the official Review Management Tool and tracks the result after the administrator submits a valid report.

See `CPANEL_DEPLOYMENT.md` for production steps.
