Skip to content

alok410kr/AI-Text-Summarizer

Repository files navigation

AI Text Summarizer App

A simple Node.js + Express app with a clean UI for summarizing long text via OpenAI. It serves a static frontend from public and exposes POST /api/summarize.

Local Development

  1. Install dependencies:
npm install
  1. Set your OpenAI API key (optional for preview mode):
# Windows PowerShell
$env:OPENAI_API_KEY="sk-..."
# macOS/Linux
export OPENAI_API_KEY="sk-..."
  1. Run the server:
npm run dev

Open http://localhost:3000.

Without an API key, the app returns a truncated preview summary.

Deployment

Environment variables:

  • OPENAI_API_KEY – required for real summaries
  • PORT – optional; defaults to 3000

Render

  • New Web Service → Connect repo
  • Build Command: npm install
  • Start Command: npm start
  • Add env var OPENAI_API_KEY

Railway / Fly.io / Heroku

  • Set OPENAI_API_KEY in project variables
  • Start command: npm start

Vercel

  • Use a Node serverless function or deploy as a Node server:
    • Framework preset: “Other”
    • Build Command: npm install
    • Output: N/A (server app)
    • Add OPENAI_API_KEY

API

POST /api/summarize

  • body: { "text": string } (min 200 chars)
  • response: { "summary": string }

Project Structure

  • index.js – Express server and /api/summarize
  • public/ – static frontend (index.html, stylesheet.css, script.js)

Notes

  • Client adds loading state, validation, copy/clear, and character counter.
  • The server limits JSON size to 1MB. Increase if needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published