Chatbot de AI con una interfaz de usuario generativa.
const systemRequirements = { // Software necesario software: { node: '18.0.0+', bun: '1.0.0+', redis: '6.0+', editor: 'VS Code' }, // Hardware mínimo hardware: { cpu: '4 cores', ram: { minimum: '4GB', recommended: '8GB' }, storage: '2GB', internet: '10Mbps+' }, // Cuentas requeridas accounts: { required: ['Vercel', 'OpenAI'], optional: ['Upstash', 'Serper'] } }
export const installationSteps = { windows: { node: { command: 'winget install OpenJS.NodeJS.LTS', verify: 'node --version && npm --version' }, bun: { command: 'curl -fsSL https://bun.sh/install.ps1 | iex', verify: 'bun --version' } }, macos: { base: 'brew install node bun', verify: [ 'node --version', 'bun --version' ] }, linux: { prepare: 'sudo apt update && sudo apt upgrade', node: { setup: 'curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -', install: 'sudo apt install -y nodejs' }, bun: { install: 'curl -fsSL https://bun.sh/install | bash', config: 'source ~/.bashrc' } } }
export const projectSetup = { // Inicialización init: { directory: 'cd searchtemplate', install: 'bun install', verify: 'bun run verify' }, // Variables de entorno envConfig: { required: { OPENAI_API_KEY: 'sk-xxx' }, redis: { local: { USE_LOCAL_REDIS: true, LOCAL_REDIS_URL: 'redis://localhost:6379' }, upstash: { UPSTASH_REDIS_REST_URL: 'xxx', UPSTASH_REDIS_REST_TOKEN: 'xxx' } }, search: { SEARXNG_API_URL: 'http://localhost:8080', SEARCH_API: 'searxng', options: { MAX_RESULTS: 50, DEFAULT_DEPTH: 'basic' } }, optional: { ANTHROPIC_API_KEY: 'xxx', GOOGLE_AI_KEY: 'xxx', GROQ_API_KEY: 'xxx', AZURE_API_KEY: 'xxx', SERPER_API_KEY: 'xxx' } } }
const redisLocal = { // Instalación por sistema install: { ubuntu: 'sudo apt install redis-server', macos: 'brew install redis', windows: 'Redis Stack Download' }, // Configuración base config: { path: '/etc/redis/redis.conf', settings: { maxmemory: '512mb', policy: 'allkeys-lru', persistence: 'appendonly yes' } }, // Gestión del servicio service: { start: 'sudo systemctl start redis-server', verify: [ 'sudo systemctl status redis-server', 'redis-cli ping' ] } }
const upstashSetup = { steps: [ 'Registro en upstash.com', 'Crear nueva base de datos', 'Configurar región cercana', 'Seleccionar plan gratuito', 'Copiar credenciales REST' ], envVars: { UPSTASH_REDIS_REST_URL: 'xxx', UPSTASH_REDIS_REST_TOKEN: 'xxx' } }
const devEnvironment = { // Comandos principales commands: { dev: 'bun dev', url: 'http://localhost:3000', tests: [ 'Búsqueda base', 'Respuesta IA', 'Redis storage', 'Modelos IA' ] } }
const vercelDeploy = { // Preparación prepare: { build: 'bun run build', cli: 'npm i -g vercel', auth: 'vercel login' }, // Configuración setup: { command: 'vercel', options: { deploy: true, directory: './', override: false } }, // Variables de entorno env: { path: 'Dashboard → Settings → Environment Variables', required: [ 'Copiar .env.local', 'Añadir NEXT_PUBLIC_BASE_URL' ] }, // Despliegue final deploy: { command: 'vercel --prod', verify: [ 'Búsquedas', 'Conexión Redis', 'Modelos IA', 'Sharing' ] } }
export const devCommands = { standard: 'bun dev', turbo: 'bun dev:turbo', typeCheck: 'bun type-check', lint: 'bun lint' }
export const prodCommands = { build: 'bun build', start: 'bun start', analyze: 'bun analyze' }
export const testCommands = { run: 'bun test', watch: 'bun test:watch' }
const redisTroubleshooting = { connection: { restart: 'sudo systemctl restart redis-server', verify: 'redis-cli config get databases' }, memory: { check: 'redis-cli info memory', fix: 'sudo sysctl vm.overcommit_memory=1' } }
const apiTroubleshooting = { rateLimit: [ 'Implementar exponential backoff', 'Aumentar intervalo entre requests', 'Verificar límites de plan' ], timeout: [ 'Aumentar timeout en fetch', 'Implementar retry logic', 'Usar streaming cuando posible' ] }
const buildTroubleshooting = { moduleError: { steps: [ 'bun install', 'rm -rf .next', 'bun clean' ] }, typeError: { steps: [ 'bun type-check', 'bun install --force' ] } }
const verificationLists = { local: [ 'Servidor sin errores', 'Redis conectado', 'Búsquedas funcionando', 'IA respondiendo', 'UI responsiva' ], production: [ 'Build exitoso', 'Variables configuradas', 'Redis conectado', 'APIs respondiendo', 'Performance óptima' ] }
const monitoring = { checks: [ 'Logs en Vercel', 'Uso de Redis', 'Límites API', 'Métricas performance' ], optimization: { performance: [ 'Caché agresivo', 'Streaming responses', 'Optimizar assets', 'Minimizar JS' ], costs: [ 'Monitorear APIs', 'Rate limiting', 'Optimizar Redis', 'Usar tier gratuito' ] } }