π΄ Letβs build a Generative AI App with NEXT.JS 14! (OpenAI, Streaming, AI Agent, TS, GPTScript)
Sonny Sangha
@sonnysanghaAbout
I'm Sonny. π― You might also know me as PAPA React! I've been coding for over 10 years now. As a Full Stack developer I've worked both with startups and large corporations to help build & scale their companies. Along the journey I realised my passion existed in helping others excel and pursue their dreams as upcoming developers and if thatβs not enough I have cloned most of the applications you have used in your life! π π¨ Join the worldβs BEST developer community βZero to Full Stack Heroβ NOW: https://www.papareact.com/course
Latest Posts
Video Description
βοΈ Get started with GPTScript Today: https://links.papareact.com/gptscript βοΈβοΈ Get the 'story-book.gpt' script for FREE here: https://www.papareact.com/gptscript-opt-in-form π¨ Join the worldβs BEST developer community & course Zero to Full Stack Hero: https://www.papareact.com/course π οΈ Looking for the Code for this build? (Plus over 50+ others!) https://links.papareact.com/github Join me as I show you how to build a StoryTeller AI App from scratch with the latest Next.js 14. You'll learn the following in this build: π How to implement GPTScript to create an AI Agent assistant capable of chaining AI tasks together - we'll build a Storybook with beautiful text & images, completely built from the AI agent's initial single prompt! π Ability to See a Real-Time Process of the Storybook Creation Process! (See the AI Agent in action!) π Ability to Store All Previously Created Stories by writing to the server... in fact the AI Agent does this for us! π How to build API routes using the app router Route Handler syntax π How to implement streaming to stream in the AI Agent's processes in real-time from our API endpoint! π How to utilise the power of caching in Next.js to create an optimal & efficient user experience! π How to use Next.js Server Components & Client Components and when/where to use them! π How to Integrate OpenAI into the Build π Create a Beautiful UI & UX for our Frontend using the highly Popular Shadcn & Tailwind CSS π How to use TypeScript to reduce the overall number of Bugs and Errors π How to deploy the final build on Vercel π΅ WANT TO LISTEN TO THE EXCLUSIVE PAPAFAM PLAYLIST? Sign up for the PAPAFAM Newsletter here π https://links.papareact.com/newsletter π TIMESTAMPS: 00:00 Introduction 01:10 Build Demo 09:08 Build Tech 12:52 Explaining GPTScript 19:00 Initialising the Build 26:00 Building the Header Component 33:36 Implementing Shadcn/ui 35:38 Building the Nav Icons for the Header Component 38:24 Building the Home Page 44:56 Building the Story Writer Component 58:15 Building the AI Terminal Viewer 1:10:21 Creating an API Endpoint (1/2) 1:11:54 Setting Up GPTScript 1:16:27 Creating an API Endpoint (2/2) 1:21:04 Implementing GPTScript 1:28:38 Implementing the Streaming Functionality 1:50:44 Explaining How the Streaming Functionality Works 1:57:29 Fetching All the Stories 2:13:52 Building the Stories Page 2:29:01 Building the Story Book Carousel View 2:39:03 Implementing Toast Notifications 2:43:11 Final Build Demo 2:50:17 Deploying to Vercel 2:54:22 Build Summary Letβs get it PAPAFAM π₯. DISCLAIMER: This Video is made for informational and educational purposes only. We do not own or affiliate with OpenAI and/or any of its subsidiaries in any form. Copyright Disclaimer Under section 107 of the Copyright Act 1976, allowance is made for βfair useβ of this video for educational purposes. #nextjs #nextjs15 #react #ai #chatgpt #reactjs #coding #javascript #tailwindcss #shadcn #openai #reactjstutorial #coding #tutorial #beginner #programming #machinelearning #story #aiagents
Upgrade Your Tech Today
AI-recommended products based on this video

SAMSUNG Galaxy Watch Ultra 47mm LTE AI Smartwatch Bundle w/ 25W Power Adapter, Energy Score, Wellness Tips, Heart Rate Tracking, Sleep Monitor, Fitness Tracker, GPS, 2024,Titanium Silver

