Name | Progress |
---|---|
Introduction | Not Read |
๐ฐ Player | Not Read |
Name | Progress |
---|---|
Software Installation | Not Read |
Project Setup | Not Read |
Running and Testing | Not Read |
React and ReactDOM | Not Read |
๐ก Assignment 1: Welcome Message | Not Attempted |
Submissions | Not Read |
Name | Progress |
---|---|
JSX and Components | Not Read |
Props | Not Read |
๐พ Exercise: Props | Not Attempted |
CSS Styles | Not Read |
useState and Hooks | Not Read |
๐พ Exercise: useState | Not Attempted |
Conditional Rendering | Not Read |
Lists | Not Read |
๐พ Exercise: Lists | Not Attempted |
Forms and Events | Not Read |
๐พ Exercise: Forms | Not Attempted |
๐ก Assignment 2: Front End | Not Attempted |
Name | Progress |
---|---|
Pure Components - memo | Not Read |
Lifecycle - useEffect | Not Read |
Expensive? - useMemo | Not Read |
DOM Interactions - useRef | Not Read |
forwardRef | Not Read |
useImperativeHandle | Not Read |
๐พ useImperativeHandle | Not Attempted |
Context | Not Read |
useCallback | Not Read |
useId | Not Read |
useReducer | Not Read |
Name | Progress |
---|---|
APIs | Not Read |
APIs - Slides | Not Attempted |
Rest APIs | Not Read |
Rest APIs - Express.js | Not Read |
ReastAPIs - Next.js | Not Read |
Securing APIs | Not Read |
Securing APIs - NextAuth | Not Read |
Name | Progress |
---|---|
tRPC | Not Read |
tRPC - Routers | Not Read |
tRPC - Server Rendering | Not Read |
tRPC - Client Rendering | Not Read |
Persisting Data | Not Read |
Assignment 3: APIs | Not Read |
It is time to set up your assignment. Here, we will use the information from the previous two chapters to set-up your applications database and authentication.
https://classroom.github.com/a/i1Qk76el
The application fails to initialise telling you that you have โ Invalid environment variables
The definition of compulsory environment variables is stored in /src/env.js file. Check it out!
Try running pnpm dev, your application should now start!
We need to prepare the user model and create the new task model to handle the application data. Please open schema.prisma file in your opened project and modify the User model to look as the folliowing:
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? // @db.Text
access_token String? // @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? // @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}
Also add the following two new model at the end of the schema file:
enum Status {
COMPLETED
ACTIVE
}
model Task {
id Int @id @default(autoincrement())
description String
completed Boolean
userId String
user User @relation(fields: [userId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
add the new โTaskโ model from above. If you can not find the file use โCTRL+Pโ or โCMD+Pโ shortcut to search for this file. Once you are done, you are ready to load these changes to your database. Please run the following command in the terminal in your project folder:
pnpm db:push
In the terminal window, you should see the following message: โYour database is now in sync with your schema.โ
Could you try opening your database in a database client to see these changes? Database clients are visual tools that allow you to see your data, manipulate it, and administer your whole database server. Concerning database clients, there are many options, let's mention a few:
Whichever option you choose is up to you, but have one database client ready to check out your data at any time! Let's get back to Prisma!
Let's set up the authentication. It's easy as 1-2-3!