Creating a Portfolio Website Using React JS | Step-by-Step Tutorial for Building a Complete React JS Website Project in 2024

Posted by


In this tutorial, we will be creating a portfolio website in React JS. React JS is a popular JavaScript library for building user interfaces, and it is widely used for creating single-page applications. By the end of this tutorial, you will have a fully functional portfolio website that you can use to showcase your projects and skills to potential employers or clients.

To begin, make sure that you have Node.js and npm installed on your computer. If you don’t have them installed, you can download them from the Node.js website. Once you have Node.js and npm installed, you can create a new React project by running the following command in your terminal:

npx create-react-app portfolio-website

This command will create a new React project called portfolio-website in the current directory. Once the project has been created, navigate to the project directory by running:

cd portfolio-website

Next, we will create the components that we will use to build our portfolio website. In the src folder, create a new folder called components. Inside the components folder, create a new file called Header.js and add the following code:

import React from 'react';

const Header = () => {
  return (
    <header>
      <h1>My Portfolio</h1>
    </header>
  );
};

export default Header;

Next, create a new file called Project.js inside the components folder and add the following code:

import React from 'react';

const Project = ({ title, description, imageUrl }) => {
  return (
    <div className="project">
      <h3>{title}</h3>
      <img src={imageUrl} alt={title} />
      <p>{description}</p>
    </div>
  );
};

export default Project;

Now, we will update the App component to include the Header and Project components. Open the App.js file and update it as follows:

import React from 'react';
import Header from './components/Header';
import Project from './components/Project';

function App() {
  return (
    <div className="App">
      <Header />
      <Project 
        title="Project 1"
        description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
        imageUrl="https://via.placeholder.com/150"
      />
      <Project 
        title="Project 2"
        description="Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
        imageUrl="https://via.placeholder.com/150"
      />
    </div>
  );
}

export default App;

Now we will add some styling to the project. In the src folder, create a new folder called styles. Inside the styles folder, create a new file called App.css and add the following code:

.App {
  text-align: center;
}

header {
  background-color: #333;
  color: white;
  padding: 10px;
}

.project {
  margin: 20px;
  padding: 20px;
  border: 1px solid #ddd;
}

.project img {
  max-width: 100%;
}

Next, update the index.js file to include the App.css file. Open the index.js file and update it as follows:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

Finally, start the development server by running the following command in the terminal:

npm start

Now you should see your portfolio website in the browser. You can customize the website further by adding more projects, updating the styling, and adding additional pages. This tutorial just scratches the surface of what you can achieve with React JS, so feel free to experiment and explore more features of React to build a truly unique portfolio website.

0 0 votes
Article Rating

Leave a Reply

48 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@GreatStackDev
2 hours ago

👉 Source code: https://greatstack.dev/go/alex
👉 Live link: https://greatstack.in/portfolio/

@blair_mapuko
2 hours ago

How do you change the image?

@vikasjha1064
2 hours ago

Thanks mate, Good Video

@navidul3165
2 hours ago

Why not tailwind css?

@EdwinOchieng-x3d
2 hours ago

Hello,👋 i am having trouble accessing my "AnchorLink function" using the installed package ( react-anchor-link-smooth-scroll ) can someone help

@anilks6735
2 hours ago

Sir in my asset folder its showing that asset folder is empty at 9:31

@mahnoorkhan-t3u
2 hours ago

where is this github code

@rshan7375
2 hours ago

How did you generated that logo.svg. Could you please give me any info

@MUSKANPERIWAL-b3z
2 hours ago

How you convert you profile in svg file? Please help us to

@ScherzoVivo
2 hours ago

Ahh yessss! Another wonderful tutorial. Thank you so much for all the hard work, I can tell you put in a lot of time and effort! ♥

@BhumikaAhuja-k2c
2 hours ago

Which technology are you using in this

@anikjohan
2 hours ago

Thanks …….Easy to understand

@kennethyegon5483
2 hours ago

perfect teacher- looking forword to see your backend

@callswaggviccy7663
2 hours ago

the media query isnt working

@s-_-r009
2 hours ago

30:39

@amjithcs2539
2 hours ago

how to get assets file

@3d.jiondi
2 hours ago

i got stuck at the underline part where my website only shows the main background

@flowercase7584
2 hours ago

I am very thankful . I am a beginner in react js and I completed this portfolio websites . Thanks lot it is very simple and easy to understand.

@katerinamozhaeva8885
2 hours ago

Thank you! It's great!

@gamemusicmeltingpot2192
2 hours ago

thank u bro

48
0
Would love your thoughts, please comment.x
()
x