# Shop CMS setup

The Shop storefront and the existing React admin panel use the Laravel REST API under `/api/shop` and `/api/admin/shop`.

## Backend

1. Configure the database in `.env`.
2. Set `FRONTEND_URLS` to the comma-separated frontend origins allowed by CORS.
3. Run the migrations and import the existing Shop catalogue:

   ```powershell
   php artisan migrate
   php artisan db:seed --class=ShopSeeder
   php artisan storage:link
   ```

4. Create a new admin or promote an existing user:

   ```powershell
   php artisan shop:make-admin admin@example.com
   ```

The command asks for a password only when it creates a new user. You can also set `ADMIN_NAME`, `ADMIN_EMAIL`, and `ADMIN_PASSWORD` before running the main `DatabaseSeeder`.

## Frontend

Set the API base URL in `frontend-zedmtech/.env` when it differs from the production default:

```text
REACT_APP_API_URL=http://127.0.0.1:8000/api
```

The storefront keeps its current static catalogue as a temporary fallback if the API is unavailable. Once the API responds, all Shop sections, categories, products, stock, reviews, settings, and checkout use database data.
