DEV Community

Cover image for Building My first React Web Application – A Developer's Journey 🚀
Manish Yadav
Manish Yadav

Posted on

Building My first React Web Application – A Developer's Journey 🚀

Step 1: Choosing the Right Tech Stack

Before starting, I decided to use React for its component-based architecture and efficient rendering. Along with React, I used:
✅ Vite for a fast development setup
✅ Tailwind CSS for styling
✅ other libraries/frameworks like Redux,

Step 2: Setting Up the Project

I initialized my project using Vite:

sh

npm create vite@latest paste-app
cd paste-app
npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

This gave me a blazing-fast dev server with hot reloading.

Step 3: Creating the Core Components

I structured my app into reusable components like:

  • Navbar.jsx – Navigation bar
  • Home.jsx – Main page content
  • Past.x.jsx – Bottom section with links
  • Viewpaste.jsx – for view paste notes and documents

Step 4: Managing State with Hooks

To handle app state, I used useState and useEffect:

jsx
const [data, setData] = useState([]);

useEffect(() => {
  fetchData();
}, []);

const fetchData = async () => {
  const response = await fetch("https://api.example.com/data");
  const result = await response.json();
  setData(result);
};
Enter fullscreen mode Exit fullscreen mode

This helped me fetch and display dynamic content.

Step 5: Adding Routing with React Router

I set up navigation using react-router-dom:

sh

npm install react-router-dom
Enter fullscreen mode Exit fullscreen mode

Then, I created routes in App.jsx:

jsx

import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Home from "./Home";
import Navbar from "./Navbar";

function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/Navbar" element={<Navbar />} />
      </Routes>
    </Router>
  );
}

export default App;
Enter fullscreen mode Exit fullscreen mode

This made my app a multi-page experience without reloading.

Step 6: Styling the UI

I used Tailwind CSS for quick styling:

terminal


npm install tailwindcss @tailwindcss/vite
Enter fullscreen mode Exit fullscreen mode

vite.config.ts




import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
  plugins: [
    tailwindcss(),
  ],
})
Enter fullscreen mode Exit fullscreen mode

Import tailwind in CSS file

@import "tailwindcss";

Enter fullscreen mode Exit fullscreen mode

Then,

npm run dev
Enter fullscreen mode Exit fullscreen mode

Then, added styles like this:

jsx

<div className='flex flex-row gap-2 place-content-center  '>
        <input type="text"
          className='p-2 pl-2  rounded-2xl  mt-2 border w-[30%]'
          placeholder='enter title here'
          value={title}
          onChange={(e) => settitle(e.target.value)} />
        <button
          onClick={createpaste}
          className='p-2  rounded-2xl  mt-2 ' >
          {
            pasteId ? "update my paste" : "create my paste"
          }
        </button >
      </div>
Enter fullscreen mode Exit fullscreen mode

This kept my styling clean and maintainable.

Step 7: Deploying the App

Once I was happy with my app, I deployed it on Vercel:

sh

npm run build
vercel deploy
Enter fullscreen mode Exit fullscreen mode

Now, my app is live and accessible online! 🎉

Final Thoughts & Lessons Learned
Building this React app taught me:
✅ How to structure a scalable project
✅ The power of reusable components
✅ How to manage state effectively
✅ The importance of performance optimization

🔹 Next Steps: Adding better tailwindcss ,authentication, dark mode, and improving responsiveness!

Top comments (0)