# 📋 Quick Reference Guide - Environment Variables

This is a quick checklist of all environment variables needed for deployment.

## ✅ Required Environment Variables

### Database (Neon)
```env
DATABASE_URL="postgresql://user:password@host-pooler/db?pgbouncer=true&schema=public"
DIRECT_DATABASE_URL="postgresql://user:password@host/db?schema=public"
```

### Application
```env
NEXT_PUBLIC_APP_URL="https://your-project.vercel.app"
NODE_ENV="production"
BETTER_AUTH_SECRET="your-random-secret-key-here"
```

### AWS S3 (Image Storage)
```env
AWS_BUCKET_NAME="your-bucket-name"
AWS_BUCKET_REGION="eu-north-1"
AWS_PUBLIC_ACCESS_KEY="your-access-key-id"
AWS_SECRET_ACCESS_KEY="your-secret-access-key"
```

### Email (Resend)
```env
RESEND_API_KEY="re_xxxxxxxxxxxxx"
RESEND_FROM_EMAIL="onboarding@resend.dev"
```

### Maps (Mapbox)
```env
NEXT_PUBLIC_MAPBOX_TOKEN="pk.xxxxxxxxxxxxx"
```

---

## 📝 Pre-Deployment Checklist

- [ ] Created Neon database project
- [ ] Got both DATABASE_URL (pooled) and DIRECT_DATABASE_URL
- [ ] Created AWS S3 bucket
- [ ] Configured S3 bucket CORS
- [ ] Created AWS IAM user with S3 access
- [ ] Got AWS access keys
- [ ] Created Resend account and API key
- [ ] Created Mapbox account and got token
- [ ] Generated BETTER_AUTH_SECRET
- [ ] Created GitHub repository
- [ ] Uploaded all project files to GitHub
- [ ] Created Vercel account and linked to GitHub
- [ ] Added all environment variables in Vercel
- [ ] Deployed project
- [ ] Updated NEXT_PUBLIC_APP_URL with deployment URL
- [ ] Re-deployed with updated URL
- [ ] Ran database migrations
- [ ] Seeded database with initial data
- [ ] Tested website functionality

---

## 🚀 Quick Deploy Commands

### After setting up Vercel CLI:

```bash
# Login to Vercel
vercel login

# Link your project
vercel link

# Pull environment variables
vercel env pull .env.local

# Run migrations
npx prisma migrate deploy

# Seed database
npm run seed

# Deploy
vercel --prod
```

---

## 🔗 Important Links

- **Vercel Dashboard:** https://vercel.com/dashboard
- **Neon Console:** https://console.neon.tech
- **AWS Console:** https://console.aws.amazon.com
- **Resend Dashboard:** https://resend.com/overview
- **Mapbox Account:** https://account.mapbox.com

---

## 🆘 Emergency Contacts

If something goes wrong:

1. Check Vercel deployment logs
2. Check browser console (F12 → Console tab)
3. Check Neon database status
4. Verify all environment variables are set correctly
5. Refer to DEPLOYMENT_GUIDE.md for detailed troubleshooting

---

## 🔐 Security Reminders

- ⚠️ Never commit `.env` files to Git
- ⚠️ Never share your API keys or secrets
- ⚠️ Regularly rotate your AWS access keys
- ⚠️ Monitor your AWS billing dashboard
- ⚠️ Keep your dependencies updated

---

## 📊 Free Tier Limits to Monitor

| Service | Free Tier Limit |
|---------|----------------|
| **Vercel** | 100 GB bandwidth/month |
| **Neon** | 3 GB storage, 1 project |
| **Resend** | 100 emails/day, 3,000/month |
| **Mapbox** | 50,000 map loads/month |
| **AWS S3** | 5 GB storage, 20,000 GET requests |

---

**Keep this guide handy for quick reference! 📌**
