# Car Rental System - Deployment Guide

## Requirements
- Node.js 20+
- PostgreSQL Database (Supabase)
- cPanel with Node.js support

## Files to Upload
Upload all files except:
- node_modules/
- .next/
- .git/

## cPanel Setup Steps

### 1. Create Node.js App
- Go to cPanel → Software → Setup Node.js App
- Node.js version: 20
- Application root: /home/username/car-rental
- Application URL: your-domain.com
- Application startup file: server.js

### 2. Environment Variables
Create `.env` file with:
```
NODE_ENV=production
PORT=3000
HOSTNAME=0.0.0.0
DATABASE_URL=your_supabase_url
DIRECT_URL=your_supabase_direct_url
AUTH_SECRET=your_random_secret
NEXTAUTH_URL=https://your-domain.com
NEXTAUTH_TRUST_HOST=true
```

### 3. Install Dependencies
```bash
cd /home/username/car-rental
npm ci
```

### 4. Generate Prisma Client
```bash
npx prisma generate
```

### 5. Run Migrations
```bash
npx prisma migrate deploy
```

### 6. Build
```bash
npm run build
```

### 7. Start App
```bash
npm start
```

## Default Login Credentials
- Super Admin: superadmin@demo.local / Admin123!
- Swift Drive: admin@swift-drive.local / Admin123!
- Desert Rides: admin@desert-rides.local / Admin123!

## Troubleshooting
- If port 3000 is busy, change PORT in .env
- Check logs in cPanel → Metrics → Errors
- Make sure database is accessible from server IP