USB C Car Charger, 3-Port 67W Dual USB-C & USB-A Car Power Adapter PD/QC Fast Charging Cigarette Lighter for iPhone 17/16/15/14/13/12/11 Pro Max, iPad, Samsung Galaxy S25 S24/S23/S22, Pixel, Android

Megoo 14" Laptop Sleeve Case for Surface Laptop 7/6/5/4/Studio, Surface Book, Samsung Galaxy Tab S9/S8, Shockproof Water-Resistant Carry Pouch Bag for 13.5"-14.6" Notebook Computers(Light Gray)

SAMSUNG Galaxy Watch Ultra 47mm LTE AI Smartwatch Bundle w/ 25W Power Adapter, Energy Score, Wellness Tips, Heart Rate Tracking, Sleep Monitor, Fitness Tracker, GPS, 2024,Titanium Silver

Wireless Bluetooth Mouse for Apple iPad iPhone MacBook Android Samsung Tablet Phone Dual-Mode Rechargeable 2.4G Portable Computer Mice for Windows Laptop Notebook PC Mac Desktop USB Receiver (Black)

USB C Car Charger, 3-Port 67W Dual USB-C & USB-A Car Power Adapter PD/QC Fast Charging Cigarette Lighter for iPhone 17/16/15/14/13/12/11 Pro Max, iPad, Samsung Galaxy S25 S24/S23/S22, Pixel, Android

SAMSUNG Galaxy Watch Ultra 47mm LTE AI Smartwatch Bundle w/ 25W Power Adapter, Energy Score, Wellness Tips, Heart Rate Tracking, Sleep Monitor, Fitness Tracker, GPS, 2024,Titanium Silver

USB C Car Charger, 3-Port 67W Dual USB-C & USB-A Car Power Adapter PD/QC Fast Charging Cigarette Lighter for iPhone 17/16/15/14/13/12/11 Pro Max, iPad, Samsung Galaxy S25 S24/S23/S22, Pixel, Android

Megoo 14" Laptop Sleeve Case for Surface Laptop 7/6/5/4/Studio, Surface Book, Samsung Galaxy Tab S9/S8, Shockproof Water-Resistant Carry Pouch Bag for 13.5"-14.6" Notebook Computers(Light Gray)

SAMSUNG Galaxy Watch Ultra 47mm LTE AI Smartwatch Bundle w/ 25W Power Adapter, Energy Score, Wellness Tips, Heart Rate Tracking, Sleep Monitor, Fitness Tracker, GPS, 2024,Titanium Silver

ANKER 737 Power Bank, 24,000mAh 3-Port Laptop Portable Charger with 140W Fast Charging, Smart Display, for Outdoor Work, Compatible with iPhone 16/15/14 Series, Vision Pro, Samsung, MacBook, and More

Anker Power Bank(PowerCore 10K),Compact Travel-Ready 10,000mAh Battery Pack with PowerIQ Charging Technology,5V/3A High-Speed Charging for iPhone,iPad,and More (USB-C Input and OutputοΌBlackοΌοΌ1pack) ClimatePartner certified

DJI Mic Mini (2 TX + 1 RX + Charging Case), Wireless Lavalier Microphone for iPhone/Camera/Android, Ultralight, Detail-Rich Audio, 48h Use, Noise Cancelling, Automatic Limiting, Vlog, Streaming

2 Pack Continuous Spray Bottles - Ultra Fine Mist Sprayer | Water Spray Bottle For Hair Mister Spray Bottle | Hair Spray Bottles For Hairstyling, Cleaning, Salons - 2pk 6.8 OZ / 200 ML

JSAUX 3-Pack Tempered Glass Screen Protector for Nintendo Switch 2 (2025), Easy to Install with Guiding Frame Ultra HD Glass Protector 9H Hardness Scratch Resistant Accessories for Switch2

Hydrocolloid Bandages for Wound Care, Extra Large Medical-Grade Hydrocolloid Roll with Self-Adhesive, Ultra Absorbent, Flexible & Waterproof, DIY Size & Shape First Aid Kit Essential (2in*4.8ft)

