Setup project from Github Repo
A short guide explaining how to setup a starting project.
Following explanation you can find in my youtube video as well: https://youtu.be/VgUng7isvlY
First way to get a code from my(any) Github repository is to download a project as a zip file.
Visit my starting project on which I will be later explaining programming concepts. You can find the project here: https://github.com/Jerga99/next-youtube-course/tree/master
On right hand side of the screen click on download button.
After the file is downloaded, unzip it. Go into project folder in your terminal and run command npm install
To run the application run npm run dev and in other terminal window run npm run server to run api server.
To test Next.js application visit localhost:3000, to test api server visit localhost:3001/api/test
In some of my videos I will be asking students to checkout to specific version of the project. Project contains multiple “tags” (versions) of the code. To get a specific version of the project click on “Branch” on the left side and select tags.
Select a specific tag, click download and repeat all the steps above. npm install, npm run dev, npm run server… and you are good to go.
Other better way to a setup Github repository is to clone it. To clone a Github repository you need to install Git CLI so you can use git commands in your terminal.
Download Git from here: https://git-scm.com/downloads and install it.
Go to your terminal copy clone “link” from repository
In your terminal navigate to a folder where you want to initialise your project.
Run commands :
- git clone <source clone link> <name of the project> so it should look like this: git clone https://github.com/Jerga99/next-youtube-course.git new-project
- Once again npm install, npm run dev ….
- To checkout to specific version you need to following:
- run git tag, this will list all of the available tags
- checkout to specific version, let’s say v1.2. Run git checkout -b new-branch v1.2
Now you are ready to go.
That should be it guys. I hope you didn’t have any problems to setup the project. You can also watch my youtube video explaining this topic here: https://youtu.be/VgUng7isvlY
Check my courses on eincode.com
Best,
Filip