Complete guide to set up and deploy your Support Intelligence SaaS.
- Node.js 18+ installed
- PostgreSQL database
- Stripe account
- Anthropic API key
- (Optional) Zendesk account for testing
- Install PostgreSQL (if not already installed):
# macOS
brew install postgresql
brew services start postgresql
# Ubuntu
sudo apt-get install postgresql- Create the database:
createdb support_intelligence- Update
.envfile:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/support_intelligence- Run migrations:
npm install
npm run build
npm run migrate- Go to stripe.com and create an account
- Switch to Test Mode (toggle in top right)
- Go to Products → Add Product
- Name: "Support Intelligence Pro"
- Description: "AI-powered support ticket analysis"
- Price: $249/month (recurring)
- Click Save product
- Copy the Price ID (starts with
price_)
- Go to Developers → API keys
- Copy Secret key (starts with
sk_test_) - Copy Publishable key (starts with
pk_test_)
- Go to Developers → Webhooks
- Click Add endpoint
- Endpoint URL:
https://your-api-domain.com/api/stripe/webhook - Select events:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Click Add endpoint
- Copy the Signing secret (starts with
whsec_)
# Stripe
STRIPE_SECRET_KEY=sk_test_your_actual_key_here
STRIPE_PRICE_ID=price_your_actual_price_id_here
STRIPE_WEBHOOK_SECRET=whsec_your_actual_secret_here # For production only# Backend dependencies
npm install
# Frontend dependencies
cd web
npm install
cd ..npm run buildOption A: Run in separate terminals
Terminal 1 - Backend API:
npm run apiTerminal 2 - Frontend:
cd web
npm run devOption B: Use a process manager
Install PM2:
npm install -g pm2Create ecosystem.config.js:
module.exports = {
apps: [
{
name: 'api',
script: 'dist/api/server.js',
env: {
NODE_ENV: 'production',
API_PORT: 3001
}
},
{
name: 'scheduler',
script: 'dist/scheduler/index.js',
env: {
NODE_ENV: 'production',
ENABLE_SCHEDULER: 'true'
}
}
]
};Start with PM2:
pm2 start ecosystem.config.js- Open frontend: http://localhost:3000
- Upload a test CSV with format:
customer_id,subject,message user123,Login issue,I can't log in to my account user456,Feature request,Would love dark mode user789,Billing problem,I was charged twice
- Check analysis: Go to dashboard and view analyzed tickets
- Test Stripe: Go to Settings → Click "Start 7-Day Free Trial"
- Use test card:
4242 4242 4242 4242 - Any future expiry date
- Any CVC
- Use test card:
-
Get Zendesk API Token:
- Log in to your Zendesk account
- Go to Admin Center (gear icon)
- Navigate to Apps and integrations → APIs → Zendesk API
- Click "Settings" tab
- Enable "Token Access"
- Click "Add API Token"
- Copy the token
-
Configure in Settings:
- Go to Settings page
- Enter your subdomain (e.g., "yourcompany" from yourcompany.zendesk.com)
- Enter your email
- Paste API token
- Click "Save Zendesk Settings"
- Click "Sync Tickets Now" to test
For MVP, email alerts are logged to console. To enable real emails:
- Sign up at sendgrid.com
- Create an API key
- Update
src/services/email-alerts.ts:
import sgMail from '@sendgrid/mail';
sgMail.setApiKey(process.env.SENDGRID_API_KEY!);
async function sendEmail(config: EmailConfig): Promise<void> {
await sgMail.send({
to: config.to,
from: 'alerts@yourdomain.com', // Must be verified in SendGrid
subject: config.subject,
html: config.html,
});
}- Add to
.env:
SENDGRID_API_KEY=your_sendgrid_api_key
ALERT_EMAIL=your-email@example.com- Sign up at resend.com
- Create an API key
- Install:
npm install resend - Update email service similarly
-
Create account at render.com
-
Create PostgreSQL database:
- Click "New" → "PostgreSQL"
- Name: support-intelligence-db
- Copy Internal Database URL
-
Create Web Service:
- Click "New" → "Web Service"
- Connect your GitHub repo
- Name: support-intelligence-api
- Build Command:
npm install && npm run build - Start Command:
node dist/api/server.js - Add environment variables:
DATABASE_URL=<your internal database URL> ANTHROPIC_API_KEY=<your key> STRIPE_SECRET_KEY=<your key> STRIPE_PRICE_ID=<your price ID> STRIPE_WEBHOOK_SECRET=<your webhook secret> API_PORT=3001 NODE_ENV=production
-
Create Background Worker (for scheduler):
- Click "New" → "Background Worker"
- Same repo
- Start Command:
node dist/scheduler/index.js - Add same environment variables plus:
ENABLE_SCHEDULER=true
-
Create account at vercel.com
-
Import project:
- Click "New Project"
- Import your GitHub repo
- Root Directory:
web - Framework Preset: Next.js
- Build Command:
npm run build - Output Directory:
.next
-
Add environment variables:
NEXT_PUBLIC_API_URL=https://your-render-api-url.onrender.com -
Update API URLs in frontend:
- Replace all instances of
http://localhost:3001withprocess.env.NEXT_PUBLIC_API_URL
- Replace all instances of
-
Deploy: Click "Deploy"
Once deployed, update your Stripe webhook endpoint to use your production URL:
- Go to Stripe Dashboard → Webhooks
- Update endpoint URL to:
https://your-api-url.onrender.com/api/stripe/webhook
# Test connection
psql postgresql://postgres:postgres@localhost:5432/support_intelligenceUse Stripe CLI for local testing:
stripe listen --forward-to localhost:3001/api/stripe/webhookIf migrations fail, check:
- Database exists
- Connection URL is correct
- User has permissions
Reset migrations (CAUTION: Deletes all data):
psql support_intelligence
DROP TABLE IF EXISTS schema_migrations CASCADE;
# Then run migrations again
npm run migrateBefore launching:
- Switch Stripe to live mode
- Update all Stripe keys in
.env - Set up real email service (SendGrid/Resend)
- Configure custom domain
- Enable HTTPS everywhere
- Set up monitoring (Sentry, LogRocket)
- Test full user flow
- Backup database strategy
- Set up analytics (PostHog, Mixpanel)
For issues or questions:
- Check logs:
pm2 logs(if using PM2) - Check database:
psql support_intelligence - Review Stripe dashboard for payment issues
- Check Anthropic API usage limits
- Test with real Zendesk data
- Customize email templates
- Add more features based on user feedback
- Launch on Reddit (r/SaaS)