Belkin BoostCharge Lightning Cable - 6.6ft/2M - MFi Certified Apple iPhone Charger USB to Lightning Cable - iPhone Cable - iPhone Charger Cord - Apple Charger - USB Phone Charger - Black

Lexar ES3 1TB External SSD, USB 3.2 Gen2 Portable SSD, PSSD Up to 1050MB/s Read, 1000MB/s Write, External Solid State Drive Compatible with iPhone 16/15 Series/Mac/PS5/XBOX/Laptop/PC

acer Aspire 3 Laptop | 15.6" FHD (1920 x 1080) Display | 8-Core AMD Ryzen 7-5700U | AMD Radeon | 64GB RAM | 4.5TB SSD (4TB PCIe SSD withHP P500 512GB Portable SSD) | Ethernet Port | Windows 11 Pro

acer Aspire 3 Laptop | 15.6" FHD (1920 x 1080) Display | AMD Radeon | 8-Core AMD Ryzen 7-5700U | 64GB RAM | 4.5TB SSD (4TB PCIe SSD withHP P500 512GB Portable SSD) | Ethernet Port | Windows 11 Pro

Anker USB C to USB C Cable, Type-C 60W Fast Charging Cable (6FT, 2Pack) for iPhone 16 Series, iPad mini 6 and More (Black) ClimatePartner certified

2 Pack Continuous Spray Bottles - Ultra Fine Mist Sprayer | Water Spray Bottle For Hair Mister Spray Bottle | Hair Spray Bottles For Hairstyling, Cleaning, Salons - 2pk 6.8 OZ / 200 ML

JSAUX 3-Pack Tempered Glass Screen Protector for Nintendo Switch 2 (2025), Easy to Install with Guiding Frame Ultra HD Glass Protector 9H Hardness Scratch Resistant Accessories for Switch2

Hydrocolloid Bandages for Wound Care, Extra Large Medical-Grade Hydrocolloid Roll with Self-Adhesive, Ultra Absorbent, Flexible & Waterproof, DIY Size & Shape First Aid Kit Essential (2in*4.8ft)

Zima Dental Pod: Ultrasonic Retainer Cleaner. The Original Retainer Cleaner Machine, Aligner Cleaner, Nightguard Cleaner, Mouthguard Cleaner, Denture Cleaner. Ultrasonic Cleaner For Oral Dental Care

2 Pack Continuous Spray Bottles - Ultra Fine Mist Sprayer | Water Spray Bottle For Hair Mister Spray Bottle | Hair Spray Bottles For Hairstyling, Cleaning, Salons - 2pk 6.8 OZ / 200 ML

JSAUX 3-Pack Tempered Glass Screen Protector for Nintendo Switch 2 (2025), Easy to Install with Guiding Frame Ultra HD Glass Protector 9H Hardness Scratch Resistant Accessories for Switch2

Hydrocolloid Bandages for Wound Care, Extra Large Medical-Grade Hydrocolloid Roll with Self-Adhesive, Ultra Absorbent, Flexible & Waterproof, DIY Size & Shape First Aid Kit Essential (2in*4.8ft)

Zima Dental Pod: Ultrasonic Retainer Cleaner. The Original Retainer Cleaner Machine, Aligner Cleaner, Nightguard Cleaner, Mouthguard Cleaner, Denture Cleaner. Ultrasonic Cleaner For Oral Dental Care

SAMSUNG Galaxy Watch Ultra 47mm LTE AI Smartwatch Bundle w/ 25W Power Adapter, Energy Score, Wellness Tips, Heart Rate Tracking, Sleep Monitor, Fitness Tracker, GPS, 2024,Titanium Silver

Megoo 14" Laptop Sleeve Case for Surface Laptop 7/6/5/4/Studio, Surface Book, Samsung Galaxy Tab S9/S8, Shockproof Water-Resistant Carry Pouch Bag for 13.5"-14.6" Notebook Computers(Light Gray)














