---
title: "Course Complete"
description: "Wrap up the course with a review of what you've built. See your complete AI-powered review summarization app and explore ideas for extending it further."
canonical_url: "https://vercel.com/academy/ai-summary-app-with-nextjs/complete"
md_url: "https://vercel.com/academy/ai-summary-app-with-nextjs/complete.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-04-11T13:40:39.834Z"
content_type: "lesson"
course: "ai-summary-app-with-nextjs"
course_title: "Creating an AI Summary App with Next.js"
prerequisites:  []
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Course Complete

# Conclusion

You started with a blank Next.js project. Now you have a production-ready AI-powered review summarization app deployed to Vercel. Let's recap.

## What you built

**Section 1: Foundations**

- Modern Next.js 16 app with TypeScript and Tailwind
- Type-safe data layer with Zod schemas
- Review display components with star ratings
- Dynamic routes with static generation
- Deployed to Vercel with automatic CI/CD

**Section 2: AI SDK integration**

- AI Gateway setup with secure API keys
- First AI summary using `generateText`
- Prompt engineering for consistent output
- Streaming summaries with `streamText`
- Structured data extraction with `generateObject`

**Section 3: Production readiness**

- Smart caching for 97% cost reduction
- Error handling with graceful fallbacks
- AI Gateway model fallbacks
- Cost awareness and optimization
- Observability with structured logging and alerts

## The complete architecture

```
User visits /mower
       ↓
Next.js checks cache
       ↓
[Cache HIT] → Return instantly (50ms)
       ↓
[Cache MISS] → Call AI Gateway
       ↓
AI Gateway → Claude API
       ↓
Generate summary (~2s)
       ↓
Cache result (1 hour)
       ↓
Return to user
```

**Performance:**

- First visit: \~2-4s (AI generation)
- Cached visits: \~50ms (instant)
- Cost: \~$0.002 per unique summary
- With caching: 97% cost reduction

## Key patterns you learned

**1. Server Components for AI**
AI calls happen server-side. Users never see your API keys. No client-side JavaScript needed for AI features.

```tsx
// Server Component - runs on server
export async function AIReviewSummary({ product }) {
  const summary = await summarizeReviews(product); // Server-side AI call
  return <div>{summary}</div>;
}
```

**2. Prompt engineering matters**
A good prompt is the difference between "meh" and "production-ready."

```typescript
// Bad: "Summarize these reviews"
// Good: Specific format, examples, constraints, tone guidance
```

**3. Structured output with Zod**
Don't parse AI text—tell the model exactly what shape you want.

```typescript
const { object } = await generateObject({
  model: "anthropic/claude-sonnet-4.5",
  schema: ReviewInsightsSchema, // Zod schema
  prompt,
});
// object is typed and validated
```

**4. Cache aggressively**
AI is expensive. Cache results. Most users see cached content—same UX, fraction of the cost.

```typescript
export async function summarizeReviews(product: Product) {
  "use cache";
  cacheLife("hours");
  cacheTag(`product-summary-${product.slug}`);

  // AI call runs once, result cached for 1 hour
  const { text } = await generateText({ ... });
  return text;
}
```

**5. Fail gracefully**
AI will fail. Handle it. Show users something useful instead of error screens.

## Where to go from here

Your app is complete, but there's always more to explore:

**Add more AI features:**

- Product comparisons ("How does X compare to Y?")
- Review sentiment over time ("Are reviews getting better or worse?")
- Personalized recommendations ("Based on your history...")

**Improve the UI:**

- Loading skeletons during AI generation
- "Regenerate" button for on-demand summaries
- Admin dashboard for cache management

**Scale considerations:**

- Rate limiting for public APIs
- Queue-based processing for bulk operations
- Multi-tenant cost tracking

**Advanced AI patterns:**

- Streaming responses for long-form content
- Multi-model pipelines (cheap model for filtering, expensive for analysis)
- Fine-tuning for domain-specific language

You did it! I am very proud of you!

**Course complete!** 🎉


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
