SlideShare a Scribd company logo
© ABL - The Problem Solver 1
Next.js 15
Development
Bootcamp
Maurice de Beijer
@mauricedb
© ABL - The Problem Solver 3
 Maurice de Beijer
 The Problem Solver
 Freelance developer/instructor
 Twitter: @mauricedb
 Web: https://www.theproblemsolver.dev/
 E-mail: maurice.de.beijer@gmail.com
© ABL - The Problem Solver 4
Topics
 Why use Next.js
 Creating a new Next.js application
 Generating a landing page using Vercel V0
 Adding a Postgres SQL database using Docker
 Adding the Prisma ORM with the database schema
 Seeding the database with data
 Adding client-side interactions and state
 Deploying the application to Vercel
© ABL - The Problem Solver 5
Type it out
by hand?
“Typing it drills it into your brain much better
than simply copying and pasting it. You're
forming new neuron pathways. Those
pathways are going to help you in the future.
Help them out now!”
© ABL - The Problem Solver 6
Prerequisites
Install Node, NPM & Docker
© ABL - The Problem Solver 7
Install
Node.js &
NPM
© ABL - The Problem Solver 8
VS Code
© ABL - The Problem Solver 9
Or Cursor
© ABL - The Problem Solver 10
Following
Along
 Repo: https://github.com/mauricedb/next-15-bootcamp
 Slides:
https://www.theproblemsolver.dev/docs/next-15-bootcamp.pdf
© ABL - The Problem Solver 11
The changes
© ABL - The Problem Solver 12
The
application
© ABL - The Problem Solver 13
Why use Next.js 15
© ABL - The Problem Solver 14
Why use
Next.js
© ABL - The Problem Solver 15
Why use
Next.js
© ABL - The Problem Solver 16
Why use
Next.js
© ABL - The Problem Solver 17
Why use
Next.js
 React 19 Support
 It provides full compatibility with React 19, giving you
access to the latest React features like Server Components
improvements, enhanced Suspense behavior, and better
concurrent rendering capabilities.
 React Server Components
 Server Components have been refined with better
streaming support, improved error boundaries, and more
predictable behavior, making it easier to build applications
that render efficiently on the server.
 Great Developer Experience
 The development server is faster with better hot module
replacement. The framework includes enhanced error
messages, better debugging tools, and improved
TypeScript integration that makes development more
productive.
© ABL - The Problem Solver 18
Why use
Next.js
 Enhanced App Router
 The App Router continues to mature with better
performance, more stable APIs, and improved data fetching
patterns. This gives you more flexibility in how you
structure and render your applications.
 Performance Improvements
 Next.js 15 introduces significant performance
optimizations, including better bundle splitting, improved
tree shaking, and enhanced caching mechanisms.
 It supports partial prerendering (PPR) as a stable feature,
allowing you to combine static and dynamic content more
efficiently.
 Turbopack Integration
 Next.js 15 includes better integration with Turbopack
