Book Image

Next.js Quick Start Guide

By : Kirill Konshin
Book Image

Next.js Quick Start Guide

By: Kirill Konshin

Overview of this book

Next.js is a powerful addition to the ever-growing and dynamic JavaScript world. Built on top of React, Webpack, and Babel, it is a minimalistic framework for server-rendered universal JavaScript applications. This book will show you the best practices for building sites using Next. js, enabling you to build SEO-friendly and superfast websites. This book will guide you from building a simple single page app to a scalable and reliable client-server infrastructure. You will explore code sharing between client and server, universal modules, and server-side rendering. The book will take you through the core Next.js concepts that everyone is talking about – hot reloading, code splitting, routing, server rendering, transpilation, CSS isolation, and more. You will learn ways of implementing them in order to create your own universal JavaScript application. You will walk through the building and deployment stages of your applications with the JSON API,customizing the confguration, error handling,data fetching, deploying to production, and authentication.
Table of Contents (9 chapters)

Setting up CI for Next.js: Travis, Gitlab, and so on

Running tests on a local dev machine is fun, but things happen. You may forget to run a test before commit (in the next chapter, you will learn how to prevent this), or any of your team members can accidentally break something. In order to make sure everything works, you need some centralized source of truth. This source of truth could be a TravisCI server, which is free for open source projects. For private projects, there is another free solution, which we will cover too.

First, register or log in to

You will have to enter your GitHub credentials in order to proceed, then once you have logged in, go to your profile page and flick the switch next to your repository:

If there are no repositories, just click Sync Account to reload them.

You may want to set up some environment variables for the build;...