Files
menassit/PRODUCTION_DEPLOYMENT.md
ghaddaditw 7d7cae69ef Prepare application for production use, including health check
Adds production deployment configurations, a health check endpoint, and fixes voice command confidence level.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ff0be73b-afdd-4747-978b-bb8301fb0a82
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/9777c70b-fc38-4831-8d6b-78dfffe041b0/43bdd979-982d-4330-b7ca-c1484048813c.jpg
2025-06-08 06:34:35 +00:00

3.2 KiB

MenAssist Production Deployment Guide

Pre-deployment Checklist

1. Environment Setup

  • Set NODE_ENV=production
  • Configure DATABASE_URL with production PostgreSQL connection
  • Set SESSION_SECRET to a secure random string
  • Configure CORS_ORIGIN to your production domain

2. Required API Keys

The following API keys must be configured in your deployment environment:

  • ANTHROPIC_API_KEY - For AI chat and joke generation
  • OPENAI_API_KEY - Alternative AI provider (optional)

3. Database Migration

npm run db:push

4. Admin Account

  • Email: admin@menassist.com
  • Username: admin
  • Password: password (change immediately after first login)

Deployment Steps

  1. Ensure all environment variables are set in Replit Secrets
  2. Click the "Deploy" button in Replit
  3. Configure custom domain if needed

Option 2: Docker Deployment

# Build the image
docker build -t menassist .

# Run with environment variables
docker run -p 5000:5000 \
  -e DATABASE_URL="your_database_url" \
  -e SESSION_SECRET="your_session_secret" \
  -e ANTHROPIC_API_KEY="your_api_key" \
  menassist

Option 3: Manual Deployment

# Install dependencies
npm ci --only=production

# Build the application
npm run build

# Start production server
npm run start

Production Configuration

Security Features

  • HTTPS enforcement
  • Session security with httpOnly and secure flags
  • CORS protection
  • Rate limiting
  • Helmet security headers

Performance Features

  • Gzip compression
  • Asset optimization
  • Database connection pooling
  • Request timeout handling

Monitoring

  • Health check endpoint: /health
  • Application logs in JSON format
  • Error tracking and reporting

Environment Variables

Required

  • DATABASE_URL - PostgreSQL connection string
  • SESSION_SECRET - Secure random string for session encryption

Optional

  • PORT (default: 5000)
  • CORS_ORIGIN (default: current domain)
  • LOG_LEVEL (default: info)
  • CACHE_TTL (default: 3600)

Post-deployment Verification

  1. Check health endpoint: https://your-domain.com/health
  2. Login with admin credentials
  3. Test voice features (requires HTTPS)
  4. Verify AI functionality
  5. Test task and financial features

Troubleshooting

Voice Features Not Working

  • Ensure deployment is served over HTTPS
  • Check browser permissions for microphone access
  • Verify Web Speech API support in target browsers

AI Features Not Working

  • Verify API keys are correctly set
  • Check API rate limits
  • Review application logs for errors

Database Connection Issues

  • Verify DATABASE_URL format
  • Check SSL configuration
  • Ensure database accepts connections from deployment IP

Security Recommendations

  1. Change admin password immediately
  2. Enable 2FA if available
  3. Regularly update dependencies
  4. Monitor access logs
  5. Use secure session configuration
  6. Implement proper backup strategy

Scaling Considerations

  • Database: Use connection pooling and read replicas
  • Voice Processing: Consider external speech services for high traffic
  • AI Services: Implement caching for frequent requests
  • Static Assets: Use CDN for better performance