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.
- Host: GitHub
- URL: https://github.com/azurespheredev/full-throttle-media-test
- Owner: azurespheredev
- Created: 2025-10-03T13:07:10.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-03T15:42:19.000Z (9 months ago)
- Last Synced: 2026-05-19T15:56:20.801Z (about 2 months ago)
- Topics: app-router, nextjs, postgresql, prisma, shadcn-ui, tailwindcss, typescript
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`.