# Quick Start Guide

## First Time Deployment

1. **Navigate to project directory:**
   ```bash
   cd /home/aibitsofts/public_html/aibitadmin.aibitsoft.cloud
   ```

2. **Create `.env` file:**
   ```bash
   # Copy example (if .env.example exists)
   # Or create manually with your production values
   nano .env
   ```

3. **Run deployment script:**
   ```bash
   ./deploy.sh
   ```

   Or manually:
   ```bash
   npm install --production
   npm run build
   mkdir -p logs
   pm2 start ecosystem.config.js
   pm2 save
   ```

4. **Verify it's running:**
   ```bash
   pm2 status
   curl http://localhost:4000/api/health
   ```

## Required Environment Variables

Create a `.env` file with at minimum:

```env
PORT=4000
NODE_ENV=production
MONGO_URL=mongodb+srv://user:pass@cluster.mongodb.net/dbname
JWT_SECRET=your_strong_secret_here
```

See `DEPLOYMENT.md` for full configuration options.

## cPanel Node.js Selector Setup

1. Log into cPanel
2. Find "Node.js Selector" or "Setup Node.js App"
3. Create application:
   - **Root:** `/home/aibitsofts/public_html/aibitadmin.aibitsoft.cloud`
   - **URL:** `aibitadmin.aibitsoft.cloud`
   - **Startup:** `dist/server.js`
   - **Port:** `4000`

## Common Commands

```bash
# View logs
pm2 logs aibitadmin-backend

# Restart
pm2 restart aibitadmin-backend

# Stop
pm2 stop aibitadmin-backend

# Status
pm2 status
```

## Project Isolation

✅ This project is isolated in its own directory  
✅ Uses unique PM2 app name: `aibitadmin-backend`  
✅ Won't affect other projects in `/home/aibitsofts/public_html/`
