Prepare application for production deployment with enhanced voice features
Adds production environment configuration, global type declarations, and enhances voice recognition error handling and result processing. 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/4b7360ad-65af-421c-ae9c-12d0b5534ad8.jpg
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
// Production configuration for MenAssist
|
||||
const config = {
|
||||
// Server Configuration
|
||||
server: {
|
||||
port: process.env.PORT || 5000,
|
||||
host: '0.0.0.0',
|
||||
compression: true,
|
||||
helmet: true,
|
||||
rateLimit: {
|
||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||
max: 100, // limit each IP to 100 requests per windowMs
|
||||
},
|
||||
},
|
||||
|
||||
// Database Configuration
|
||||
database: {
|
||||
ssl: true,
|
||||
connectionTimeout: 30000,
|
||||
idleTimeout: 30000,
|
||||
maxConnections: 20,
|
||||
},
|
||||
|
||||
// Security Configuration
|
||||
security: {
|
||||
session: {
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
sameSite: 'strict',
|
||||
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||
},
|
||||
cors: {
|
||||
origin: process.env.CORS_ORIGIN || 'https://your-domain.replit.app',
|
||||
credentials: true,
|
||||
},
|
||||
},
|
||||
|
||||
// AI Configuration
|
||||
ai: {
|
||||
enabled: process.env.AI_ENABLED === 'true',
|
||||
timeout: 30000,
|
||||
maxTokens: 1024,
|
||||
rateLimiting: {
|
||||
requests: 50,
|
||||
window: 60000, // 1 minute
|
||||
},
|
||||
},
|
||||
|
||||
// Voice Configuration
|
||||
voice: {
|
||||
enabled: process.env.VOICE_ENABLED === 'true',
|
||||
timeout: process.env.VOICE_TIMEOUT || 30000,
|
||||
maxDuration: 60000, // 1 minute max recording
|
||||
sampleRate: 16000,
|
||||
},
|
||||
|
||||
// Logging Configuration
|
||||
logging: {
|
||||
level: process.env.LOG_LEVEL || 'info',
|
||||
format: process.env.LOG_FORMAT || 'json',
|
||||
enableAccessLogs: true,
|
||||
enableErrorLogs: true,
|
||||
},
|
||||
|
||||
// Cache Configuration
|
||||
cache: {
|
||||
ttl: process.env.CACHE_TTL || 3600,
|
||||
maxSize: '100mb',
|
||||
compression: true,
|
||||
},
|
||||
|
||||
// File Upload Configuration
|
||||
upload: {
|
||||
maxSize: process.env.MAX_UPLOAD_SIZE || '10mb',
|
||||
allowedTypes: ['image/jpeg', 'image/png', 'image/webp'],
|
||||
destination: './uploads',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
Reference in New Issue
Block a user