# Multi-Channel Radio Admin - Installation Guide (cPanel, No SSH)

This is **Phase 1** of the project: Laravel foundation, full database schema, admin
authentication with role-based permissions, and the dashboard shell. Radio/Category/
Podcast/Home/API modules etc. follow in later phases (see ROADMAP.md).

## Before you upload anywhere: prepare the vendor folder

This build environment has no PHP/Composer, so the `vendor/` folder (Laravel's
dependencies) is **not** included in this package yet. Composer needs internet access
to Packagist, which your cPanel host won't have either - so this step happens once,
somewhere with internet access (your own machine, or a Claude Code sandbox with
network access):

```bash
composer install --no-dev --optimize-autoloader
php artisan key:generate --show   # copy this value for APP_KEY in step 6 below
```

This creates `vendor/`. Zip the **entire project folder** (including the new
`vendor/` directory) for upload. Everything after this point is pure cPanel/browser -
no terminal needed on the production server.

## cPanel Installation Steps

1. **Create MySQL database** - cPanel → MySQL Databases → create a new database
   (e.g. `cpaneluser_radio`).
2. **Create MySQL user** - create a user with a strong password.
3. **Assign user to database** - grant ALL PRIVILEGES.
4. **Upload the ZIP** - cPanel File Manager → upload to your account's root
   (e.g. the folder that contains `public_html`, or directly inside `public_html`
   if that's your only option - see the note on `.htaccess` below).
5. **Extract the ZIP** in place.
6. **Configure `.env`** - copy `.env.example` to `.env`, then fill in:
   - `APP_KEY` (from the `key:generate --show` command above)
   - `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD` (from steps 1-3)
   - `APP_URL` (your domain)
7. **Import `database.sql`** via phpMyAdmin - this creates every table and seeds
   Languages, Categories, and RBAC roles/permissions. It does **not** create your
   admin login (see step 8 - a real password hash can only be generated by PHP,
   not typed into phpMyAdmin).
8. **Create your Super Admin account** - visit `https://yourdomain.com/setup-admin.php`,
   fill in the form, submit, then **delete `setup-admin.php` from the server**
   immediately (see warning in that file).
9. **Set folder permissions** - via File Manager, ensure `storage/` and
   `bootstrap/cache/` are writable (755, or 775 if your host requires it).
10. **Open the application** - go to `https://yourdomain.com/admin/login` and log in.

### Where does the webroot point?

If your cPanel account's document root is `public_html` and you can't repoint it to
`public_html/public`, extract this project **into `public_html` directly**. The
included root `.htaccess` transparently rewrites every request into `/public` for
you, so `index.php`, `.env`, `app/`, etc. are never directly web-accessible even
though they sit alongside `public/`.

If your host *does* let you set the document root to a `public` subfolder, do that
instead and you can delete the root `.htaccess`.

## Demo login (after running the seeder or setup-admin.php)

- Email: whatever you entered in `setup-admin.php`
- Role: Super Admin (full access to every module)

## What's included in this phase

- Full database schema for the entire spec (languages replace countries everywhere -
  no `countries` table or `country_id` column anywhere)
- Migrations (for anyone who *does* have a PHP/MySQL dev environment to iterate in)
  plus the equivalent hand-maintained `database.sql` for phpMyAdmin import
- Seeders for demo Languages, Categories, roles/permissions, and 10 demo radios
- Admin authentication (separate `admin` guard from the mobile-app `users` table),
  with remember-me, account disable, and activity logging
- Role-based permission middleware (`permission:radios`, etc.) with per-admin
  grant/revoke overrides support already in the schema
- Dark dashboard shell matching the spec's color palette (configurable via the
  `settings` table), full sidebar navigation, and a working stat-card + chart
  dashboard
- One complete reference CRUD module (**Languages**) - Add/Edit/Delete/Enable/
  Disable/Search/Pagination - to establish the pattern every later module follows
