![]() ![]() So before we move on, we must have our project uploaded there. You may have noticed that we have not created any repository in GitHub. If everything runs properly, you will see a message in the terminal that says that your application is running on a local server at this address: If you head over there in your browser, you will see this: How to Deploy Your Project to GitHub To see if it works properly, head into the directory of the project (in our example it would be starter-project) and run the command: yarn start Once the operation finishes, you will have a boilerplate React project, ready to go. To create a project, you need to type the following in the terminal: npx create-react-app starter-project It is a package that lets you create a single page application with ease. ![]() To create our project, we will be using create-react-app. ![]() Choose whichever name you deem fit for this project, but I will go with starter-project for the rest of this article. Head over to your account and create a new repository. We will also need to create a repository on GitHub. If not, you need to go ahead and install what is missing. If these commands print out a version number in the terminal, you are good to go. To check if they are installed, open up a terminal window and type the following: npm -v You need to have Node, yarn and npm installed on your machine. ⚠️ This article assumes you have some knowledge of React and Git. We will give special attention to the routing part since it is important to understand and implement. In this article, I'll show you how to create a simple React application that uses routing and then we'll learn how to upload it to GitHub Pages. This gives anyone who visits your application online the same experience you have when you build the application locally. Projects that are built in React, Vue or Angular require some configurations, though. Instead of buying a domain and taking the time to configure it, it's easier just to host it using GitHub Pages.Ī project that just uses JavaScript, HTML and CSS is simple to host on GitHub Pages. When we build projects, we want to showcase them online. ![]()
0 Comments
Leave a Reply. |