(Webpack's successor), providing faster build times and
more efficient bundling, especially for larger applications.
© ABL - The Problem Solver 19
Creating a new
Next.js application
© ABL - The Problem Solver 20
Creating a new
Next.js
application
 Creating a new project using a wizard with a
questionnaire
 npx create-next-app@latest
© ABL - The Problem Solver 21
Creating a new
Next.js
application
 Creating a project based on a Vercel Next.js example
 npx create-next-app@latest my-app1 --example
with-styled-components
 See https://github.com/vercel/next.js/tree/canary/examples
 Create a new project based on another example
 npx create-next-app@latest my-app1 --example
https://github.com/mui/material-ui/tree/master
/examples/material-ui-nextjs-ts
© ABL - The Problem Solver 22
Creating a
new
Shadcn/Next
.js
application
 When using Shadcn/ui there is a shortcut
 npx shadcn@latest init
© ABL - The Problem Solver 23
Creating a new
Next.js
application
© ABL - The Problem Solver 24
Creating a
new Next.js
application
© ABL - The Problem Solver 25
Generating a
landing page using
Vercel V0
© ABL - The Problem Solver 26
Generating a
landing page
using Vercel
V0
 Rapid prototyping with complete projects
 Generates full Next.js applications with proper folder structure,
configuration, and git setup that you can immediately download and
run locally
 Modern Next.js best practices built-in
 Uses the latest App Router, Server Actions, TypeScript, and Tailwind CSS
automatically, keeping your code current with framework standards
 Real-time interactive development
 Preview and test your application instantly in the browser while making
changes through natural language prompts, no local setup required
 Production-ready code quality
 Generates clean, well-organized code following industry best practices
rather than throwaway prototypes, with integrated shadcn/ui
components
 Accessible to non-developers
 Enables designers, product managers, and entrepreneurs to build
functional web applications using plain English descriptions rather than
requiring deep coding knowledge
© ABL - The Problem Solver 27
The Prompt
© ABL - The Problem Solver 28
Generating a
landing page
using Vercel
V0
© ABL - The Problem Solver 29
Generating a
landing page
using Vercel
V0
© ABL - The Problem Solver 30
Add to
codebase
 npx shadcn@latest add
"https://v0.dev/chat/b/b_uCxq9uwB2Qu"
© ABL - The Problem Solver 31
Placeholder
image
 Note: the placeholder image is not added to the project
 https://github.com/mauricedb/next-15-bootcamp/blob/mai
n/public/placeholder.svg
© ABL - The Problem Solver 32
Generating a
landing page
using Vercel
V0
© ABL - The Problem Solver 33
Using shared
layouts
© ABL - The Problem Solver 34
Using shared
layouts
 Consistent UI structure across pages
 Layout components allow you to define shared elements like headers,
navigation, and footers once and automatically apply them to multiple pages,
ensuring a cohesive user experience throughout your application.
 Reduced code duplication
 Instead of importing and wrapping the same layout components in every page
file, you can define the layout once and have it automatically wrap all pages in
that route segment, leading to cleaner and more maintainable code.
 Improved performance through persistent state
 Layout components remain mounted when navigating between pages that
share the same layout, preserving component state and avoiding unnecessary
re-renders of common UI elements like navigation menus or sidebars.
 Hierarchical layout composition
 The App Router's nested layout system allows you to create sophisticated layout
hierarchies where different route segments can have their own layouts that
compose together, enabling complex page structures with minimal code.
 Better SEO and metadata management
 Layouts provide a centralized place to define page metadata, title templates,
and other SEO-related elements that should be consistent across sections of
your site, making it easier to maintain proper search engine optimization.
© ABL - The Problem Solver 35
Using shared
layouts
© ABL - The Problem Solver 36
Using shared
layouts
© ABL - The Problem Solver 37
Break time
© ABL - The Problem Solver 38
Rendering movie
cards
© ABL - The Problem Solver 39
Rendering
movie cards
 We want the user of the app to be able to pick movies to
compare
 We will use Vercel V0 again to generate the components
 For now, we will use some hard coded data
© ABL - The Problem Solver 40
Rendering
movie cards
© ABL - The Problem Solver 41
Rendering
movie cards
© ABL - The Problem Solver 42
Rendering
movie cards
 npx shadcn@latest add
"https://v0.dev/chat/b/b_uCxq9uwB2Qu"
© ABL - The Problem Solver 43
Rendering
movie cards
© ABL - The Problem Solver 44
Adding a Postgres
SQL database using
Docker
© ABL - The Problem Solver 45
Why use
Docker?
 Environment consistency
 Every developer on your team gets exactly the same database version,
configuration, and extensions, eliminating "works on my machine"
issues that plague traditional local installations.
 Zero installation complexity
 Skip the headache of installing Postgres natively, managing system
services, or dealing with permission issues. One docker run command
gets you a fully functional database.
 Isolated and disposable
 Each project can have its own containerized database that won't
interfere with other projects or your system. When you're done, simply
delete the container with no leftover files or configurations.
 Resource control
 Easily limit memory and CPU usage for your development database,
preventing it from consuming too many system resources during
intensive operations.
 Quick reset capabilities
 Corrupted data or need a fresh start? Destroy and recreate your
database container in seconds rather than manually
dropping/recreating schemas or reinstalling software.
© ABL - The Problem Solver 46
Adding a
Postgres SQL
database
© ABL - The Problem Solver 47
Adding a
Postgres SQL
database
© ABL - The Problem Solver 48
Adding the Prisma
ORM
© ABL - The Problem Solver 49
Adding the
Prisma ORM
© ABL - The Problem Solver 50
Adding the
Prisma ORM
 Type Safety Throughout
 Prisma generates TypeScript types automatically from your
database schema, ensuring complete type safety from
database queries to your Next.js components, eliminating
runtime errors from type mismatches.
 Seamless API Route Integration
 Prisma's query syntax works perfectly in Next.js API routes,
server components and server actions, providing clean
database operations without complex SQL or connection
management overhead.
 Excellent Developer Experience
 Prisma Studio provides a visual database browser, while the
Prisma CLI offers schema migration tools and database
seeding capabilities that streamline development workflow.
 Database Agnostic Flexibility
 Switch between PostgreSQL, MySQL, SQLite, MongoDB, and
other databases without changing your application code,
making it easy to adapt to different deployment environments.
© ABL - The Problem Solver 51
Adding the
Prisma ORM
 Optimized for Modern Next.js Features
 Works seamlessly with App Router, Server Components, and
React Server Components, allowing you to fetch data
directly in components without additional API layers.
 Built-in Connection Pooling
 Handles database connections efficiently, particularly
important in serverless Next.js deployments where
connection management can be challenging.
 Powerful Migration System
 Prisma Migrate tracks schema changes and generates
migration files automatically, making database versioning
and deployment straightforward across different
environments.
 Query Optimization and Caching
 Provides query result caching and includes tools to analyze
and optimize database performance, crucial for Next.js
applications that need fast response times.
© ABL - The Problem Solver 52
Adding the
Prisma ORM
© ABL - The Problem Solver 53
Adding the
Prisma ORM
© ABL - The Problem Solver 54
Adding the
Prisma ORM
© ABL - The Problem Solver 55
Adding the
Prisma ORM
© ABL - The Problem Solver 56
Adding the
Prisma ORM
© ABL - The Problem Solver 57
Adding the
Prisma ORM
(Next.js)
© ABL - The Problem Solver 58
Adding the
database schema
© ABL - The Problem Solver 59
Adding the
database
schema
 Prisma database schemas
 Prisma uses a schema.prisma file as a single source of truth
that defines your database structure, models, and
relationships in a declarative format.
 This schema serves as the foundation for Prisma's code
generation, allowing it to automatically create type-safe client
code that matches your exact database structure.
 Migrations are created in development to do schema
updates
 prisma migrate dev --name <migration name>
 Migrations are executed in production to update the
production DB
 prisma migrate deploy
© ABL - The Problem Solver 60
Adding the
database
schema
© ABL - The Problem Solver 61
Adding the
database
schema
© ABL - The Problem Solver 62
Seeding the
database
© ABL - The Problem Solver 63
Seeding the
database
 Consistent Development Environment
 Database seeding ensures all developers on your team start with the
same baseline data, eliminating inconsistencies that can cause bugs
to appear on some machines but not others and making debugging
more predictable across different development setups.
 Faster Feature Development and Testing
 Having realistic sample data immediately available allows developers
to test user interfaces, business logic, and edge cases without
manually creating test records every time they reset their local
database or onboard new team members.
 Automated Deployment Pipeline Integration
 Seed scripts can be integrated into your CI/CD pipeline to populate
staging and testing environments with known data sets, enabling
automated testing scenarios and providing consistent environments
for QA teams to validate features.
 Realistic Data Relationships and Volume
 Well-designed seed data includes proper foreign key relationships,
realistic data volumes, and edge cases that mirror production
scenarios, helping identify performance issues and relationship
problems early in development rather than after deployment.
© ABL - The Problem Solver 64
Seeding the
database
© ABL - The Problem Solver 65
Seeding the
database
© ABL - The Problem Solver 66
Seeding the
database
© ABL - The Problem Solver 67
Break time
© ABL - The Problem Solver 68
Using data from the
DB
© ABL - The Problem Solver 69
Using data
from the DB
 Direct Database Queries in Components
 Server components allow you to write Prisma database queries directly inside React
components that render on the server, eliminating the need for separate API routes
or data fetching layers for many common use cases like displaying lists or detail
pages.
 Async Component Rendering
 React 19 server components can be async functions, meaning you can use await
directly in component code to fetch data from Prisma before rendering, making data
fetching feel more natural and reducing the complexity of managing loading states
for initial page loads.
 Improved Performance and SEO
 Since Prisma queries execute on the server and components render with data already
available, pages load faster with complete HTML content, improving SEO and
eliminating the "loading spinner then content" pattern that hurts user experience
and search rankings.
 Reduced Client-Server Roundtrips
 Server components with embedded Prisma queries eliminate the need for separate
API calls after page load, reducing network requests and improving perceived
performance, especially for data that doesn't need to be dynamically updated on the
client.
 Simplified Error Handling and Security
 Database connection strings and Prisma client configuration remain server-side only,
improving security while allowing you to handle database errors closer to where
queries are executed rather than managing error states across API boundaries.
© ABL - The Problem Solver 70
Server vs
Client
Components
 Server Components by Default
 In React 19 with Next.js app router, components are server components by default,
meaning they render on the server during build time or request time, have access to
server-side resources like databases and file systems, and cannot use browser-specific
APIs or event handlers.
 Client Component Declaration
 To create a client component that runs in the browser, you must add the 'use client'
directive at the very top of your component file before any imports, which tells React to
hydrate and run this component on the client side with full interactivity.
 Interactivity and State Management
 Client components can use React hooks like useState, useEffect, and event handlers like
onClick, while server components cannot use any interactive features, browser APIs, or
state management since they only exist during server rendering.
 Bundle Size and Performance Trade-offs
 Server components don't add to your JavaScript bundle size since they render on the
server, while client components increase bundle size and require hydration, so you should
only mark components as client components when interactivity is actually needed.
 Data Fetching Patterns
 Server components can directly access databases, APIs, and server resources during
rendering, while client components must fetch data through client-side methods like
fetch() calls to API routes or external endpoints after the component mounts.
 Component Composition Rules
 Server components can import and render client components, but client components
cannot directly import server components, though server components can be passed as
props or children to client components for flexible architectures.
© ABL - The Problem Solver 71
Using data
from the DB
© ABL - The Problem Solver 72
Adding client-side
interactions and
state
Using Valtio - Proxy state made simple 
© ABL - The Problem Solver 73
Adding
client-side
interactions
and state
 Proxy-Based Reactivity
 Valtio uses JavaScript proxies to automatically track state mutations and re-render
components only when the specific data they access changes, eliminating the need for
manual dependency arrays or complex state update patterns that can cause unnecessary re-
renders.
 Mutable State Updates
 Unlike Redux or Zustand, Valtio allows you to directly mutate state objects using familiar
JavaScript syntax like state.user.name = 'John', making state updates feel natural and reducing
boilerplate code while still maintaining React's reactivity principles.
 Minimal Boilerplate and Learning Curve
 Valtio requires very little setup code and uses intuitive APIs that feel like working with plain
JavaScript objects, making it easier for developers to adopt compared to more complex state
management solutions that require actions, reducers, or special update functions.
 Automatic Optimization
 The library automatically optimizes re-renders by tracking which properties each component
accesses, so components only update when their specific data dependencies change, leading
to better performance without manual optimization efforts like memoization or selector
functions.
 TypeScript Integration
 Valtio provides excellent TypeScript support with full type inference for state objects and
mutations, ensuring type safety across your application while maintaining the simple
mutable API that makes the library appealing.
 Flexible State Architecture
 You can organize state into multiple proxy objects for different domains of your application,
share state across components easily, and even subscribe to state changes outside of React
components for integration with other libraries or side effects.
© ABL - The Problem Solver 74
Adding
client-side
interactions
and state
© ABL - The Problem Solver 75
Adding
client-side
interactions
and state
© ABL - The Problem Solver 76
Adding
client-side
interactions
and state
© ABL - The Problem Solver 77
Adding
client-side
interactions
and state
© ABL - The Problem Solver 78
Comparing movies
© ABL - The Problem Solver 79
Comparing
movies
 We want the user of the app to be able to compare
movies
 We will use Vercel V0 again to generate the page
 The generated components will use generated data
 We will need to hook it up with the Valtio store
© ABL - The Problem Solver 80
Comparing
movies
© ABL - The Problem Solver 81
Comparing
movies
 npx shadcn@latest add
"https://v0.dev/chat/b/b_jwu1vRBKFBo"
© ABL - The Problem Solver 82
Comparing
movies
© ABL - The Problem Solver 83
Comparing
movies
© ABL - The Problem Solver 84
Comparing
movies
© ABL - The Problem Solver 85
Disabling the
/compare route
© ABL - The Problem Solver 86
Disabling the
/compare
route
 Prevent Empty State Confusion
 Disabling the compare route when no movies are selected
prevents users from landing on a blank or confusing page
that doesn't provide any value, eliminating the need to
handle empty state UI and reducing user frustration with
dead-end navigation.
© ABL - The Problem Solver 87
Disabling the
/compare
route
© ABL - The Problem Solver 88
Disabling the
/compare
route
© ABL - The Problem Solver 89
Deploying the
database to the
cloud
© ABL - The Problem Solver 90
Deploying
the database
to the cloud
 Self-managed on Cloud VMs (DigitalOcean, Linode)
 Provides maximum control and potentially lower costs for high-usage
scenarios, but requires significant database administration expertise for
maintenance, security, and optimization tasks.
 Managed Cloud Services (AWS, Google, Azure)
 Major cloud providers offer fully managed PostgreSQL with automated
backups, patching, and scaling, but require more configuration and
typically have higher costs with traditional instance-based pricing models.
 Neon
 Provides serverless PostgreSQL with automatic scaling, database
branching for development workflows, and a generous free tier, making it
ideal for modern applications that need flexible compute resources
without infrastructure management.
 Supabase
 Combines PostgreSQL with a full backend-as-a-service platform including
real-time subscriptions, authentication, and auto-generated APIs, perfect
for developers who want a complete backend solution beyond just the
database.
 And many more
 Heroku, Aiven, Exoscale, etc …
© ABL - The Problem Solver 91
Using Neon
 Serverless Architecture
 Neon provides a serverless PostgreSQL platform that automatically scales
compute resources up and down based on demand, eliminating the need
to manage server infrastructure or worry about capacity planning.
 Instant Database Creation
 You can create a new PostgreSQL database in seconds through Neon's
web console or CLI, with no complex setup or configuration required - just
sign up and start building immediately.
 Branching for Development
 Neon offers Git-like database branching that allows you to create isolated
database copies for development, testing, and staging environments
without duplicating data storage costs.
 Generous Free Tier
 Neon provides a substantial free tier with 512 MB of storage and 1
compute unit, making it excellent for development projects, prototypes,
and small applications without upfront costs.
 Standard PostgreSQL Compatibility
 Since Neon runs genuine PostgreSQL, you can use all your existing tools,
extensions, and SQL knowledge without any vendor lock-in or proprietary
syntax to learn.
© ABL - The Problem Solver 92
Why Neon
instead of
AWS
 Serverless vs. Always-On Instances
 Neon automatically scales compute to zero when inactive
and scales up on demand, while AWS RDS requires you to
provision and pay for fixed database instances that run
continuously, even during periods of no activity.
 Simplified Management and Setup
 Neon handles all database administration tasks through a
streamlined interface, whereas AWS RDS requires
configuring VPCs, security groups, parameter groups, and
other infrastructure components that add complexity to
deployment and maintenance.
 Developer-Focused Features
 Neon provides Git-like database branching for development
workflows and instant database creation, while AWS RDS
focuses on enterprise features like Multi-AZ deployments
and read replicas that may be overkill for many
applications.
© ABL - The Problem Solver 93
Deploying
the database
to the cloud
© ABL - The Problem Solver 94
Deploying
the database
to the cloud
© ABL - The Problem Solver 95
Deploying
the database
to the cloud
© ABL - The Problem Solver 96
Deploying
the database
to the cloud
© ABL - The Problem Solver 97
Deploying the
application to Vercel
© ABL - The Problem Solver 98
Deploying
the
application
 Next.js applications can be self hosted and deployed
anywhere
 Provided you have a Node.js runtime
 Just do npm run build && npm start
 Self hosting works well in a Docker container
 Great portability and platform agnostic
 Runs anywhere Docker is supported
 Avoids vendor lock-in
 Many providers make this even easier and better using
adapters
 AWS Amplify
 Cloudflare
 Deno Deploy
 Netlify
 Vercel
© ABL - The Problem Solver 99
Deploying
the
application
© ABL - The Problem Solver 100
Deploying
the
application
to Vercel
 Vercel is the company behind Next.js
 A significant part of the React core team work there
 They use usage-based pricing
 With a with free tier
 A lot of build in tooling and services
 CDN for scaling
 Continuous deployment based on updates to GitHub’s main
branch
 Automatic preview deployments with GitHub PR’s
© ABL - The Problem Solver 101
Deploying
the
application
to Vercel
© ABL - The Problem Solver 102
Deploying
the
application
to Vercel
© ABL - The Problem Solver 103
Deploying
the
application
to Vercel
© ABL - The Problem Solver 104
Deploying
the
application
to Vercel
© ABL - The Problem Solver 105
Deploying
the
application
© ABL - The Problem Solver 106
Persisting selected
movies
© ABL - The Problem Solver 107
Persisting
selected
movies
 Automatic State Synchronization
 Valtio's subscribe() function reacts to any state change in your proxy object,
automatically triggering localStorage saves whenever selected movies are added or
removed without requiring manual persistence calls throughout your application
code.
 Simple JSON Serialization Pattern
 You can initialize your state from localStorage with
JSON.parse(localStorage.getItem('selectedMovies')) and then use subscribe() to
automatically save the entire state object with JSON.stringify(state) whenever it
changes, creating a seamless two-way sync.
 Minimal Setup Code
 The entire persistence setup takes just a few lines of code - create your proxy state
with initial localStorage data, then add one subscribe() call that handles all future
saves automatically, eliminating complex persistence logic scattered throughout your
components.
 Real-time Persistence
 Since subscribe() triggers on every state mutation, your selected movies are
immediately saved to localStorage as soon as users select or deselect them, ensuring
no data loss even if the browser crashes or the user accidentally closes the tab.
 Zero Component Coupling
 The persistence logic lives entirely outside your React components, so you can add,
remove, or modify selected movies from any component without worrying about
remembering to save the state - the subscribe() function handles it automatically in
the background.
© ABL - The Problem Solver 108
Persisting
selected
movies
© ABL - The Problem Solver 109
Conclusion
 Next.js is a great React application framework
 Creating a new Next.js application is easy
 Using Vercel V0 can speed development a lot
 Docker is great for development purposes
 Not just for deployment to production
 The Prisma ORM makes database access really easy
 React sever component makes using server data much
easier
 React client components make client-side state easier
 Vercel is a great hosting platform
 But not a requirement
© ABL - The Problem Solver 110
Thank you for joining
Share your
thoughts

More Related Content

Similar to Full-stack App in half a Day: Next.js 15 Development Bootcamp (20)

PDF
Choosing Between React and Next.js: Key Differences Explained
Shiv Technolabs Pvt. Ltd.
 
PDF
How Can the Hermes Engine Help React Native Apps.
Techugo
 
PDF
why_choose_react_js_development_for_building_websites_in_2023.pdf
sarah david
 
PDF
React.js vs Node.js: Overview, Use Cases, and Key Features
Agile Infoways LLC
 
PDF
Step Into the Future with Next.js: Performance Meets Innovation
Mobisoft Infotech
 
PDF
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
adityakumar2080
 
DOCX
COMP6210 Web Services And Design Methodologies.docx
write31
 
PPTX
AFTAB AHMED.pptx
AftabAhmed132116
 
PDF
Why Use React Js A Complete Guide (1).pdf
Katy Slemon
 
PDF
NodeJS and React The Best Combination for Web Application Development.pdf
Laura Miller
 
PDF
Why You Should Use MERN Stack for Startup Apps?
PixelCrayons
 
PDF
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
PPTX
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
Simplilearn
 
PDF
Next.js with drupal, the good parts
Taller Negócio Digitais
 
PPTX
Next.js vs React | what to choose for frontend development_
ForceBolt
 
PDF
Learn Programming Languages & Get Programming Assignment Sample Solutions PDF...
Assignment Task
 
PPTX
why_choose_react_js_development_for_building_websites_in_2023.pptx
sarah david
 
PPTX
Seminar report based on Mern stack web technology
Mm071
 
PDF
Explore the Benefits of Node.js and React Together in Full-Stack Web Development
Inexture Solutions
 
PPTX
Next JS vs React.pptx
Albiorix Technology
 
Choosing Between React and Next.js: Key Differences Explained
Shiv Technolabs Pvt. Ltd.
 
How Can the Hermes Engine Help React Native Apps.
Techugo
 
why_choose_react_js_development_for_building_websites_in_2023.pdf
sarah david
 
React.js vs Node.js: Overview, Use Cases, and Key Features
Agile Infoways LLC
 
Step Into the Future with Next.js: Performance Meets Innovation
Mobisoft Infotech
 
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
adityakumar2080
 
COMP6210 Web Services And Design Methodologies.docx
write31
 
AFTAB AHMED.pptx
AftabAhmed132116
 
Why Use React Js A Complete Guide (1).pdf
Katy Slemon
 
NodeJS and React The Best Combination for Web Application Development.pdf
Laura Miller
 
Why You Should Use MERN Stack for Startup Apps?
PixelCrayons
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
Simplilearn
 
Next.js with drupal, the good parts
Taller Negócio Digitais
 
Next.js vs React | what to choose for frontend development_
ForceBolt
 
Learn Programming Languages & Get Programming Assignment Sample Solutions PDF...
Assignment Task
 
why_choose_react_js_development_for_building_websites_in_2023.pptx
sarah david
 
Seminar report based on Mern stack web technology
Mm071
 
Explore the Benefits of Node.js and React Together in Full-Stack Web Development
Inexture Solutions
 
Next JS vs React.pptx
Albiorix Technology
 

More from Maurice De Beijer [MVP] (20)

PPTX
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
 
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
 
PDF
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
 
PPTX
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
 
PPTX
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
 
PPTX
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
PPTX
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 
PPTX
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
 
PPTX
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
PPTX
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
 
PPTX
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
 
PPTX
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
PPTX
The new React
Maurice De Beijer [MVP]
 
PPTX
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
 
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
 
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
 
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
 
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
 
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
 
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
 
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
 
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
 
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
The new React
Maurice De Beijer [MVP]
 
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
Ad

Recently uploaded (20)

PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Ad

Full-stack App in half a Day: Next.js 15 Development Bootcamp

  • 1. © ABL - The Problem Solver 1
  • 3. © ABL - The Problem Solver 3  Maurice de Beijer  The Problem Solver  Freelance developer/instructor  Twitter: @mauricedb  Web: https://www.theproblemsolver.dev/  E-mail: [email protected]
  • 4. © ABL - The Problem Solver 4 Topics  Why use Next.js  Creating a new Next.js application  Generating a landing page using Vercel V0  Adding a Postgres SQL database using Docker  Adding the Prisma ORM with the database schema  Seeding the database with data  Adding client-side interactions and state  Deploying the application to Vercel
  • 5. © ABL - The Problem Solver 5 Type it out by hand? “Typing it drills it into your brain much better than simply copying and pasting it. You're forming new neuron pathways. Those pathways are going to help you in the future. Help them out now!”
  • 6. © ABL - The Problem Solver 6 Prerequisites Install Node, NPM & Docker
  • 7. © ABL - The Problem Solver 7 Install Node.js & NPM
  • 8. © ABL - The Problem Solver 8 VS Code
  • 9. © ABL - The Problem Solver 9 Or Cursor
  • 10. © ABL - The Problem Solver 10 Following Along  Repo: https://github.com/mauricedb/next-15-bootcamp  Slides: https://www.theproblemsolver.dev/docs/next-15-bootcamp.pdf
  • 11. © ABL - The Problem Solver 11 The changes
  • 12. © ABL - The Problem Solver 12 The application
  • 13. © ABL - The Problem Solver 13 Why use Next.js 15
  • 14. © ABL - The Problem Solver 14 Why use Next.js
  • 15. © ABL - The Problem Solver 15 Why use Next.js
  • 16. © ABL - The Problem Solver 16 Why use Next.js
  • 17. © ABL - The Problem Solver 17 Why use Next.js  React 19 Support  It provides full compatibility with React 19, giving you access to the latest React features like Server Components improvements, enhanced Suspense behavior, and better concurrent rendering capabilities.  React Server Components  Server Components have been refined with better streaming support, improved error boundaries, and more predictable behavior, making it easier to build applications that render efficiently on the server.  Great Developer Experience  The development server is faster with better hot module replacement. The framework includes enhanced error messages, better debugging tools, and improved TypeScript integration that makes development more productive.
  • 18. © ABL - The Problem Solver 18 Why use Next.js  Enhanced App Router  The App Router continues to mature with better performance, more stable APIs, and improved data fetching patterns. This gives you more flexibility in how you structure and render your applications.  Performance Improvements  Next.js 15 introduces significant performance optimizations, including better bundle splitting, improved tree shaking, and enhanced caching mechanisms.  It supports partial prerendering (PPR) as a stable feature, allowing you to combine static and dynamic content more efficiently.  Turbopack Integration  Next.js 15 includes better integration with Turbopack (Webpack's successor), providing faster build times and more efficient bundling, especially for larger applications.
  • 19. © ABL - The Problem Solver 19 Creating a new Next.js application
  • 20. © ABL - The Problem Solver 20 Creating a new Next.js application  Creating a new project using a wizard with a questionnaire  npx create-next-app@latest
  • 21. © ABL - The Problem Solver 21 Creating a new Next.js application  Creating a project based on a Vercel Next.js example  npx create-next-app@latest my-app1 --example with-styled-components  See https://github.com/vercel/next.js/tree/canary/examples  Create a new project based on another example  npx create-next-app@latest my-app1 --example https://github.com/mui/material-ui/tree/master /examples/material-ui-nextjs-ts
  • 22. © ABL - The Problem Solver 22 Creating a new Shadcn/Next .js application  When using Shadcn/ui there is a shortcut  npx shadcn@latest init
  • 23. © ABL - The Problem Solver 23 Creating a new Next.js application
  • 24. © ABL - The Problem Solver 24 Creating a new Next.js application
  • 25. © ABL - The Problem Solver 25 Generating a landing page using Vercel V0
  • 26. © ABL - The Problem Solver 26 Generating a landing page using Vercel V0  Rapid prototyping with complete projects  Generates full Next.js applications with proper folder structure, configuration, and git setup that you can immediately download and run locally  Modern Next.js best practices built-in  Uses the latest App Router, Server Actions, TypeScript, and Tailwind CSS automatically, keeping your code current with framework standards  Real-time interactive development  Preview and test your application instantly in the browser while making changes through natural language prompts, no local setup required  Production-ready code quality  Generates clean, well-organized code following industry best practices rather than throwaway prototypes, with integrated shadcn/ui components  Accessible to non-developers  Enables designers, product managers, and entrepreneurs to build functional web applications using plain English descriptions rather than requiring deep coding knowledge
  • 27. © ABL - The Problem Solver 27 The Prompt
  • 28. © ABL - The Problem Solver 28 Generating a landing page using Vercel V0
  • 29. © ABL - The Problem Solver 29 Generating a landing page using Vercel V0
  • 30. © ABL - The Problem Solver 30 Add to codebase  npx shadcn@latest add "https://v0.dev/chat/b/b_uCxq9uwB2Qu"
  • 31. © ABL - The Problem Solver 31 Placeholder image  Note: the placeholder image is not added to the project  https://github.com/mauricedb/next-15-bootcamp/blob/mai n/public/placeholder.svg
  • 32. © ABL - The Problem Solver 32 Generating a landing page using Vercel V0
  • 33. © ABL - The Problem Solver 33 Using shared layouts
  • 34. © ABL - The Problem Solver 34 Using shared layouts  Consistent UI structure across pages  Layout components allow you to define shared elements like headers, navigation, and footers once and automatically apply them to multiple pages, ensuring a cohesive user experience throughout your application.  Reduced code duplication  Instead of importing and wrapping the same layout components in every page file, you can define the layout once and have it automatically wrap all pages in that route segment, leading to cleaner and more maintainable code.  Improved performance through persistent state  Layout components remain mounted when navigating between pages that share the same layout, preserving component state and avoiding unnecessary re-renders of common UI elements like navigation menus or sidebars.  Hierarchical layout composition  The App Router's nested layout system allows you to create sophisticated layout hierarchies where different route segments can have their own layouts that compose together, enabling complex page structures with minimal code.  Better SEO and metadata management  Layouts provide a centralized place to define page metadata, title templates, and other SEO-related elements that should be consistent across sections of your site, making it easier to maintain proper search engine optimization.
  • 35. © ABL - The Problem Solver 35 Using shared layouts
  • 36. © ABL - The Problem Solver 36 Using shared layouts
  • 37. © ABL - The Problem Solver 37 Break time
  • 38. © ABL - The Problem Solver 38 Rendering movie cards
  • 39. © ABL - The Problem Solver 39 Rendering movie cards  We want the user of the app to be able to pick movies to compare  We will use Vercel V0 again to generate the components  For now, we will use some hard coded data
  • 40. © ABL - The Problem Solver 40 Rendering movie cards
  • 41. © ABL - The Problem Solver 41 Rendering movie cards
  • 42. © ABL - The Problem Solver 42 Rendering movie cards  npx shadcn@latest add "https://v0.dev/chat/b/b_uCxq9uwB2Qu"
  • 43. © ABL - The Problem Solver 43 Rendering movie cards
  • 44. © ABL - The Problem Solver 44 Adding a Postgres SQL database using Docker
  • 45. © ABL - The Problem Solver 45 Why use Docker?  Environment consistency  Every developer on your team gets exactly the same database version, configuration, and extensions, eliminating "works on my machine" issues that plague traditional local installations.  Zero installation complexity  Skip the headache of installing Postgres natively, managing system services, or dealing with permission issues. One docker run command gets you a fully functional database.  Isolated and disposable  Each project can have its own containerized database that won't interfere with other projects or your system. When you're done, simply delete the container with no leftover files or configurations.  Resource control  Easily limit memory and CPU usage for your development database, preventing it from consuming too many system resources during intensive operations.  Quick reset capabilities  Corrupted data or need a fresh start? Destroy and recreate your database container in seconds rather than manually dropping/recreating schemas or reinstalling software.
  • 46. © ABL - The Problem Solver 46 Adding a Postgres SQL database
  • 47. © ABL - The Problem Solver 47 Adding a Postgres SQL database
  • 48. © ABL - The Problem Solver 48 Adding the Prisma ORM
  • 49. © ABL - The Problem Solver 49 Adding the Prisma ORM
  • 50. © ABL - The Problem Solver 50 Adding the Prisma ORM  Type Safety Throughout  Prisma generates TypeScript types automatically from your database schema, ensuring complete type safety from database queries to your Next.js components, eliminating runtime errors from type mismatches.  Seamless API Route Integration  Prisma's query syntax works perfectly in Next.js API routes, server components and server actions, providing clean database operations without complex SQL or connection management overhead.  Excellent Developer Experience  Prisma Studio provides a visual database browser, while the Prisma CLI offers schema migration tools and database seeding capabilities that streamline development workflow.  Database Agnostic Flexibility  Switch between PostgreSQL, MySQL, SQLite, MongoDB, and other databases without changing your application code, making it easy to adapt to different deployment environments.
  • 51. © ABL - The Problem Solver 51 Adding the Prisma ORM  Optimized for Modern Next.js Features  Works seamlessly with App Router, Server Components, and React Server Components, allowing you to fetch data directly in components without additional API layers.  Built-in Connection Pooling  Handles database connections efficiently, particularly important in serverless Next.js deployments where connection management can be challenging.  Powerful Migration System  Prisma Migrate tracks schema changes and generates migration files automatically, making database versioning and deployment straightforward across different environments.  Query Optimization and Caching  Provides query result caching and includes tools to analyze and optimize database performance, crucial for Next.js applications that need fast response times.
  • 52. © ABL - The Problem Solver 52 Adding the Prisma ORM
  • 53. © ABL - The Problem Solver 53 Adding the Prisma ORM
  • 54. © ABL - The Problem Solver 54 Adding the Prisma ORM
  • 55. © ABL - The Problem Solver 55 Adding the Prisma ORM
  • 56. © ABL - The Problem Solver 56 Adding the Prisma ORM
  • 57. © ABL - The Problem Solver 57 Adding the Prisma ORM (Next.js)
  • 58. © ABL - The Problem Solver 58 Adding the database schema
  • 59. © ABL - The Problem Solver 59 Adding the database schema  Prisma database schemas  Prisma uses a schema.prisma file as a single source of truth that defines your database structure, models, and relationships in a declarative format.  This schema serves as the foundation for Prisma's code generation, allowing it to automatically create type-safe client code that matches your exact database structure.  Migrations are created in development to do schema updates  prisma migrate dev --name <migration name>  Migrations are executed in production to update the production DB  prisma migrate deploy
  • 60. © ABL - The Problem Solver 60 Adding the database schema
  • 61. © ABL - The Problem Solver 61 Adding the database schema
  • 62. © ABL - The Problem Solver 62 Seeding the database
  • 63. © ABL - The Problem Solver 63 Seeding the database  Consistent Development Environment  Database seeding ensures all developers on your team start with the same baseline data, eliminating inconsistencies that can cause bugs to appear on some machines but not others and making debugging more predictable across different development setups.  Faster Feature Development and Testing  Having realistic sample data immediately available allows developers to test user interfaces, business logic, and edge cases without manually creating test records every time they reset their local database or onboard new team members.  Automated Deployment Pipeline Integration  Seed scripts can be integrated into your CI/CD pipeline to populate staging and testing environments with known data sets, enabling automated testing scenarios and providing consistent environments for QA teams to validate features.  Realistic Data Relationships and Volume  Well-designed seed data includes proper foreign key relationships, realistic data volumes, and edge cases that mirror production scenarios, helping identify performance issues and relationship problems early in development rather than after deployment.
  • 64. © ABL - The Problem Solver 64 Seeding the database
  • 65. © ABL - The Problem Solver 65 Seeding the database
  • 66. © ABL - The Problem Solver 66 Seeding the database
  • 67. © ABL - The Problem Solver 67 Break time
  • 68. © ABL - The Problem Solver 68 Using data from the DB
  • 69. © ABL - The Problem Solver 69 Using data from the DB  Direct Database Queries in Components  Server components allow you to write Prisma database queries directly inside React components that render on the server, eliminating the need for separate API routes or data fetching layers for many common use cases like displaying lists or detail pages.  Async Component Rendering  React 19 server components can be async functions, meaning you can use await directly in component code to fetch data from Prisma before rendering, making data fetching feel more natural and reducing the complexity of managing loading states for initial page loads.  Improved Performance and SEO  Since Prisma queries execute on the server and components render with data already available, pages load faster with complete HTML content, improving SEO and eliminating the "loading spinner then content" pattern that hurts user experience and search rankings.  Reduced Client-Server Roundtrips  Server components with embedded Prisma queries eliminate the need for separate API calls after page load, reducing network requests and improving perceived performance, especially for data that doesn't need to be dynamically updated on the client.  Simplified Error Handling and Security  Database connection strings and Prisma client configuration remain server-side only, improving security while allowing you to handle database errors closer to where queries are executed rather than managing error states across API boundaries.
  • 70. © ABL - The Problem Solver 70 Server vs Client Components  Server Components by Default  In React 19 with Next.js app router, components are server components by default, meaning they render on the server during build time or request time, have access to server-side resources like databases and file systems, and cannot use browser-specific APIs or event handlers.  Client Component Declaration  To create a client component that runs in the browser, you must add the 'use client' directive at the very top of your component file before any imports, which tells React to hydrate and run this component on the client side with full interactivity.  Interactivity and State Management  Client components can use React hooks like useState, useEffect, and event handlers like onClick, while server components cannot use any interactive features, browser APIs, or state management since they only exist during server rendering.  Bundle Size and Performance Trade-offs  Server components don't add to your JavaScript bundle size since they render on the server, while client components increase bundle size and require hydration, so you should only mark components as client components when interactivity is actually needed.  Data Fetching Patterns  Server components can directly access databases, APIs, and server resources during rendering, while client components must fetch data through client-side methods like fetch() calls to API routes or external endpoints after the component mounts.  Component Composition Rules  Server components can import and render client components, but client components cannot directly import server components, though server components can be passed as props or children to client components for flexible architectures.
  • 71. © ABL - The Problem Solver 71 Using data from the DB
  • 72. © ABL - The Problem Solver 72 Adding client-side interactions and state Using Valtio - Proxy state made simple 
  • 73. © ABL - The Problem Solver 73 Adding client-side interactions and state  Proxy-Based Reactivity  Valtio uses JavaScript proxies to automatically track state mutations and re-render components only when the specific data they access changes, eliminating the need for manual dependency arrays or complex state update patterns that can cause unnecessary re- renders.  Mutable State Updates  Unlike Redux or Zustand, Valtio allows you to directly mutate state objects using familiar JavaScript syntax like state.user.name = 'John', making state updates feel natural and reducing boilerplate code while still maintaining React's reactivity principles.  Minimal Boilerplate and Learning Curve  Valtio requires very little setup code and uses intuitive APIs that feel like working with plain JavaScript objects, making it easier for developers to adopt compared to more complex state management solutions that require actions, reducers, or special update functions.  Automatic Optimization  The library automatically optimizes re-renders by tracking which properties each component accesses, so components only update when their specific data dependencies change, leading to better performance without manual optimization efforts like memoization or selector functions.  TypeScript Integration  Valtio provides excellent TypeScript support with full type inference for state objects and mutations, ensuring type safety across your application while maintaining the simple mutable API that makes the library appealing.  Flexible State Architecture  You can organize state into multiple proxy objects for different domains of your application, share state across components easily, and even subscribe to state changes outside of React components for integration with other libraries or side effects.
  • 74. © ABL - The Problem Solver 74 Adding client-side interactions and state
  • 75. © ABL - The Problem Solver 75 Adding client-side interactions and state
  • 76. © ABL - The Problem Solver 76 Adding client-side interactions and state
  • 77. © ABL - The Problem Solver 77 Adding client-side interactions and state
  • 78. © ABL - The Problem Solver 78 Comparing movies
  • 79. © ABL - The Problem Solver 79 Comparing movies  We want the user of the app to be able to compare movies  We will use Vercel V0 again to generate the page  The generated components will use generated data  We will need to hook it up with the Valtio store
  • 80. © ABL - The Problem Solver 80 Comparing movies
  • 81. © ABL - The Problem Solver 81 Comparing movies  npx shadcn@latest add "https://v0.dev/chat/b/b_jwu1vRBKFBo"
  • 82. © ABL - The Problem Solver 82 Comparing movies
  • 83. © ABL - The Problem Solver 83 Comparing movies
  • 84. © ABL - The Problem Solver 84 Comparing movies
  • 85. © ABL - The Problem Solver 85 Disabling the /compare route
  • 86. © ABL - The Problem Solver 86 Disabling the /compare route  Prevent Empty State Confusion  Disabling the compare route when no movies are selected prevents users from landing on a blank or confusing page that doesn't provide any value, eliminating the need to handle empty state UI and reducing user frustration with dead-end navigation.
  • 87. © ABL - The Problem Solver 87 Disabling the /compare route
  • 88. © ABL - The Problem Solver 88 Disabling the /compare route
  • 89. © ABL - The Problem Solver 89 Deploying the database to the cloud
  • 90. © ABL - The Problem Solver 90 Deploying the database to the cloud  Self-managed on Cloud VMs (DigitalOcean, Linode)  Provides maximum control and potentially lower costs for high-usage scenarios, but requires significant database administration expertise for maintenance, security, and optimization tasks.  Managed Cloud Services (AWS, Google, Azure)  Major cloud providers offer fully managed PostgreSQL with automated backups, patching, and scaling, but require more configuration and typically have higher costs with traditional instance-based pricing models.  Neon  Provides serverless PostgreSQL with automatic scaling, database branching for development workflows, and a generous free tier, making it ideal for modern applications that need flexible compute resources without infrastructure management.  Supabase  Combines PostgreSQL with a full backend-as-a-service platform including real-time subscriptions, authentication, and auto-generated APIs, perfect for developers who want a complete backend solution beyond just the database.  And many more  Heroku, Aiven, Exoscale, etc …
  • 91. © ABL - The Problem Solver 91 Using Neon  Serverless Architecture  Neon provides a serverless PostgreSQL platform that automatically scales compute resources up and down based on demand, eliminating the need to manage server infrastructure or worry about capacity planning.  Instant Database Creation  You can create a new PostgreSQL database in seconds through Neon's web console or CLI, with no complex setup or configuration required - just sign up and start building immediately.  Branching for Development  Neon offers Git-like database branching that allows you to create isolated database copies for development, testing, and staging environments without duplicating data storage costs.  Generous Free Tier  Neon provides a substantial free tier with 512 MB of storage and 1 compute unit, making it excellent for development projects, prototypes, and small applications without upfront costs.  Standard PostgreSQL Compatibility  Since Neon runs genuine PostgreSQL, you can use all your existing tools, extensions, and SQL knowledge without any vendor lock-in or proprietary syntax to learn.
  • 92. © ABL - The Problem Solver 92 Why Neon instead of AWS  Serverless vs. Always-On Instances  Neon automatically scales compute to zero when inactive and scales up on demand, while AWS RDS requires you to provision and pay for fixed database instances that run continuously, even during periods of no activity.  Simplified Management and Setup  Neon handles all database administration tasks through a streamlined interface, whereas AWS RDS requires configuring VPCs, security groups, parameter groups, and other infrastructure components that add complexity to deployment and maintenance.  Developer-Focused Features  Neon provides Git-like database branching for development workflows and instant database creation, while AWS RDS focuses on enterprise features like Multi-AZ deployments and read replicas that may be overkill for many applications.
  • 93. © ABL - The Problem Solver 93 Deploying the database to the cloud
  • 94. © ABL - The Problem Solver 94 Deploying the database to the cloud
  • 95. © ABL - The Problem Solver 95 Deploying the database to the cloud
  • 96. © ABL - The Problem Solver 96 Deploying the database to the cloud
  • 97. © ABL - The Problem Solver 97 Deploying the application to Vercel
  • 98. © ABL - The Problem Solver 98 Deploying the application  Next.js applications can be self hosted and deployed anywhere  Provided you have a Node.js runtime  Just do npm run build && npm start  Self hosting works well in a Docker container  Great portability and platform agnostic  Runs anywhere Docker is supported  Avoids vendor lock-in  Many providers make this even easier and better using adapters  AWS Amplify  Cloudflare  Deno Deploy  Netlify  Vercel
  • 99. © ABL - The Problem Solver 99 Deploying the application
  • 100. © ABL - The Problem Solver 100 Deploying the application to Vercel  Vercel is the company behind Next.js  A significant part of the React core team work there  They use usage-based pricing  With a with free tier  A lot of build in tooling and services  CDN for scaling  Continuous deployment based on updates to GitHub’s main branch  Automatic preview deployments with GitHub PR’s
  • 101. © ABL - The Problem Solver 101 Deploying the application to Vercel
  • 102. © ABL - The Problem Solver 102 Deploying the application to Vercel
  • 103. © ABL - The Problem Solver 103 Deploying the application to Vercel
  • 104. © ABL - The Problem Solver 104 Deploying the application to Vercel
  • 105. © ABL - The Problem Solver 105 Deploying the application
  • 106. © ABL - The Problem Solver 106 Persisting selected movies
  • 107. © ABL - The Problem Solver 107 Persisting selected movies  Automatic State Synchronization  Valtio's subscribe() function reacts to any state change in your proxy object, automatically triggering localStorage saves whenever selected movies are added or removed without requiring manual persistence calls throughout your application code.  Simple JSON Serialization Pattern  You can initialize your state from localStorage with JSON.parse(localStorage.getItem('selectedMovies')) and then use subscribe() to automatically save the entire state object with JSON.stringify(state) whenever it changes, creating a seamless two-way sync.  Minimal Setup Code  The entire persistence setup takes just a few lines of code - create your proxy state with initial localStorage data, then add one subscribe() call that handles all future saves automatically, eliminating complex persistence logic scattered throughout your components.  Real-time Persistence  Since subscribe() triggers on every state mutation, your selected movies are immediately saved to localStorage as soon as users select or deselect them, ensuring no data loss even if the browser crashes or the user accidentally closes the tab.  Zero Component Coupling  The persistence logic lives entirely outside your React components, so you can add, remove, or modify selected movies from any component without worrying about remembering to save the state - the subscribe() function handles it automatically in the background.
  • 108. © ABL - The Problem Solver 108 Persisting selected movies
  • 109. © ABL - The Problem Solver 109 Conclusion  Next.js is a great React application framework  Creating a new Next.js application is easy  Using Vercel V0 can speed development a lot  Docker is great for development purposes  Not just for deployment to production  The Prisma ORM makes database access really easy  React sever component makes using server data much easier  React client components make client-side state easier  Vercel is a great hosting platform  But not a requirement
  • 110. © ABL - The Problem Solver 110 Thank you for joining Share your thoughts

Editor's Notes

  • #10: https://bit.ly/487wSyx
  • #54: DATABASE_URL="postgresql://postgres:postgres@localhost:54323/postgres?schema=public"