L1: Project Setup
Clean up the Vite starter project and prepare for building the booking application.
Before building new features, let's clean up the default Vite project and set up a proper structure for our booking app.
Current State
Right now, your project shows the default Vite + React page with:
- Vite and React logos
- A counter button
- Some example text
We'll replace this with a clean starting point for our booking application.
Step 1: Clean Up App.jsx
Open src/App.jsx and replace everything with this clean starting point:
function App() {
return (
<div className='app'>
<h1>StayScape</h1>
<p>Find your perfect stay</p>
</div>
);
}
export default App;What we did:
- Removed the counter logic
- Removed all the starter content
- Created a simple welcome message
- Kept the basic structure (function component with JSX return)
Save the file and check your browser - you should see just "StayScape" and "Find your perfect stay".
Step 2: Clean Up the Styles
Let's simplify the CSS files.
Update index.css
Open src/index.css and replace with:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}This provides:
- CSS reset (removes browser defaults)
- Clean typography
- Box-sizing for easier layouts
Delete App.css
We don't need App.css anymore. Delete the file:
- Right-click on
src/App.cssin VS Code - Select "Delete"
- Confirm
Also remove the import from App.jsx if it's still there.
Step 3: Create Folders Structure
Let's organize our project properly from the start.
In the src folder, create two new folders:
Using VS Code Terminal:
cd src
mkdir pages componentsOr Using VS Code GUI:
- Right-click on the
srcfolder - Select "New Folder"
- Name it
pages - Repeat for
components
Understanding the Structure
This organization follows React best practices:
Step 4: Verify the Setup
Your project structure should now look like:
What You Learned
Component Structure Every React component is a function that returns JSX
Project Organization Separate pages from reusable components for better maintainability
Clean Slate Starting with a minimal setup makes it easier to understand what you build
Checkpoint ✅
Before continuing, make sure:
- ✅ Your browser shows "StayScape" and "Find your perfect stay"
- ✅ No console errors in browser DevTools (F12)
- ✅
pagesandcomponentsfolders exist insrc - ✅
App.jsxcontains the clean starting code
Next Up
Now that we have a clean project, we'll create our first custom component: the
HomePage!