# 📋 Easy Installation - Quick Reference Card

## 🚀 Get Started in 3 Steps

### Step 1: Run Installation
```bash
# Windows
easy-install.bat

# macOS / Linux
bash easy-install.sh

# Or Interactive Wizard
node install.js
```

### Step 2: Configure (if needed)
```bash
# Edit backend/.env
# Edit frontend/.env
```

### Step 3: Start Development
```bash
# Terminal 1: Backend
cd backend
npm start

# Terminal 2: Frontend
cd frontend
npm run dev

# Visit: http://localhost:3000
```

---

## 📦 Installation Tools

| Tool | Command | Purpose | Time |
|------|---------|---------|------|
| **Easy Install** | `bash easy-install.sh` | Automatic setup | 2-5 min |
| **Interactive** | `node install.js` | Guided setup | 5-10 min |
| **Check System** | `node check-requirements.js` | Verify ready | 1 min |
| **Check Status** | `node installation-status.js` | See progress | 1 min |

---

## 🎯 Choose Your Path

### Path A: I want to start FAST ⚡
```bash
bash easy-install.sh
npm start --prefix backend
```

### Path B: I want GUIDED setup 📖
```bash
node install.js
npm start --prefix backend
```

### Path C: I want to VERIFY everything ✓
```bash
node check-requirements.js
node install.js
node installation-status.js
npm start --prefix backend
```

---

## 🔧 Configuration Files

### Backend Config (`backend/.env`)
```env
# Database
DB_HOST=localhost
DB_USER=fmpdcrei_tta1
DB_PASSWORD=Chintan@1993
DB_NAME=fmpdcrei_tta1

# Server
PORT=3000
NODE_ENV=production
CORS_ORIGIN=https://crm.trusttaxadvisor.com

# Email
SMTP_HOST=mail.trusttaxadvisor.com
SMTP_USER=noreply@trusttaxadvisor.com
SMTP_PASSWORD=Chintan@1993
SMTP_PORT=465

# WhatsApp
WHATSAPP_API_URL=https://whatsapp.thechintanpatel.co.in/api/create-message
WHATSAPP_APP_KEY=1a68fcd1-3746-4be7-9cc0-334423e4e1d5
WHATSAPP_AUTH_KEY=yoQ5tAx2MjtnOM2JCu8HU5IuL14DDkKesmGnCVOLRzuyVbu1qv
```

### Frontend Config (`frontend/.env`)
```env
VITE_API_URL=https://crm.trusttaxadvisor.com
```

---

## 📝 What Gets Installed

```
✓ Backend dependencies (npm install)
✓ Frontend dependencies (npm install)
✓ Configuration files (.env)
✓ Database schema (optional)

Total: ~700MB
Time: 5-10 minutes
```

---

## 🐛 If Something Goes Wrong

| Problem | Solution |
|---------|----------|
| Port already in use | Change PORT in .env or close other app |
| npm install fails | `npm cache clean --force` then retry |
| Database not found | `CREATE DATABASE fmpdcrei_tta1;` |
| Can't connect to DB | Check credentials in backend/.env (fmpdcrei_tta1/Chintan@1993) |
| Cannot find module | Delete node_modules and npm install again |

---

## ⚡ Quick Commands Cheat Sheet

```bash
# Installation
node install.js                      # Interactive setup
bash easy-install.sh                 # Automatic setup (Linux/Mac)
easy-install.bat                     # Automatic setup (Windows)
node check-requirements.js           # Check system

# Status & Progress
node installation-status.js          # See what's installed
ls backend/node_modules              # Check backend deps
ls frontend/node_modules             # Check frontend deps

# Development
cd backend && npm start              # Start backend (port 5000)
cd frontend && npm run dev           # Start frontend (port 3000)

# Database
mysql -u root -p                     # Connect to MySQL
CREATE DATABASE trust_tax_advisor;   # Create database
mysql < database/schema.sql          # Import schema

# Building
cd frontend && npm run build         # Build for production
```

---

## 🚨 System Requirements

- Node.js 14.0+ (check: `node --version`)
- npm 6.0+ (check: `npm --version`)
- MySQL 5.7+ (optional, check: `mysql --version`)
- 2GB RAM minimum
- 1GB disk space minimum

**The installer checks all this!**

---

## 📚 Documentation Quick Links

| Document | Purpose |
|----------|---------|
| README.md | Full documentation |
| EASY_INSTALLATION_GUIDE.md | Detailed installation steps |
| CPANEL_DEPLOYMENT.md | Deploy to production server |
| SMTP_SETUP.md | Setup email OTP |
| WHATSAPP_SETUP.md | Setup WhatsApp OTP |
| PRODUCTION_CHECKLIST.md | Before going live |

---

## 🎓 For Different Users

### New to Development
```bash
node install.js          # Step-by-step guidance
# Follow all prompts
```

### Experienced Developer
```bash
bash easy-install.sh     # One command, fully automated
```

### Trying for First Time
```bash
node check-requirements.js    # Make sure system is ready
node install.js              # Then guided setup
```

### DevOps/Docker User
```dockerfile
RUN bash easy-install.sh     # Non-interactive in container
```

---

## ✅ After Installation Checklist

- [ ] Backend dependencies installed (`backend/node_modules`)
- [ ] Frontend dependencies installed (`frontend/node_modules`)
- [ ] `backend/.env` created and edited
- [ ] `frontend/.env` created
- [ ] Database created (MySQL)
- [ ] Database schema imported
- [ ] Backend starts without errors
- [ ] Frontend starts without errors
- [ ] Can login at http://localhost:3000

---

## 🎉 First Login

**Email:** `admin@trusttaxadvisor.com`  
**Password:** OTP sent to your email/WhatsApp  

Then explore:
- 👥 Client Panel
- 💼 Connector/Agent Panel
- 📊 Admin Dashboard
- 👨‍💼 Staff Panel

---

## 🆘 Need Help?

1. **Check installation:** `node installation-status.js`
2. **Look at logs:** Check terminal output for errors
3. **Read guides:** See documentation links above
4. **Requirements check:** `node check-requirements.js`
5. **Try again:** `bash easy-install.sh`

---

## 📞 Important Ports

| Port | Service | Status |
|------|---------|--------|
| 3000 | Frontend | Must be free |
| 5000 | Backend API | Must be free |
| 3306 | MySQL | Must be running |

---

## 🚀 Start Now!

**Choose one command and go:**

```bash
# Super Easy (Automatic)
bash easy-install.sh

# Or Interactive (Guided)
node install.js

# Or Check First (Safest)
node check-requirements.js && node install.js
```

**Then:**
```bash
cd backend && npm start     # Terminal 1
cd frontend && npm run dev  # Terminal 2

# Visit: http://localhost:3000
```

---

**That's it! You're ready to build with Trust Tax Advisor!** 🎊

---

## Version Info
- **Feature:** Easy Installation v1.0.0
- **Platform:** Cross-platform (Windows, Mac, Linux)
- **Status:** ✅ Production Ready
- **Generated:** March 2026
