Skip to content

Commit 9f16703

Browse files
Merge pull request #228 from HackYourFuture-CPH/feat/react-week5
Add content to week 5 of React module
2 parents 9e7f54e + 4f38292 commit 9f16703

File tree

4 files changed

+70
-17
lines changed

4 files changed

+70
-17
lines changed

SUMMARY.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,26 @@
101101
- [Session Plan](courses/frontend/advanced-javascript/week4/session-plan.md)
102102
- [Assignment](courses/frontend/advanced-javascript/week4/assignment.md)
103103
- [React](courses/frontend/react/README.md)
104+
- [Week 1](courses/frontend/react/week1/README.md)
105+
- [Preparation](courses/frontend/react/week1/preparation.md)
106+
- [Session Plan](courses/frontend/react/week1/session-plan.md)
107+
- [Assignment](courses/frontend/react/week1/assignment.md)
108+
- [Week 2](courses/frontend/react/week2/README.md)
109+
- [Preparation](courses/frontend/react/week2/preparation.md)
110+
- [Session Plan](courses/frontend/react/week2/session-plan.md)
111+
- [Assignment](courses/frontend/react/week2/assignment.md)
112+
- [Week 3](courses/frontend/react/week3/README.md)
113+
- [Preparation](courses/frontend/react/week3/preparation.md)
114+
- [Session Plan](courses/frontend/react/week3/session-plan.md)
115+
- [Assignment](courses/frontend/react/week3/assignment.md)
116+
- [Week 4](courses/frontend/react/week4/README.md)
117+
- [Preparation](courses/frontend/react/week4/preparation.md)
118+
- [Session Plan](courses/frontend/react/week4/session-plan.md)
119+
- [Assignment](courses/frontend/react/week4/assignment.md)
120+
- [Week 5](courses/frontend/react/week5/README.md)
121+
- [Preparation](courses/frontend/react/week5/preparation.md)
122+
- [Session Plan](courses/frontend/react/week5/session-plan.md)
123+
- [Assignment](courses/frontend/react/week5/assignment.md)
104124
- [Final Frontend Project](courses/frontend/final-project/README.md)
105125

106126
- [Backend](courses/backend/README.md)

