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
27 days ago

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

@blair_mapuko
27 days ago

How do you change the image?

@vikasjha1064
27 days ago

Thanks mate, Good Video

@navidul3165
27 days ago

Why not tailwind css?

@EdwinOchieng-x3d
27 days ago

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

@anilks6735
27 days ago

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

@mahnoorkhan-t3u
27 days ago

where is this github code

@rshan7375
27 days ago

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

@MUSKANPERIWAL-b3z
27 days ago

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

@ScherzoVivo
27 days 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
27 days ago

Which technology are you using in this

@anikjohan
27 days ago

Thanks …….Easy to understand

@kennethyegon5483
27 days ago

perfect teacher- looking forword to see your backend

@callswaggviccy7663
27 days ago

the media query isnt working

@s-_-r009
27 days ago

30:39

@amjithcs2539
27 days ago

how to get assets file

@3d.jiondi
27 days ago

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

@flowercase7584
27 days 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
27 days ago

Thank you! It's great!

@gamemusicmeltingpot2192
27 days ago

thank u bro

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