ToUpper LLC Blog

How to create a react application and publish it to github.

Published 2 weeks ago10 min read
image
Image Credit: Ferenc Almasi

Are you a beginner looking to get into web development? If so, you came to the right place! Today, we will talk about creating a standard webpage with ReactJS and learn how to publish it to github!

Getting started

We must have the following:
  1. Github account
  2. NodeJS
  3. ReactJS
  4. Git

Once we have all of our requirements, we must create a new React application using the following command:

npx create-react-app my-app

When the application is created, navigate to your application and run the following command:

npm run start

image

Create your Github repository

Once you have completed the steps above, you must go to github and login. Once you login, click on "New" right next to repositories. Fill in whatever credentials you may need such as the name of your repo (in this example, we can call it ReactApp) and whether you would like for it to be public or private.

Add git your ReactJS project

Once you have your github repo set up, it is now time to add git to your application. please grab the remote url of your github repo. Please click on code and make sure it includes https. Copy the clipboard when you're ready.

Use the following commands to add git to your application:

					
git init 

git remote add https://www.git_hub_url.com/repo/ReactApp.git

git branch -M main
					
					

Push to your Github repository

Use the following git commands to publish to your github repo

					
git add .

git commit -m "This is my first push!" 

git push origin master