# 16th Fleet Shared Hosting Deployment

## What this package contains

- A full Laravel application tree in `app/`
- A ready-to-upload public web folder in `lcars/`
- `vendor/` included, because the target host has no CLI/composer access
- Compiled frontend assets in `public/build/`
- No `.env` file and no database credentials

## Important compatibility note

This codebase is currently built against:

- Laravel `12.53.0`
- PHP `^8.2`

Do not mix this package with an older Laravel 11 `vendor/` directory. Upload the packaged application as a complete app deployment.

## Security defaults

- Secrets stay in server-side `.env` only
- `APP_DEBUG` must remain `false`
- Public demo route `/rss-demo` is disabled outside local development
- Stored Nova API keys are encrypted at rest in the database
- Outbound integrations only run when the relevant env keys are set

## Deployment target: `/lcars`

This package is prepared for a shared host where the public site is served from a subfolder such as:

- `https://your-domain.example/lcars`
- filesystem example:
  `/home/USER/public_html/lcars`

## Recommended upload layout

1. Upload and extract the zip so both folders are created side by side:
   `/home/USER/app`
   `/home/USER/public_html/lcars`
2. The packaged `lcars/index.php` already points at `../app/...`, so keep that relative layout intact.
3. Create `/home/USER/app/.env` from `/home/USER/app/.env.example`
4. Fill in at minimum:
   `APP_KEY`, `APP_URL`, `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD`
5. Set:
   `APP_URL=https://your-domain.example/lcars`
6. Ensure these are writable by PHP:
   `/home/USER/app/storage`
   `/home/USER/app/bootstrap/cache`

## If your host only lets you extract inside `public_html`

Keep the relative structure the same. For example:

- `/home/USER/public_html/app`
- `/home/USER/public_html/lcars`

That is less ideal because the app folder is under the web root, but it still works if the host does not allow a better layout. In that case, make sure the web server cannot browse or download files from `app/`.

## Required `.env` guidance

- Generate a fresh `APP_KEY` on the server if possible
- Never upload your local `.env`
- Keep `APP_DEBUG=false`
- For this subfolder deployment, set `APP_URL` to the full `/lcars` URL
- Only set integration keys you actually use:
  `DISCORD_BOT_TOKEN`, `CPANEL_API_TOKEN`, mail provider keys, AWS keys
- Leave unused keys blank

## Database and cache notes

- This app expects the database-backed defaults from `.env.example`:
  `SESSION_DRIVER=database`
  `CACHE_STORE=database`
  `QUEUE_CONNECTION=database`
- If the target Laravel 11 install already has the correct tables, reusing that database is fine
- If those tables do not exist and you cannot run migrations, change those values to file-based alternatives before go-live:
  `SESSION_DRIVER=file`
  `CACHE_STORE=file`
  `QUEUE_CONNECTION=sync`

## Final checks after upload

1. Open `/lcars/up` and confirm the app returns healthy
2. Open `/lcars` and a few public pages
3. Log in and confirm admin-only screens still require authentication
4. Confirm `.env` is not accessible over the web
5. Confirm the site is running your uploaded `vendor/` tree, not the old Laravel 11 one
