A simple web app that quickly summarizes Wikipedia articles using AI. The frontend is static (in public/), styles are built with Tailwind CSS, and the backend endpoint runs on Vercel in api/summarize.js.
- Searches Wikipedia and selects the best matching article
- Fetches a clean plaintext extract of the article
- Generates a short AI summary (configurable number of sentences)
- Node.js 18+
- Vercel account (for deployment)
- Groq API key in environment variable
GROQ_API_KEY
npm install- One-off build:
npm run build:css- Watch during development:
npm run build:css:watch- Minified build:
npm run build:css:minifyInput: src/input.css
Output: public/output.css
The frontend is static. Open public/index.html in your browser after generating public/output.css. To serve locally you can use, for example:
npx serve publicThe API endpoint is designed for Vercel (/api/summarize). To run locally with Vercel CLI:
npx vercel devRemember to set the environment variable:
export GROQ_API_KEY="<your_key>"GET /api/summarize?topic=<query>&length=<sentence_count>topic(required): article/topic name on Wikipedialength(optional): number of sentences in the summary (default 3)
Example (with Vercel or vercel dev running):
curl "http://localhost:3000/api/summarize?topic=Ada%20Lovelace&length=3"Licensed under the MIT License