paint-brush
Build a Next.js Website in 4 Stepsby@carsoncgibbons
4,756 reads
4,756 reads

Build a Next.js Website in 4 Steps

by Carson GibbonsDecember 6th, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In this blog I will show you how to pick up an existing website example and curtail it into your own, beautiful Next.js website for publishing content and easy updates. This <a href="https://cosmicjs.com/apps/nextjs-website" target="_blank">React Universal Website</a> is built using the <a href="https://github.com/zeit/next.js" target="_blank">Next.js framework</a>. Code is shared between the client and server making development a breeze. Add Cosmic JS-powered content and you’re taking your website to the Next.js level.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Build a Next.js Website in 4 Steps
Carson Gibbons HackerNoon profile picture

Carson Gibbons is the Co-Founder & CMO of Cosmic JS, an API-first Cloud-based Content Management Platform that decouples content from code, allowing devs to build slick apps and websites in any programming language they want.

In this blog I will show you how to pick up an existing website example and curtail it into your own, beautiful Next.js website for publishing content and easy updates. This React Universal Website is built using the Next.js framework. Code is shared between the client and server making development a breeze. Add Cosmic JS-powered content and you’re taking your website to the Next.js level.

Next.js is an amazing new addition to the React open-source ecosystem. It is “a minimalistic framework for universal server-rendered React applications” that makes the process of building these types of applications much faster and easier.

If you haven’t already, get started by Signing Up for Cosmic JS. Helpful resources are provided below to streamline your development operations.

1. CREATE A NEW BUCKET

Your bucket’s name is the name of your website, project, client or web application that you are building.

2. INSTALL THE NEXT.JS APP

Once you’ve signed up and named your bucket, you’ll be prompted to start from scratch or “see some apps”. For this blog I simply clicked the right button to “see some apps” so that I could begin the installation process for the Next.js Website.

APP INSTALLATION OPTIONS

Cosmic JS gives you the ability to filter between programming languages such as Node.js, PHP, React, AngularJS and more. Simply click “Install” underneath the Next.js Website icon to get started, or visit the Cosmic JS Apps Page.

3. DEPLOY TO WEB

I clicked “Deploy to Web”. I can then start editing my Global Objects, Object Types and Pages while my web application is deploying. You will receive an email confirming the deployment of your web application. If you encounter any issues during deployment, you may be routed to the Cosmic JS Troubleshooting Page.

CONFIRM DEPLOY LOCATION AND BRANCH

I’m drawing from a repo, my branch is clarified and I have a deployed location that matches my slug / bucket name that I made in Step 1.

DEPLOY, DEPLOY AWAY

A little reassurance that you’ll soon be up, alive and well on the web. :)

4. EDIT GLOBAL OBJECTS, OBJECT TYPES AND OBJECTS

Editing is a dream come true in the Cosmic JS Dashboard. To read more about how Cosmic JS was built with editing content in mind, read Building With the Content Editor in Mind.

APP DEPLOYMENT CONFIRMATION

It’s as easy as sign up, create new bucket, install web application, edit content and deploy! I get my confirmation email to access my web application and also see my options for bucket upgrades like custom domains, one-click SSL, webhooks and localization.

Cosmic JS is an API-first cloud-based content management platform that makes it easy to manage applications and content. If you have questions about the Cosmic JS API, please reach out to the founders on Twitter or Slack.

READ MORE

  1. How to Build a Cross-Platform Blog Using React Native and Node.js
  2. How to Build a Next.js React Universal App
  3. How to Build a Node.js User Management App
  4. How to Upload Media to Your Bucket Using the Cosmic JS API
  5. Build a Voting App using React | MobX | Bootstrap
  6. The Cosmic Stack