dev-saber / gdsc-react-workshops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to the EMSI GDSC 2023/24 repository, where you can access to all workshops code and stay informed about upcoming challenging contests!

⚛ Creating a React App with React Vite and Installing Dependencies

In this documentation, we'll outline the steps to create a React application using React Vite as the build tool. Additionally, we'll install and configure the following dependencies:

  • Tailwind CSS
  • Flowbite
  • React Router DOM
  • React Icons

Step 1: Set Up React with Vite

  1. Ensure that you have Node.js installed on your system. You can download it from here: https://nodejs.org/en/download

  2. Open your terminal or command prompt

  3. Create a new React Vite project by running

    npm create vite@latest project-name -- --template react
  4. Navigate into your project directiory and install the node modules

    cd project-name
    npm install

Step 2: Install Dependencies

  1. Install Tailwind CSS:

    npm install -D tailwindcss postcss autoprefixer
    npx tailwindcss init -p
    

    Configure the template paths inside the tailwind.config.js file:

    module.exports = {
      content: [
        './src/**/*.{js,jsx,ts,tsx}',
      ],
      theme: {
        extend: {},
      },
      plugins: [],
    }

    Set up the Tailwind directives inside the ./src/index.css file:

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
  2. Install Flowbite (optional):

    npm install flowbite flowbite-react
    

    Require Flowbite as a plugin inside your tailwind.config.js file:

    module.exports = {
      plugins: [
        require('flowbite/plugin')
      ]
    }

    Additionally, add the Flowbite source paths to apply the classes from the interactive elements in the tailwind.config.js file:

    module.exports = {
      content: [
        // ...
        'node_modules/flowbite-react/lib/esm/**/*.js'
      ]
    }
  3. Install React Router DOM:

    npm install react-router-dom
    
  4. Install React Icons:

    npm install react-icons
    
  5. Run the app:

    npm run dev
    

If you encounter any challenges or have questions along the way, don't hesitate to reach out.

As for providing links to resources, you can include links to relevant documentation or tutorials for each of the dependencies installed:

YouTube channel recommendations:


💻 How to clone the repository in my local machine?

  1. Open your terminal or command prompt and run the following command

    git clone https://github.com/sifeddineEddr/gdsc-react-workshops.git
  2. Navigate into the cloned repository and install its dependencies

    cd gdsc-react-workshops
    npm install
  3. You can now open the project on an IDE (VS Code as an example)

    code .

    Or run the project on localhost

    npm run dev

About


Languages

Language:JavaScript 91.9%Language:CSS 5.3%Language:HTML 2.9%