πŸ““ Notes App Tutorial - Module 3

Step 3: Build the Frontend (React)

🎯 Target Folder Structure
C:\Projects\my-notes-app\frontend> tree
Folder PATH listing
Volume serial number is ABCD-1234
C:.
β”œβ”€β”€β”€node_modules
β”œβ”€β”€β”€public
β”œβ”€β”€β”€src
β”‚ β”œβ”€β”€β”€App.jsx
β”‚ └───main.jsx
└───package.json
πŸ–₯️ App Phase Preview
user@egotech:~/my-notes-app/frontend$ npm install axios react-router-dom
added 12 packages in 2s
user@egotech:~/my-notes-app/frontend$ npm run dev
VITE v5.0.0 ready in 250 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
πŸ“¦

3.1 Install Frontend Packages

Open a new terminal tab (leave your backend running!) and navigate to the frontend folder. We need to install Axios to make API requests to our backend.

Terminal
cd frontend
npm install axios react-router-dom
βš›οΈ

3.2 Build the Main React Component

Open frontend/src/App.jsx. Delete everything inside it and replace it with this foundational code to connect our API.

frontend/src/App.jsx
import { useState, useEffect } from 'react';
import axios from 'axios';
import './App.css';

function App() {
  const [message, setMessage] = useState('');

  useEffect(() => {
    // Fetch data from our Node.js backend
    axios.get('http://localhost:5000/')
      .then(response => {
        setMessage(response.data);
      })
      .catch(error => {
        console.error("Error connecting to backend:", error);
      });
  }, []);

  return (
    <div className="App">
      <h1>πŸ““ MyNotes App</h1>
      <div className="card">
        <h3>Backend Status:</h3>
        <p>{message ? message : "Connecting..."}</p>
      </div>
    </div>
  );
}

export default App;
πŸš€

3.3 Run the Frontend Server

It's time to see our UI! Start the Vite development server to view your React app in the browser.

Terminal
npm run dev
Next Step: Open http://localhost:5173 in your browser. As we add our CSS styles and components, your app will transform into the beautiful dashboard below!
🌐 Target Frontend Dashboard
πŸ”’ http://localhost:5173/dashboard
YOUR PERSONAL NOTE STUDIO

Welcome back, sura πŸ‘‹

Capture ideas, tasks and moments in one place.

SAVED NOTES

1

ACTIVE FILTER

All

MOST RECENT

Name

NEW NOTE

Capture your next idea

All General Personal School Campus Work
Name
PERSONAL

My name is sura

Jul 17, 2026