02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Setting up our foundation project

In this foundational lesson, we prepare to dive into ReactJS development by setting up a complete project environment. This involves configuring essential tools like Node.js, NPM, and Webpack, and creating a basic HTML structure to serve as our project's skeleton.


Prerequisites

Before proceeding, ensure the following are installed and updated:

  • Node.js (version 6 or higher)
  • NPM (version 3 or higher)

You can check your versions using the following commands:

node -v  
npm -v  

If necessary, update Node.js and NPM from their respective websites.


Steps to Set Up the Project

1. Create the Project Folder

Start with an empty directory. Inside it, create a new folder structure:

  • A public/ folder for assets (e.g., images).

Commands:

mkdir public  
mkdir public/images  

2. Initialize the Project with NPM

Run the following command to initialize the project:

npm init  

This will launch an interactive setup. Accept the defaults or provide details such as the project name (bootstrapping-react) and version. This will generate a package.json file, which serves as the descriptor for your project.

3. Create the Basic HTML File

Inside the public/ folder, create an index.html file. Use the following structure:

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <meta http-equiv="X-UA-Compatible" content="IE=edge">  
    <title>Building React User Interfaces</title>  
</head>  
<body>  
    <div>  
        <h1>Building React User Interfaces</h1>  
        <p>With Bootstrap and SaaS</p>  
        <a href="#" target="_blank">Discover More</a>  
    </div>  
</body>  
</html>  

This file will serve as the basis for our React application.

4. Setting Up Webpack and a Dev Server

To enhance our workflow, we will integrate Webpack in the next step. Webpack allows hot reloading, ensuring that changes in our code instantly reflect in the browser.


Key Takeaways

  • You’ve successfully set up a basic project structure for ReactJS development.
  • The package.json file helps manage project dependencies.
  • The HTML structure you created will serve as the entry point for your React components.

In the next lesson, we will dive deeper into configuring Webpack and setting up a development server for a seamless ReactJS workflow.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!

Setting up our foundation project

Learn to set up a ReactJS project using Node.js, NPM, and Webpack. Prepare for dynamic, responsive interfaces with Bootstrap and SaaS.

14:36

Setting up Webpack and WebPack-Dev-Server

Learn how to configure Webpack and Webpack-Dev-Server for ReactJS. Set up a local development server with hot reloading for seamless workflows.

08:19

Bootstrapping our HTML

Learn to enhance HTML with Bootstrap 4.0. Create responsive designs using Jumbotron and button components for modern visuals.

07:23

Adding Support for ES6 and JSX with BabelJS

Learn to set up BabelJS with Webpack to support ES6 and JSX. This tutorial covers loaders, presets, and polyfills for better browser compatibility.

10:55

001.005.Building our first JSX React Component

Learn how to create your first JSX React component, including setup of React, ReactDOM, and integration with JSX.

13:51