Skip to content

anderslatif/Kea_DAT_Node.js_2024_Spring

Repository files navigation

Full Stack Node.js Semester Plan

About the course

Semester Plan

Title Date Description Learning Goals Resources and Activities

01. Introduction

Feb. 2nd

  • Intro to the course. Information about the mandatories / exam. Expectations.

  • Intro to Node.js.

  • Variables, data types

  • Intro Exercises.

  • REST API conventions

  • Code conventions / Clean Code

  • Can work with Git in the terminal.

  • Understand and work with data types in Javascript.

  • Can explain what Node.js is and how to run files with it.

  • Knows the existing data types in Javascript and can work with them.

  • Understands type coercion and strategies to avoid it.

  • Can design a REST API.

  • Knows the three REST conventions: 1. Using the right HTTP verb, 2. Ordering, 3. Naming (noun, plural) that maps to collections in your system.

02. First Server

Feb. 9th

  • Code conventions / Clean Code (Strict Mode - ESLint)

  • Variables and Functions

  • Callback functions

  • Package.json

  • Express

  • Sending data with GET requests

  • Understand scoping in Javascript and know to always use const if you can get away with it otherwise let.

  • Understand advanced things about functions in Javascript

  • Can write callback functions with different syntax.

  • Understands package.json and can set it up by hand.

  • Can create a server instance with Express from memory.

  • Understands how to send data with GET requests over HTTP and knows how to do it in Express.

  • Understands node_modules.

03. Serving HTML Files

Feb. 16th

  • Nodemon

  • Loops and loop methods in JS.

  • CRUDable REST API - Part I

  • Anatomy of an URL

  • Serving HTML in Express.

  • Understands the use case for Nodemon and its limitation for development.

  • Can use loop methods (+map, +filter, %reduce). Can choose the right one at the appropriate time: We wish to use loop methods and in a functional manner (avoiding side effects). for loops are for finger counting.

  • Understands why a functional approach to loops is to be preferred and how to implement it without side effects.

  • Can use the right terminology when it comes to the different parts of an URL.

  • Can make a POST request and handle it in Express.

  • Understands the need for body parsing and how to do it in Express.

04. Time

Feb. 23rd

  • CRUDable REST API - Part II

  • Time

  • Deployment

  • Fetch

  • Can create a full CRUDable REST API that follows conventions.

  • Can get the Date in Javascript.

  • Can write a fetch request without hesitation.

5. Export / Import

Mar. 1st

  • Exporting vs. importing in frontend (type="module" attribute).

  • Commonjs vs. type module in Node.js

  • Serving static in Express.

  • Fetching in the client vs. fetching in the backend

  • Structuring HTML with semantic HTML (header, main, footer).

  • Can work with both types of import/export in HTML.

  • Can import/export in both ways in Node.js

  • Understands the security need for serving static files and can do it in Express.

  • Can argue for a better way to structure the frontend (assets, pages) and how to structure HTML.

05. Server-side vs. Client-side / Server-side Rendering (SSR)

Mar. 8th

  • Client-side redirection vs. server-side redirection.

  • Server-side rendering vs. client-side rendering.

  • Reading files.

  • Nodemon ext.

  • Understands the difference between client-side redirection and server-side.

  • Can recount the number of ways and approaches to redirection.

  • Understands how code and its placement affects application memory and efficiency.

  • Understands the arguments for and against SSR vs. CSR when it comes to:

    1. Load time.

    2. Ressources spent (duration, when and where).

    3. SEO.

    4. Dealing with CORS. (SSR has no CORS issues.)

06. Asynchronous Code / Routers

Mar. 15th

  • Linting

  • Debugging

  • Nodemon ext.

  • Asynchronous code in JS.

  • Routers (Express).

  • While using a linter is not a requirement, having clean code is.

  • Can work with promises, async/await. Understand why asynchronous code is relevant in Node.js.

  • Can create an Express Router by heart.

07. Environment Variables / Forms / First Svelte Project

Mar. 22nd

  • Environment Variables

  • Forms

  • First Svelte Project

  • Can define and run package.json scripts

  • Know how to define environment variables natively in Node.js.

  • Understand how forms work.

  • Can create a Svelte project from scratch with npm create vite.

  • Understands the structure of a Svelte project and can explain it what each file does.

Holiday

08. Svelte Family

Apr. 5th

  • Passing data between components.

  • Svelte stores

  • Understand the tree structure of web frameworks (parent/child).

  • Fully understand the different ways to pass data in Svelte. Can code it too.

09. Client-side Routing / Middleware

Apr. 12th

  • Client Routing (Svelte Navigator)

  • Writing custom middleware in Express.

  • Rate-limiter

  • Express session

  • XSS

  • Dotenv

  • Understand and can set up client routing in a web framework.

  • Understands how middleware works in Express, why order matters and how to use it to your advantage.

  • Can use a rate-limiter.

  • Understands how server sessions work.

  • Understand the dangers of XSS and how to prevent it in frontend (avoiding innnerHTML) and backend (sanitizing).

  • Understands the role of Dotenv.

  • Can argue about the pros and cons of JWT vs. session.

Mandatory II: Make a choice between JWT or sessions. Either way, you should be informed of the pros and cons of each choice. Create the backend and setup the relevant middleware. Add security to the backend.

10. Full stack

Apr. 19th

  • Client-side routing (Svelte Navigator)

  • Full stack

  • CORS

  • Understand and can set up client routing in a web framework.

  • Can use fetch in Svelte with onMount (to avoid a reactive loop).

  • Understands why CORS exists and the situations that trigger it.

  • Understand when it’s CSR and when it’s SSR and the pros and cons in relation to CORS and session id.

  • Can solve CORS issues in Express.

  • Know how to SSR Svelte from Express.

Mandatory II: Setup the full stack project, create routing in the frontend and setup protected routes. Create fetches between the frontend and backend. Keep the data in memory in the backend for now.

11. SQL

Apr. 26th

  • Sqlite

  • SQL

  • DDL / DML

  • MySQL

  • Understands the difference between DDL and DML.

  • Can come up with a way to define DDL on a relational database.

  • Understands why seed a database.

Mandatory II: Finish the mandatory.

I recommend that you watch this multiple times: Video: Database Paradigms

11. MongoDB

May 3rd

  • Databases paradigms

  • Mongodb vs. relational.

  • MongoDB in shell.

  • MongoDB in Node.js

  • MongoDB in cloud (Atlas)

  • Knows different database paradigms.

  • Can argue in what cases Mongodb excels and when it is the right choice.

  • Can contrast and compare relational databases and Mongodb.

  • Understands the moving part of Mongodb (database, shell, driver).

  • Can do basic CRUD with MongoDB by heart.

  • Can use MongoDB in Node.js given a code snippet for how to set it up.