React JS

React is a javascript library to build user interface, often people confuse it to be a framework, but it is not. user is flexible to choose any framework unlike angular framework.

One can learn from the react docs to create react applications here https://reactjs.org/docs/hello-world.html

Next JS

Next JS is a framework for React. It basically gives building block to build fast websites.

There are a few things you need to consider when building modern applications. Such as:

you can learn more about next js here - https://nextjs.org/learn/foundations/about-nextjs/what-is-nextjs

TypeScript

Typescript adds syntax to your JS to provide tight integration with IDE development and avoid runtime errors. Basically it makes JS more typesafe by declaring the parameter types when passed around.

More - https://www.typescriptlang.org/

Today let see how we can create a simple application using all the above.

Pre-requisites

  1. NodeJS- https://nodejs.org/en/ installed
  2. Npm installed/available in nodeJS
  3. Yarn installed - https://classic.yarnpkg.com/lang/en/
  4. Npx installed – use command “npm i -g npx”

With all the above easily create first nextJS typescript app with commands

npx create-next-app@latest --ts
# or
yarn create next-app --typescript
# or
pnpm create next-app -- --ts

To get started in an existing project, create an empty tsconfig.json file in the root folder,

touch tsconfig.json.

After you have created the app, navigate into the folder and run ” yarn install.

To start the app, run “yarn dev”

Folder Structure

Website

Deployment

You can instantly deploy the above starter application into vercel free of cost. You need to create an account (no credit card required) in Vercel. Click on the above “Deploy” button

Here select git repository where the hello world app is pushed.

All the settings work for a simple next js app, so no need to change this.

Once you click deploy, Vercel will take few minutes to deploy the code and your website should be ready.

You can find the URL here

Thanks for reading this blog, do try these steps and let me know. Also don’t forget to create your websites for free in Vercel.