courses/frontend/react/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
In this class, trainees will learn how to use [React](https://react.dev/) to build web applications
44

5-
| Week | Topic | Preparation | Homework | Lesson plan |
6-
| ---- | --------------------------------------------------- | ------------------------------------- | ----------------------------------- | ------------------------------------- |
7-
| 1. | [Rendering a Single Component](./week1/README.md) | [Preparation](./week1/preparation.md) | [Assignment](./week1/assignment.md) | [Session plan](week1/session-plan.md) |
8-
| 2. | [Understanding State Management](./week2/README.md) | [Preparation](./week2/preparation.md) | [Assignment](./week2/assignment.md) | [Session plan](week2/session-plan.md) |
9-
| 3. | [Hooks and Fetching Data](./week3/README.md) | [Preparation](./week3/preparation.md) | [Assignment](./week3/assignment.md) | [Session plan](week3/session-plan.md) |
10-
| 4. | [Context, Routing & Libraries](./week4/README.md) | [Preparation](./week4/preparation.md) | [Assignment](./week4/assignment.md) | [Session plan](week4/session-plan.md) |
11-
| 5. | [Hello Next.js & Vercel](./week5/README.md) | [Preparation](./week5/preparation.md) | [Assignment](./week5/assignment.md) | [Session plan](week5/session-plan.md) |
5+
| Week | Topic | Preparation | Homework | Session plan |
6+
| ---- | --------------------------------------------------- | ------------------------------------- | ----------------------------------- | --------------------------------------- |
7+
| 1. | [Rendering a Single Component](./week1/README.md) | [Preparation](./week1/preparation.md) | [Assignment](./week1/assignment.md) | [Session plan](./week1/session-plan.md) |
8+
| 2. | [Understanding State Management](./week2/README.md) | [Preparation](./week2/preparation.md) | [Assignment](./week2/assignment.md) | [Session plan](./week2/session-plan.md) |
9+
| 3. | [Hooks and Fetching Data](./week3/README.md) | [Preparation](./week3/preparation.md) | [Assignment](./week3/assignment.md) | [Session plan](./week3/session-plan.md) |
10+
| 4. | [Context, Routing & Libraries](./week4/README.md) | [Preparation](./week4/preparation.md) | [Assignment](./week4/assignment.md) | [Session plan](./week4/session-plan.md) |
11+
| 5. | [Hello Next.js & Vercel](./week5/README.md) | [Preparation](./week5/preparation.md) | [Assignment](./week5/assignment.md) | [Session plan](./week5/session-plan.md) |
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Assignment
22

3-
TODO: Proposal: Verify if this would be ok?
4-
5-
- Deploy a Next.js app in which you cover the exercises from Week 5 to Vercel
3+
- Deploy a Next.js app, in which you cover the exercises from Week 5, to Vercel
64
- Make sure you push to a new GitHub repository and that it is public
75
- Connect the repository to Vercel and fix any potential deployment issues
86
- Share the working deployment URL in the team Slack channel

courses/frontend/react/week5/session-plan.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
- Discuss when to use SSR (dynamic data, personalization, etc.)
1919
- Discuss when to use SSG (static content, blogs, documentation, etc.)
2020

21+
#### Server Components for SSR
22+
23+
- Explain how [Server Components](https://react.dev/reference/rsc/server-components) can speed up load times by directly sending HTML to the browser
24+
- Introduce the `"use server"` directive, allowing React components to be rendered on the server
25+
2126
### When to Use Client vs. Server Components?
2227

23-
- Explain how Next.js distinguishes client and server components
28+
- Re-iterate how Next.js distinguishes client and server components (`"use server"` and `"use client"`)
2429
- Illustrate how these fit into the SSR and SSG concepts
2530

2631
### Introduction to Next.js App Router
@@ -64,23 +69,53 @@
6469
- Explain how to access various router properties (push, replace, etc.)
6570
- Demonstrate programmatic navigation using `router.push` and `router.replace`
6671

67-
### Optional Advanced: Server Functions (or Server Actions) & API Routes
72+
### Advanced: Server Functions & API Routes
73+
74+
#### Server Functions
75+
76+
- Explain Server Functions _(previously "Server Actions")_ as a mechanism to run JavaScript code on the server that hosts the website
77+
- Discuss how this is different from running JavaScript in the user's browser
78+
- Reference [the React docs for Server Functions](https://react.dev/reference/rsc/server-functions) demonstrating how to use them
79+
80+
#### Server Components
81+
82+
- Discuss how Server Components allow the use of Server Functions inside the component
83+
- Explain that client components can use Server Functions by importing them from a file with the `"use server"` directive
6884

69-
TODO: …
85+
#### Server Actions
86+
87+
- Introduce "Server Actions" as a specific type of Server Function
88+
- Provide context by mentioning plain old `<form>`s on the internet that can be sent to a server for processing (we could call them "server functions"!)
89+
- Explain how attaching a Server _Function_ to a (form) `action` makes it a Server _Action_
90+
91+
#### API Routes
92+
93+
- Explain how Next.js supports Server Actions and Server Components as React features
94+
- Introduce API routes as a concept from the backend side of web development
95+
- Provide an overview of [Route Handlers](https://nextjs.org/docs/app/getting-started/route-handlers) and how they allow to create an API route that returns JSON
96+
- [_(The concept of APIs is covered in detail in the backend specialization)_](/courses/backend/node/README.md)
7097

7198
## Vercel
7299

73100
### Introducing Vercel & Good Use Cases
74101

75-
TODO: …
102+
- Introduce Vercel as the company behind Next.js, as well as a provider of cloud infrastructure
103+
- Explain how Vercel's hosting options allow developers to host Next.js applications with very little effort
104+
- Highlight that hosting on Vercel is a good fit for a prototype or portfolio website built with React and/or Next.js
76105

77106
### Connecting a GitHub Repository With Vercel
78107

79-
TODO: …
108+
- Demonstrate in the browser how a **public** GitHub repository from ones account can be connected to Vercel and deployed with the click of a button
109+
- Illustrate one way to get started with Vercel by installing the Vercel CLI globally `npm -g vercel`
110+
- Show logging in to Vercel using `vercel login` and using ones GitHub account
111+
- Show how one can deploy a local folder with a Next.js app using the `vercel deploy` CLI command
80112

81113
### Limitations of Vercel
82114

83-
TODO: …
115+
- Mention that Vercel probably works best for hosting Next.js applications or static websites
116+
- Discuss how other frameworks are supported, but that the focus is likely on Next.js
117+
- Mention that knowledge about DNS, domains, npm, dependencies etc. is not required, but useful when managing a site on Vercel
118+
- Highlight that Vercel is well-suited for production applications, but that prices can apparently vary a lot based on usage
84119

85120
## Exercises
86121

@@ -151,7 +186,7 @@ TODO: …
151186
- Does it show the time?
152187
- [Refer to the docs when in doubt](https://nextjs.org/docs/app/getting-started/updating-data#creating-server-functions)
153188

154-
#### API Routes
189+
#### Trying out API Routes
155190

156191
- Create a Hello World API route at `/api/hello` that returns the following JSON
157192

0 commit comments

Comments
 (0)