Introduction

2 lessons

The Era of Single-Page Applications

Introduction to Guide to Angular Universal

INTRODUCTION

Course prerequisites

This lesson answers the questions "What do I need to accomplish the course?" "What software is needed?" "What should I know about Angular and other technologies?" "What should I do to accomplish the course offline?"

INTRODUCTION

Building the app

9 lessons 12m total

Application Overview

Introduction to Newline guide to building a React App with MobX State Tree

INTRODUCTION

0:42 minutes

Project Setup

Setup the base project for our Hooks deep dive examples.

LESSON

11:45 minutes

Building the backend

In this lesson you will prepare the application backend an entry gate for communicating with persistance layer and hosting Angular application bundle.

LESSON

Setting up MongoDB

Every application needs a persistence layer. This lesson will show you how to enroll for free Atlas cloud MongoDB instance. You will also feed your database with data.

LESSON

Building the API - querying products

Once the database is set up and ready, you need to establish a connection with it. That's what you're going to do in this part of the course. Apart of that you will create backend API to get list of products and their descriptions.

LESSON

Building the API - user interaction

We're building software for people, and we need to give them a way to communicate with it. This lesson will show you how to prepare an API for user interaction like loging in and adding products to list of favorites. Moreover you will be introduced to the security essentials like cookies encryption and password hashing.

LESSON

User Authentication

When the backend is ready, it's time for frontend. In this lesson you will integrate user API with Angular. You will implement the user authentication flow.

LESSON

Building the Products Service

Our application would be nothing without the data. In this course part you will display products images, description and prices in your Angular application.

LESSON

Deploying and Measuring Performance

Every journey has some end. At the end of software development is production. It's time to deploy your application to Heroku and test with multiple tools how it performs.

LESSON

Applying Angular Universal

8 lessons

Angular Universal

In the previous module, you've built a fully functional production-ready application. Unfortunately, like other single-page applications, this application has its weaknesses. In this module, you will learn how to address one of them and render HTML content on the server.

LESSON

Applying Universal Schematics

The easiest way to enhance your Angular project with new functionalities is to use Schematics - a set of instruction for CLI on how to change the project and install new dependencies. Let's do that with Angular Universal and review what Schematics did for us.

LESSON

Measuring Performance

Once the application is said to be SEO friendly and performance optimized by schemtaics - let's check that in battlefield. In this lesson you will deploy your project to Heroku and measure its performance.

LESSON

Adding Internationalization with SSR - The Browser Is Not The Server

Unfortunately, schematics are not a magic wand and they won't solve all of your problems. Sometimes your project needs to be adjusted to do not break Server-Side Rendering process. Here's what might go wrong, and how to address that.

LESSON

Robots and Sitemap

In this lesson, you will add even more for SEO. Your application deserves robots.txt and proper sitemap.

LESSON

SEO

Next step in SEO is to set up meta-tags. If you want to know how to do it in Angular, this lesson will help you to find the answer.

LESSON

Noscript

In this lesson, you can see how Angular Universal helps when your user's browser doesn't support JavaScript

LESSON

Summary

This lesson summarize what you've learned in this module; SEO & SSR

LESSON

Browser vs. Server

6 lessons

Using Secrets with Angular Universal

In this course module, you will learn how to pass objects and function references from Node.js to Angular Universal sandbox. You will build a service that will be used to connect with MongoDB and perform queries. You will also gain knowledge on how to prepare a server-equivalent of services used in browser-side Angular; and how to improve your application performance thanks to them. You will also make your application fully functional for users with disabled JavaScript.

LESSON

Querying the Database from Angular

One of possible improvements is to perform queries against MongoDB directly from Angular Universal. In this lesson you will create a service which does this job.

LESSON

Server-Specific Service

Once your MongoService is in place, you need to prepare a server-equivalent of ProductsService. This service will query MongoService for products list and descriptions and embed those in the HTML rendered by Angular Universal.

LESSON

Working With Cookies in Angular

Next step is to create a server-equivalent of service responsible for user interactions. This lesson will show you how to read HTTP requests in Angular, get cookies from it and decrypt them.

LESSON

Noscript

Once you know how to read cookies in the Angular Universal app, it's time to learn how to set them up. In this lesson, you will make your application fully functional for users whose browser doesn't support JavaScript at all.

LESSON

Summary

