# Tahraga Travel — Production Deployment

This package is a Node.js application with a React/Vite frontend, Express/tRPC backend, and optional MySQL persistence.

## Requirements

- Node.js 20 or newer
- pnpm 10
- A Node-compatible host or VPS
- MySQL database for live offers, enquiries, destinations, and administration
- SSL certificate for the public domain

## Environment

Create a `.env` file on the server. At minimum, configure:

```env
NODE_ENV=production
PORT=3000
DATABASE_URL=mysql://USER:PASSWORD@HOST:3306/DATABASE
JWT_SECRET=REPLACE_WITH_A_LONG_RANDOM_SECRET
OAUTH_SERVER_URL=
OWNER_OPEN_ID=
VITE_APP_ID=
```

Add any authentication, storage, analytics, or Google Places variables used by your production account. Do not commit the `.env` file.

## Install and run

```bash
corepack enable
pnpm install --frozen-lockfile
pnpm build
pnpm start
```

The included `dist/` directory is a verified production build. Dependencies must still be installed before starting the Node server.

## Database

After configuring `DATABASE_URL`, apply the included Drizzle migrations before opening the administration area:

```bash
pnpm db:push
```

Back up an existing production database before running migrations.

## Domain setup

Point the website domain to the Node application using the hosting control panel or a reverse proxy. Preserve existing email-related DNS records. Enable HTTPS and redirect HTTP traffic to HTTPS.

## WordPress hosting

This ZIP is not a WordPress theme. It requires Node.js hosting. A PHP-only WordPress plan cannot run the server directly; use a Node application feature in the hosting panel or deploy to a Node-compatible service and point the domain to it.
