# RRC Church System — Production Deployment

## Hosting requirements

- PHP 8.1 or newer with PDO MySQL, cURL, mbstring, fileinfo and JSON
- MySQL 8.0+ or MariaDB 10.5+
- Apache with `mod_rewrite` (or equivalent Nginx routing)
- HTTPS certificate

## Recommended deployment

1. Create a new database and a database user with access only to that database.
2. Import `database/latest_import.sql` using the hosting control panel or command line.
3. Upload this folder outside the public web directory where possible.
4. Point the domain/subdomain document root to this package's `public/` folder.
5. Set the environment variables shown in `.env.example` in the hosting panel. Set `RRC_APP_BASE` to an empty value when the document root points to `public/`.
6. Ensure PHP can write only to `public/uploads/` and `backups/`; keep other application files read-only.
7. Sign in, immediately change the default administrator password, test member registration, attendance, finance, reports and backup download.
8. Configure automatic off-site backups through the hosting provider. Do not rely only on backups stored beside the application.

## Shared-hosting fallback

If the host cannot point the document root to `public/`, keep the full package in a non-public folder and copy only `public/` into the domain root, adjusting the bootstrap path in `index.php`. Do not expose `app/`, `database/`, or `backups/` to the web.

## Security checklist

- Force HTTPS and use a strong, unique database password.
- Replace the documented default administrator password before real use.
- Do not upload `.env.example` with real secrets inside it.
- Remove old database exports from the server after a verified import.
- Test restore procedures before entering live church records.
