Skip to content

Instantly share code, notes, and snippets.

@suhailroushan13
Created January 13, 2026 14:53
Show Gist options
  • Select an option

  • Save suhailroushan13/2729f6389cbba948b7185939b0ba3fa0 to your computer and use it in GitHub Desktop.

Select an option

Save suhailroushan13/2729f6389cbba948b7185939b0ba3fa0 to your computer and use it in GitHub Desktop.
React Setup Tailwind

Here’s a clean, professional README.md you can drop straight into your repo. It’s well-structured, beginner-friendly, and follows best GitHub practices β€” all in Markdown as requested.


## πŸš€ Step 1: Create GitHub Repository

1. Go to GitHub and create a new repository.
2. Name it in **camelCase** (example: `viteSetupProject`).
3. Choose **Public** or **Private**.
4. βœ… Check **Add a README file**.
5. After creation, copy the **SSH URL**  
   Example:
   ```bash
   git@github.com:username/viteSetupProject.git

πŸ“₯ Step 2: Clone Repository & Create Client Folder

git clone git@github.com:suhailroushan/viteSetupProject.git
cd viteSetupProject
mkdir client && cd client

⚑ Step 3: Create Vite App (pnpm)

pnpm create vite@latest .

Select the following options:

  • Framework β†’ React
  • Variant β†’ JavaScript
  • rolldown-vite β†’ Yes
  • Install & Start now β†’ No

πŸ“¦ Step 4: Install Dependencies

pnpm install
pnpm up --latest

🎨 Step 5: Install Tailwind CSS (Vite Plugin)

pnpm add tailwindcss @tailwindcss/vite

🧠 Step 6: Open in VS Code

code .

🧹 Step 7: Clean Up Unnecessary Files

Delete the following files/folders:

public/vite.svg
src/assets/
eslint.config.js

βš™οΈ Step 8: Configure Vite for Tailwind

Update vite.config.js:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react(), tailwindcss()],
})

🎨 Step 9: Configure CSS

Empty App.css

Update index.css

@import "tailwindcss";

πŸ”Œ Step 10: Update React Entry Point

main.jsx

import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'

createRoot(document.getElementById('root')).render(
  <App />
)

🧩 Step 11: Create App Component

App.jsx

import React from 'react'

const App = () => {
  return (
    <>
      <h1 className="text-3xl font-bold underline">
        Hello World
      </h1>
    </>
  )
}

export default App

▢️ Step 12: Run Development Server

pnpm dev
# or
pnpm run dev

Open your browser at:

http://localhost:5173

βœ… Result

You now have:

  • ⚑ Fast Vite setup
  • βš›οΈ React with clean structure
  • 🎨 Tailwind CSS ready
  • πŸ“¦ pnpm-based dependency management

πŸ“„ License

MIT – feel free to use and modify.


Happy coding πŸš€


---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment