Tiny URL with Next.js
- Data ownership
- Analytics tracking
- Branding (e.g. no Bitly or other services)
- Cost Savings
- React.js frontend and server-side rendering ➡️ Next.js is a React.js framework that handles front-end and backend
- Vercel for Deployment ➡️ modern and easy deployments direct from GitHub/Bitbucket
- Neon is Modern Serverless PostgreSQL ➡️ a fast Vercel-ready Edge-ready database with sub 40ms queries!
- Edge functions for speed/performance ➡️ Server-side components that are fast and serverless!
- DrizzleORM for handling SQL with JavaScript ➡️ Writing SQL can be tricky; Drizzle makes it easier
- URL Shortening ➡️ A practical way to share and track links (this is what we build)
- Tailwind CSS & Flowbite for the User Interface ➡️ Easily one of the best ways to style frontends
- Users and sessions with custom built login, password hashing, registration, encrypted JWT sessions and more.
Resources
Lessons
Welcome
2:13
Walkthrough
7:41
Requirements
5:25
Start a Nextjs App
4:36
URL Routing in Nextjs
5:45
Handling API Routes and HTTP Methods
3:45
Dynamic URL Routes
6:15
Fetch data via Nextjs
7:24
Handling Fetch Errors in Nextjs
5:43
Pushing to Github with Git
7:54
Your First Nextjs Deploy to Vercel
5:55
Environment Variables for Vercel Domains
8:51
Fetch and Caching in Server Componets
6:51
Render React Client Component in Server Component
5:49
Client Side Fetching with swr
4:52
HTML Forms and Post Data Requests
10:42
Handling POST Data in a Nextjs Route
4:45
Validate Submitted URL For Shortening
4:15
Hello World from Neon Serverless
10:07
Edge Functions for Neon Database Connection
5:05
Create a SQL Table in the Neon Console
7:03
Your First Drizzle Table Schema
4:55
Create SQL from JavaScript with Drizzle
8:00
Create Data with Drizzle and Neon
4:00
Get Lists of Data with Drizzle and Neon
8:30
Refreshing Table Data as a Client Component
4:46
Refreshing Table based on Form Event
3:44
Storing Random Short Strings
3:16
Short Value DB Lookup
5:15
Customize the Nextjs 404 Page
2:46
Redirect to the Destination URL
3:15
Ensure Unique URLs with a SQL Index
4:13
Handling Database-level Errors with Unique Values
6:53
Visits Tracking Related Table
6:32
Track and Store Visits
8:16
Database Lookups with Related Data
7:48
Encypted JWT for Session Data
11:44
Using Cookies with Encoded JWTs
7:48
Adding the Users Table
9:26
Password Field & Hashing Functions
9:39
Register & Login Pages
5:56
Register and Save New Users in the Database
13:22
Login Users and Set User Session
9:14
List User-only Data
2:11
Logout Users
5:20
Fixing Node.js Crypto Issues for Vercel Deployment
9:03
Flowbite Integration & Form Alerts
11:28
Improved UI with Flowbite-React
28:36
Custom Domain Name on Vercel
5:10
Thank you and next steps
0:49