# Freight Runner PWA Deployment

## Actions completed
- Added Progressive Web App support with manifest, service worker, and install metadata.
- Added app icons using the supplied OKTL icon.
- Added install button support and iPhone Add to Home Screen guidance.
- Added CORS middleware, request logging, server startup error handling, and API documentation endpoint.
- Prepared the project as a standard Node deployment package.

## Included PWA files
- `public/manifest.webmanifest`
- `public/sw.js`
- `public/icons/icon-192.png`
- `public/icons/icon-512.png`

## Deployment structure
Deploy the project root as the Node application root:
- `server.js`
- `package.json`
- `public/`
- `data/`

## Hosting configuration
Use:
- Application root: project root
- Startup file: `server.js`
- Startup command: `npm start`

Do not rely on `startup.sh` for standard shared Node hosting unless your provider explicitly requires it.

## Install dependencies
From the app root:
```bash
npm install
```

## Start the app
```bash
npm start
```

## Required public URLs
Confirm these load successfully after deployment:
- `/`
- `/health`
- `/api/docs`
- `/manifest.webmanifest`
- `/sw.js`
- `/icons/icon-192.png`
- `/icons/icon-512.png`

## PWA notes
- Android/Chromium browsers should show an install prompt when install criteria are met.
- iPhone users install through Safari Share > Add to Home Screen.
- The manifest sets the app to standalone mode with preferred landscape orientation.

## API documentation
### GET `/health`
Returns server health.
### GET `/api/docs`
Returns API documentation.
### GET `/api/scores`
Returns top 10 scores.
### POST `/api/scores`
Accepts JSON:
```json
{ "name": "Player", "score": 120 }
```

## Recommended runtime
Use Node.js 20 LTS or newer. Avoid experimental hosting runtimes where possible.
