Platform Requirements
MicroCBM requires:- Node.js: Version 20 or higher
- Package Manager: npm, yarn, or pnpm
- Build Command:
npm run build - Start Command:
npm start - Port: 3000 (default)
MicroCBM is a frontend-only application. It requires a running backend API at the URL specified in
NEXT_PUBLIC_API_URL.Recommended Platforms
Vercel (Recommended)
Vercel provides the best Next.js deployment experience with zero configuration.Configure Environment Variables
Add required environment variables:
NEXT_PUBLIC_API_URLSESSION_SECRET
Netlify
Netlify supports Next.js applications with its Next.js Runtime. Build Settings:- Build Command:
npm run build - Publish Directory:
.next - Functions Directory:
.netlify/functions
AWS Amplify
AWS Amplify provides hosting for Next.js applications with automatic deployments. Build Specification:Docker
For containerized deployments, create a production-optimized Dockerfile. Dockerfile:Build Configuration
The build process is configured inpackage.json:
package.json
Environment Setup
Before deploying, ensure all required environment variables are configured. See the Environment Variables page for details.Post-Deployment Checklist
After deploying to production:Verify Environment Variables
Test that all environment variables are correctly set and the backend API is reachable.
Check Security Headers
Use securityheaders.com to verify security headers are applied.
Test Authentication Flow
Complete a full login and OTP verification flow to ensure authentication works.
API Cold Start Considerations
If your backend API is hosted on a free tier service (e.g., Render), it may need 30-60 seconds to start on the first request after being idle.
- Add loading states to data-dependent pages
- Implement retry logic for API requests
- Display helpful messages during cold start periods
- Consider upgrading to a paid hosting tier for zero-downtime
Static Asset Optimization
Next.js automatically optimizes static assets during build:- Images: Optimized using Next.js Image Optimization
- JavaScript: Minified and code-split
- CSS: Minified and extracted
- Fonts: Optimized with next/font
Monitoring and Analytics
Recommended tools for production monitoring:- Vercel Analytics: Built-in for Vercel deployments
- Sentry: Error tracking and performance monitoring
- LogRocket: Session replay and debugging
- Google Analytics: User behavior tracking
Continuous Deployment
Set up automatic deployments from your version control system:- Production Branch: Deploy
mainormasterbranch to production - Preview Deployments: Automatically deploy pull requests for testing
- Environment Variables: Use separate values for preview and production
Rollback Strategy
Most platforms support instant rollbacks:- Vercel: One-click rollback to any previous deployment
- Netlify: Deploy rollback from Deploys dashboard
- AWS Amplify: Redeploy previous commit from console
Next Steps
Environment Variables
Configure all required environment variables
Security
Review security headers and best practices