In this module, you've learned an advanced technique of preparing code that is specific to the server runtime. That's a crucial skill when you are creating a search engine optimized Angular application. You can now avoid keeping all logic in one bundle and decrease the size of the browser bundle. Moreover you've made your application fully functional for users with disabled JavaScript.

LESSON

Transfering data between server and browser

5 lessons

Module Overview

Does it make sense to request products list from the back-end when it's already included in redered view? In this module, you will add a mechanism that embeds the data retrieved during rendering into the application bundle. As a result, the application initialized in the browser will use that data instead of querying the backend.

LESSON

Introducing TransferState

Say Hello to TransferState, a key-value registry that is passed along with the application bundle, from the server-side angular to the browser-side part of the application. In this lesson you will learn how frontend can get to know what backend has already do (ie retrieving data from DB); thanks to that you can avoid repeating those steps and offload your application backend.

LESSON

TransferHttpCacheModule

Next step is to get know a TransferHttpCacheModule, which provides the TransferState functionality "out of the box" for the HTTP calls.

LESSON

Handling long-running API calls

Long running API calls can affect your application rendering time, that might lead to the SEO disaster. In this lesson you will learn how you can protect your application against such situation.

LESSON

Summary

In this module, you've learned how to pass data between the server and the browser using the `TransferState` registry. You've also introduced `TransferHttpCacheModule` that passes data obtained via HTTP during server-side rendering to the browser. You've learned how to abandon long-running REST API calls that affect rendering performance.

LESSON

Caching with Redis

5 lessons

Module Overview

Wanna be a performance beast? It's time to cache! In this module, you will use the Redis database to implement server-side caching and improve Time To First Byte. From now on, only selected requests will trigger the rendering process. The rendered output will be kept in Redis for a specified period of time. Subsequent requests will be served with data retrieved from Redis.

LESSON

Installing Redis

First things first. Let's install the Redis DB on your machine and provision it in the Heroku environment.

LESSON

Redis middleware

In this lesson you will create a Node.JS middle-ware, that will be responsible for caching rendered views inside Redis database.

LESSON

Tuning the application

Faster! Faster! Faster! In this lesson you will enable gzip compression, defer the CSS, lazy-load images and more. All to make it faster!

LESSON

Summary

After fishing this module, your application will gain up to 95 points in the PageInsights speed audit. You've learned how to apply server-side caching to avoid redundant rendering and serve the client with content from the Redis database. You've also applied a few techniques to improve your application's performance.

LESSON

Testing

7 lessons

Module Overview

Testing an Angular Universal application can be tricky. In this module, you will learn how to create tests that are specific to Angular Universal applications.

LESSON

Unit Tests - Stubbing PLATFORM_ID

How to verify your application behavior in different environments? In this lesson you will get to know how you can stub the PLATFORM_ID injection token and HTTP request, for tests purpose.

LESSON

Unit Tests - long-running API calls

Next step is to simulate a long-running API and verify how server-side Angular deals with it. This lesson will demonstrate you how to do that.

LESSON

Unit Tests - server-specific services

Last but not least of your unit tests, should be to verify the server-specific services. In this lesson you will learn how to enforce Karma to run tests against code that includes server-specific objects and libraries.

LESSON

E2E - testing TransferState

In this lesson you will learn how you can verify the TransferState registry content in your E2E tests.

LESSON

E2E - Mocking MongoDB

This lesson is going to show you how to mock your data-source - MongoDB - for the E2E tests purpose. Thanks to using mongo-unit you will be able to perform actions that changes data in your DB, during E2E testing.

LESSON

Summary

In this course module, you've learned how to test your Angular Universal application. You've written both unit tests and end-to-end tests.

LESSON

Prerendering

3 lessons

Module Overview

In this module, you'll learn how to adjust the Angular application to be pre-renderable. Such prepared application can be deployed on static hosting like GitHub pages and still be SEO friendly! You will feed your application with data retrieved from MongoDB during the prerendering process.

LESSON

Prerendering Angular application

What is prerendering and how Angular Universal supports it? This lesson will answer that questio and show you what steps you need to take, to make your application prerenderable.

LESSON

Summary

After finishing this module, you will know how prerendering works, how to prepare backend for prerendered Angular application and how to utilize MongoDB connection during prerendering process.

LESSON

Summary

1 lesson

Comparing --prod Universal & Prerender

That was a bumpy ride, but definetely worth it. In this lesson we will summarize what you've learned so far and how ng --prod differentiate from Universal and Prerendered application.

LESSON