Course Guides
Fullstack Portfolio
Project Setup

Project Set Up

System Requirements

Download and Install Node Js

Check if you have Node Js and Npm

>_ Terminal
  node -v
  npm -v

Create a new Next JS Project

I recommend starting a new Next.js app using create-next-app, which sets up everything automatically for you. To create a project, run:

>_ Terminal
 npx create-next-app@latest

On installation, you'll see the following prompts:

>_ Terminal
  What is your project named? my-app
  Would you like to use TypeScript? No / Yes
  Would you like to use ESLint? No / Yes
  Would you like to use Tailwind CSS? No / Yes
  Would you like to use `src/` directory? No / Yes
  Would you like to use App Router? (recommended) No / Yes

Host your Project

I recommend that we host our project immediately before addding alot of components, depencies and complex concepts. Follow the following steps

Midify Git Ignore:

  • To your .gitignore file in you root of your project
  • Inside this file, add .env file to avoid leaking your secret credentials

Initialize Git Repository:

>_ Terminal
 git init

Add Files to Staging Area:

>_ Terminal
 git add .

Commit Changes:

>_ Terminal
 git commit -m "initial commit"

Migrate to the main branch:

>_ Terminal
 git branch -M main

Create a New GitHub Repository:

--Go to GitHub and log in to your account. Then, create a new repository by clicking on the "+" icon in the top right corner and selecting "New repository". Follow the prompts to create your repository.

Add Remote Repository URL: Once you've created the repository on GitHub, copy the repository URL provided.

Link Local Repository to GitHub Repository: Back in your terminal or command prompt, use the following command to link your local repository to the GitHub repository. Replace repository_url with the URL you copied in the previous step.

>_ Terminal
 git remote add origin repository_url

Push Changes to GitHub: Finally, push your local repository's commits to the GitHub repository using the following command:

>_ Terminal
 git push -u origin main

Common Git errors

Fatal: Not a Git Repository (or any of the parent directories):

>_ Terminal
 git init

Author Identity Unknown, Please Tell Me Who You Are:

>_ Terminal
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
 

Fatal: Remote Origin Already Exists:

>_ Terminal
git remote rm origin
git remote add origin <new_remote_url>
 
or Change the existing url
git remote set-url origin <new_remote_url>
 

Host your Project on Vercel

  • Login tour vercel account, then add new Project from Github and then deploy
  • High Chanches are, that it will deploy successfully