Pre-Deployment Checklist
Before deploying to production, ensure you complete all items in this checklist.Environment Configuration
- Set
NODE_ENV=productionin environment variables - Generate secure JWT secrets (minimum 32 characters)
- Configure MongoDB connection string (Atlas or self-hosted)
- Set up TRON mainnet endpoint (
https://api.trongrid.io) - Configure merchant wallet address
- Set correct frontend/client URLs for CORS
- Review all environment variables (see Environment Variables)
Security Hardening
- Enable HTTPS/TLS for all connections
- Set
secure: truefor cookie options in production - Configure rate limiting for API endpoints
- Enable Helmet.js security headers
- Implement HPP (HTTP Parameter Pollution) protection
- Review and restrict CORS origins
- Ensure sensitive data is not logged
- Set up firewall rules to restrict database access
Database
- Set up MongoDB Atlas with authentication
- Configure database backups and retention policy
- Create indexes for frequently queried fields
- Set up connection pooling
- Enable MongoDB encryption at rest
- Configure replica sets for high availability
Wallet Security
- Store admin wallet private key in secure vault (e.g., AWS Secrets Manager, HashiCorp Vault)
- Implement wallet backup and recovery procedures
- Use hardware wallets for high-value merchant accounts
- Test refund functionality on testnet before production
- Monitor wallet balance and set up low-balance alerts
TRON Network
- Switch from Nile testnet to TRON mainnet
- Test transaction listener with mainnet configuration
- Verify transaction confirmation thresholds
- Set up monitoring for failed transactions
- Configure appropriate network fees
Monitoring & Logging
- Set up application logging (Winston, Pino, etc.)
- Configure error tracking (Sentry, Rollbar, etc.)
- Implement uptime monitoring (Pingdom, UptimeRobot)
- Set up alerts for critical errors
- Monitor API response times and performance
- Track transaction confirmation delays
- Monitor database performance and query times
Performance Optimization
- Enable gzip compression for API responses
- Implement caching for frequently accessed data
- Optimize database queries and add indexes
- Set up CDN for static assets (if applicable)
- Configure appropriate connection timeouts
- Load test API endpoints to determine capacity
Deployment Infrastructure
- Use a process manager (PM2, systemd) for Node.js
- Configure auto-restart on crashes
- Set up load balancing for multiple instances
- Enable graceful shutdown handling
- Configure appropriate memory limits
- Set up CI/CD pipeline for automated deployments
Testing
- Run all unit tests and ensure they pass
- Perform integration testing with frontend
- Test Socket.io real-time notifications
- Verify transaction listener functionality
- Test admin panel operations
- Perform security penetration testing
- Load test critical endpoints (orders, payments)
Documentation
- Document API endpoints and authentication
- Create runbooks for common operations
- Document emergency procedures (refunds, rollbacks)
- Maintain architecture diagrams
- Document disaster recovery procedures
Deployment Steps
1. Server Setup
2. Application Deployment
3. Start Application with PM2
4. Configure Nginx (Optional)
5. SSL Certificate Setup
Post-Deployment
Verification
- Verify API health endpoint is responding
- Test user registration and login
- Create a test order and payment
- Verify transaction listener is running
- Check Socket.io connections
- Test admin panel functionality
- Verify Swagger documentation is accessible
Monitoring Setup
Backup Configuration
Set up automated MongoDB backups:Common Issues
Application Won’t Start
- Check environment variables are correctly set
- Verify MongoDB connection string
- Check Node.js version (requires v16+)
- Review application logs for errors
Transaction Listener Not Working
- Verify TRON_NETWORK is set to mainnet URL
- Check network connectivity to TronGrid
- Ensure merchant wallet address is correct
- Review transaction listener logs
Socket.io Connection Failures
- Verify CORS configuration includes frontend URL
- Check WebSocket support on reverse proxy
- Ensure firewall allows WebSocket connections
Rollback Procedure
Support
For technical support or deployment assistance, contact: Pedro Luis Ramos CallaProject Developer