Eduardo2049/text_summarizer
Project Overview
Text Summarizer & Translator
Web app that summarizes and translates text using OpenRouter's AI API through a React frontend and Express backend.
True Intent (AI Assessment)
A student/portfolio-style web app for AI-driven text summarization and translation, backed by OpenRouter as the LLM gateway.
README Accuracy
Notes
The code matches the README's stated functionality. However, the backend globally disables TLS certificate validation (NODE_TLS_REJECT_UNAUTHORIZED=0) and enables unrestricted CORS. These should be fixed before any production deployment. No malicious behavior detected.
This is a full-stack TypeScript web application that provides two AI-powered text operations: summarization (condensing text into up to 5 sentences) and translation (converting text between 10 supported languages). The frontend is built with React 19 and Vite, while the backend is a lightweight Express server that acts as a proxy to the OpenRouter API, which routes requests to various LLM providers.
The problem it addresses is straightforward: users often need quick summaries of long text or translations between languages, and hitting an LLM API directly from the browser would expose API keys. This app solves both by offering a clean UI with mode toggle, language selector, and result display, while keeping the OpenRouter API key server-side.
The target users appear to be end-users wanting a simple summarization/translation tool, though the README notes 'Internal / Educational use.' The interaction flow is: pick a mode (Summarize or Translate), choose a target language, paste text, and either click a button (summarize) or wait for auto-debounced processing (translate, 800ms debounce with AbortController to cancel stale requests).
Architecturally, the backend exposes /health, /api/process (unified endpoint), and a legacy /api/summarize endpoint. It builds a Portuguese-language prompt instructing the model to either summarize or translate, then calls OpenRouter's chat completions endpoint using the 'openrouter/auto' model. The frontend uses CSS Modules for styling and manages loading, translating, and error states in a single App component. Vite proxies /api requests to the backend during development.
Notable concern: the backend sets NODE_TLS_REJECT_UNAUTHORIZED=0, which disables TLS certificate verification globally for outbound HTTPS calls. The README acknowledges this as a workaround for corporate proxies, but it is a security risk in production because it exposes the app to man-in-the-middle attacks. Also, CORS is opened wide with app.use(cors()) with no origin restriction.
| Languages | TypeScript, CSS, HTML |
| Runtime | Node.js 18+ |
| Framework | React 19 (frontend), Express 4 (backend) |
| Database | None detected |
| Package Manager | npm |
| Key Dependencies | express, cors, dotenv, react, react-dom, vite, @vitejs/plugin-react, ts-node-dev |
| Build Tool | Vite (frontend), tsc (backend) |
| Test Framework | None detected |