# Mini Tanzania Travel and Properties - VPS Deployment

## Requirements

- Node.js 22.13 or newer
- npm
- A process manager such as PM2 is recommended
- Optional: Nginx as a reverse proxy

## Upload

Upload and extract the archive on your VPS:

```bash
mkdir -p /var/www/mini
tar -xzf mini-tanzania-vps.tar.gz -C /var/www/mini
cd /var/www/mini
```

## Install And Build

```bash
npm install
npm run build
```

If your hosting panel hides dot-folders during upload, this package still builds
without `.openai/hosting.json`. If you use the older package and see
`Could not resolve './.openai/hosting.json'`, upload the new package or create
this file manually:

```bash
mkdir -p .openai
printf '{ "project_id": null, "d1": null, "r2": null }\n' > .openai/hosting.json
```

## Start

For a quick start:

```bash
npm run start
```

For production with PM2:

```bash
npm install -g pm2
pm2 start npm --name mini-tanzania -- run start
pm2 save
pm2 startup
```

## Nginx Example

Point your domain to the VPS, then proxy traffic to the app port used by the running server.

```nginx
server {
    server_name your-domain.com www.your-domain.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
```

Then enable HTTPS with Certbot or your preferred SSL provider.
