Pre-Deployment Checklist
Before deploying to production, ensure:- All prerequisites are met
- Database is configured with a production-grade provider
- Environment variables are set correctly
- SSL certificate is configured
- Domain is configured and pointed to hosting provider
- Shopify app is created in Partner Dashboard
- OAuth redirect URLs are configured
- Webhook endpoints are accessible
Build Process
Production Build
The application uses Remix with Vite for building:- Sets
NODE_ENV=production - Runs
remix vite:build - Generates optimized production assets
- Creates server bundle in
build/server/ - Creates client assets in
build/client/
The build output includes source maps for debugging production issues.
Setup Database
Run database setup before starting the server:prisma generate- Generates TypeScript types and Prisma Clientprisma migrate deploy- Applies pending migrations
Start Production Server
Start the production server:- Listen on
PORTenvironment variable (default: 3000) - Serve the built application
- Handle Shopify OAuth and webhook requests
Hosting Recommendations
Vercel (Recommended)
Vercel provides excellent support for Remix applications.Railway
Railway offers simple deployment with integrated PostgreSQL.Create Railway Project
- Go to railway.app
- Sign in with GitHub
- Click New Project
- Select Deploy from GitHub repo
Add PostgreSQL
- Click New → Database → PostgreSQL
- Railway automatically creates database
- Copy
DATABASE_URLfrom database settings
Render
Render provides managed hosting with PostgreSQL.Create Web Service
- Go to render.com
- Click New → Web Service
- Connect your GitHub repository
- Configure:
- Name: Your app name
- Environment: Node
- Build Command:
pnpm install && pnpm run setup && pnpm run build - Start Command:
pnpm start
Add PostgreSQL
- Click New → PostgreSQL
- Create database
- Copy Internal Database URL
- Add as
DATABASE_URLenvironment variable
Heroku
Heroku offers straightforward deployment with add-ons.AWS, GCP, Azure
For enterprise deployments:- AWS: Deploy on ECS, Elastic Beanstalk, or EC2
- Google Cloud: Use Cloud Run, App Engine, or Compute Engine
- Azure: Deploy to App Service or Container Instances
Cloud platform deployment requires more configuration but offers greater control and scalability.
Shopify App Configuration
Update App URLs
After deployment, update your Shopify app configuration:Application URL
- Go to Partner Dashboard → Apps → Your App
- Update App URL:
https://your-app.example.com
Configure Webhooks
Verify webhook endpoints are accessible:shopify.app.toml:
/webhooks/app/uninstalled/webhooks/subscription_contracts/create/webhooks/subscription_contracts/activate/webhooks/subscription_contracts/cancel/webhooks/subscription_contracts/pause/webhooks/subscription_billing_cycles/skip/webhooks/subscription_billing_attempts/success/webhooks/subscription_billing_attempts/failure/webhooks/selling_plan_groups/create_or_update/webhooks/customer_redact/webhooks/shop_redact
Security Hardening
Enable HTTPS Only
Ensure all traffic uses HTTPS:
- Configure SSL certificate on hosting provider
- Enable automatic HTTPS redirects
- Set
Strict-Transport-Securityheader
Secure Environment Variables
- Never commit secrets to version control
- Use hosting provider’s secret management
- Rotate secrets regularly (every 90 days)
- Audit access to production secrets
Database Security
- Enable SSL connections:
?sslmode=require - Use strong passwords (20+ characters)
- Restrict database access to application IPs only
- Enable automated backups
- Implement connection pooling
Monitoring and Logging
Application Monitoring
Application Logging
The app uses Pino for structured logging:Configure log aggregation:
- Datadog: Structured JSON logs
- LogDNA: Cloud log management
- CloudWatch: AWS logging
- Cloud Logging: GCP logging
Uptime Monitoring
Set up uptime monitoring:
- UptimeRobot - Free tier available
- Pingdom
- StatusCake
- Better Uptime
GET /services/ping- Health check endpointGET /webhooks/cli- Webhook endpoint
Health Check Endpoint
The app includes a health check endpoint:- Load balancer health checks
- Uptime monitoring
- Deployment verification
Continuous Deployment
GitHub Actions Example
Create.github/workflows/deploy.yml:
Production Checklist
Before going live:Infrastructure
- Production database configured with backups
- Environment variables set in hosting provider
- SSL certificate configured and valid
- Domain DNS configured correctly
- CDN configured (if applicable)
Application
-
NODE_ENV=productionset - Database migrations run successfully
- Build completes without errors
- All tests passing
- Type checking passes
Shopify Configuration
- App URLs updated in Partner Dashboard
- OAuth redirect URLs configured
- Webhooks verified and working
- App tested with live Shopify store
- Subscription flows tested end-to-end
Security
- HTTPS enabled and enforced
- Security headers configured
- Secrets stored securely
- Database uses SSL connections
- Rate limiting implemented
- Input validation in place
Monitoring
- Error tracking configured (Sentry, etc.)
- Logging configured and working
- Uptime monitoring active
- Performance monitoring enabled
- Alerts configured for critical issues
Documentation
- Deployment runbook created
- Incident response plan documented
- Team has access to production systems
- Rollback procedure documented
Rollback Procedure
If deployment issues occur:Identify the Issue
Check monitoring tools:
- Error tracking dashboard
- Application logs
- Uptime monitors
Quick Rollback
Revert to previous deployment:Vercel:Railway:
- Go to Deployments → Select previous deployment → Redeploy
Scaling Considerations
Horizontal Scaling
- Deploy multiple instances behind a load balancer
- Use managed database with connection pooling
- Implement Redis for session storage (alternative to Prisma)
- Use CDN for static assets
Background Jobs
For production-scale job processing:- Use Google Cloud Tasks (included in app)
- Alternative: BullMQ with Redis
- Alternative: AWS SQS
- Alternative: Inngest
Database Optimization
- Enable connection pooling (PgBouncer, ProxySQL)
- Add database indexes for frequently queried fields
- Implement read replicas for scaling reads
- Use database query optimization tools
Support and Maintenance
Regular Maintenance Tasks
- Update dependencies monthly:
pnpm update - Review and rotate secrets quarterly
- Check and update SSL certificates before expiry
- Review application logs weekly
- Test backup restoration monthly
- Review and optimize database queries
Staying Updated
- Monitor Shopify API changelog for breaking changes
- Subscribe to hosting provider status pages
- Watch for security advisories in dependencies
- Keep Node.js version updated to LTS releases
Next Steps
Your app is now deployed! Consider:- Setting up staging environment for testing
- Implementing feature flags for gradual rollouts
- Creating automated tests for critical paths
- Building monitoring dashboards
- Documenting operational procedures
For App Store submission, ensure your app provides value beyond the reference implementation and meets Shopify’s uniqueness requirements.