Course Content
Next.js 14 Mastery for Building Modern Web Apps
Next.js 14 Mastery for Building Modern Web Apps
1. Introduction to Next.js
2. Setting Up a Next.js Project
Setting Up the Next.js Project Understanding the Project File and Folder StructureStyling Approaches in Next.jsAdding the Global CSS FileUsing Tailwind CSS for StylingWorking with CSS ModulesApplying Styles ConditionallyAdding Custom Google FontsChallenge: Implementing a Custom Google FontHandling Images in Next.js
3. Building Pages and Layouts in Next.js
4. Deploying a Next.js App and Setting Up a Database
5. Fetching and Displaying Data in Next.js
6. Advanced Next.js Features and Optimizations
7. Implementing Authentication in Next.js
Understanding AuthenticationSetting Up the Login RouteUsing NextAuth.js for AuthenticationConfiguring Authentication and Protecting RoutesHashing Passwords and Managing CredentialsImplementing Sign-In FunctionalityConnecting the UI with Authentication LogicImplementing Logout FunctionalityFinal Thoughts and Next Steps
Setting Up a Project Database
For this project, we will use the Postgres database. Let's see how to set it up on Vercel.
Instructions
- Click "Continue to Dashboard";
- Choose "Storage" from the header tabs;
- Create "Postgres (Serverless SQL)";
- Accept the terms and conditions;
- Name the database and click "Create and Continue";
- Click the "Connect" button.
After creating and connecting the database, we must set it up and populate it with data to work with.
Instructions
- Visit the ".env.local" tab;
- Ensure you have all the necessary data:
POSTGRES_URL
;POSTGRES_PRISMA_URL
;POSTGRES_URL_NON_POOLING
;POSTGRES_USER
;POSTGRES_HOST
;POSTGRES_PASSWORD
;POSTGRES_DATABASE
.
- Copy all the data and navigate to the project;
- Find the
.env.example
file in the project root. Rename it to.env
; - Paste the copied data from Vercel;
- Finally, open the terminal and run
npm i @vercel/postgres
to install Vercel Postgres.
The last step left is to populate the database with data. Let's focus on it in the following chapter.
In Practice
Everything was clear?
Thanks for your feedback!
Section 4. Chapter 3