An open API service indexing awesome lists of open source software.

https://github.com/azurespheredev/full-throttle-media-test

A web app that allows users to paste in long text and get an AI generated summary.
https://github.com/azurespheredev/full-throttle-media-test

app-router nextjs postgresql prisma shadcn-ui tailwindcss typescript

Last synced: about 5 hours ago
JSON representation

A web app that allows users to paste in long text and get an AI generated summary.

Awesome Lists containing this project

README

          

# AI-Powered Text Summarizer

A full-stack web application that allows users to paste long text and generate AI-powered summaries with selectable styles. Built with **Next.js 15**, **PostgreSQL (via Prisma)**, **Tailwind CSS**, and the **OpenAI API**.

## πŸš€ Features

- **Text Summarization**
Paste long text and get a summary generated using OpenAI models.

- **Summary Styles**
Choose between **Concise**, **Detailed**, and **Bullets** output formats.

- **Persistence**
Summaries (original text + result + metadata) are stored in PostgreSQL.

- **Search & Filter**
Query summaries by text content, summary text, or style.

- **Pagination**
Infinite scroll / β€œLoad More” support with cursor-based pagination.

- **Rate Limiting**
Basic per-IP guard against abuse.

- **Markdown Rendering**
Summaries are rendered with proper formatting (bold, lists, code blocks, etc.).

## πŸ› οΈ Tech Stack

- **Frontend**: Next.js 15 (App Router), React 19, TailwindCSS 4, ShadCN UI
- **Backend**: Next.js API routes (`app/api/`)
- **Database**: PostgreSQL with Prisma ORM
- **AI Integration**: OpenAI API (Responses API)
- **Validation**: Zod
- **Other Utilities**: `react-markdown`, `remark-gfm`, `sonner` (toast), Lucide icons

## βš™οΈ Setup

### 1. Clone and Install

```bash
git clone https://github.com/azurespheredev/full-throttle-media-test.git
cd full-throttle-media-test
pnpm install
```

### 2. Configure Environment

Create `.env` from `.env.example`:

```bash
OPENAI_API_KEY="your-openai-key"
OPENAI_MODEL="gpt-4o-mini"
DATABASE_URL="postgresql://postgres:password@localhost:5432/full_throttle_media"
```

### 3. Database Migration

```bash
pnpm postinstall
pnpm prisma:reset
pnpm prisma:migrate
```

### 4. Run Dev Server

```bash
pnpm dev
```

Visit [http://localhost:3000](http://localhost:3000).

## πŸ“– API Endpoints

### `POST /api/summarize`

- Body:

```json
{
"text": "long input text here",
"style": "concise" | "detailed" | "bullets"
}
```

- Response: Saved summary object.

### `GET /api/summaries`

- Query params:

- `q`: search term
- `style`: CONCISE | DETAILED | BULLETS
- `cursor`: pagination cursor
- `limit`: max items (default 10, max 50)

## πŸ§‘β€πŸ’» Notes

- **Chunking**: Long inputs are split into ~8k-token chunks, summarized individually, then recombined.
- **Rate Limiting**: Naive per-IP fixed window. Replace with Redis/Upstash for production-grade scaling.
- **Markdown**: Summaries may include formatting (bold, lists, code) β†’ rendered with `react-markdown`.
- **DB Model**: Prisma `Summary` with fields: `id`, `text`, `summary`, `style`, `model`, `createdAt`.