# TechShop Commerce OS V8 — Fresh Laragon Install

This V8 package is intended to support a completely new TechShop database. Do **not** import the old `TechShop_All_In_One_Database_Upgrade.sql` into this V8 fresh database; older experimental gateway schemas are intentionally not used here.

## 1. Extract
Extract the package to:

`C:\laragon\www\techshop`

## 2. Start MySQL
Open Laragon and click **Start All**. Confirm MySQL is running.

## 3. Configure local environment
Copy `.env.local.example` to `.env`, then set at least:

- `DB_PORT` if Laragon uses something other than 3306
- `ADMIN_EMAIL`
- `ADMIN_PASSWORD`
- `APP_KEY`

For normal local Laragon MySQL, `DB_USERNAME=root` and an empty `DB_PASSWORD` are common defaults.

## 4. Import one fresh SQL file
In phpMyAdmin, use **Import** and choose:

`database/TechShop_Fresh_Database.sql`

That file creates/selects the `techshop` database and creates the canonical V8 tables, including `products.condition`, payment gateway settings, website branding, adverts and flash sales.

## 5. Install PHP dependencies
Run:

`composer install --no-dev --optimize-autoloader`

This is needed for components such as PHPMailer and passkey/WebAuthn verification.

## 6. Seed roles and administrator
Run:

`php bin/seed.php`

Use the exact `ADMIN_EMAIL` and `ADMIN_PASSWORD` from `.env` to sign in.

## 7. Validate source and runtime
Run:

`php bin/validate-v8.php`

Then:

`php bin/diagnose-v8.php`

Resolve every FAIL before payment testing.

## 8. Start local server
Run:

`php -S 127.0.0.1:8000 router.php`

Open `http://127.0.0.1:8000`.

## Important payment note
The canonical gateway identifiers are exactly:

- `paystack`
- `monnify`
- `flutterwave`
- `bnpl`

Pay on Delivery is a checkout method controlled through system settings and is **not** an online gateway adapter. The Admin Payment Control Centre is the place to activate and configure online providers. Use provider test/sandbox credentials before live credentials.

## VAT
Fresh V8 defaults to 0%. When the rate is 0, VAT is hidden from customer totals. Admin must explicitly set a positive VAT rate for VAT to appear and be charged.
