Welcome to another edition of our GitHub for Beginners series! In this sixth episode, we’re diving deep into using GitHub Copilot to build a React frontend. Previously, we built a backend API for Planventure, our travel itinerary builder. Now, it’s time to connect that API with a sleek client-side interface using React.
🛠 What You’ll Need:
- VS Code (or another code editor)
- Node.js (latest version)
- npm (Node package manager)
- GitHub Copilot access (free signup available)
- Optionally, a GitHub Codespace
🌐 What We’re Building:
We’re creating a frontend that connects to our API using:
- React with Vite
- Material UI for components
Core features:
- User authentication (login/signup)
- Protected routes
- Add and manage trips and itineraries
🔧 Step-by-Step Guide
Step 1: Initial Setup
- Clone the repo: bashCopyEdit
git clone https://github.com/github-samples/planventure
- Switch to the client branch: bashCopyEdit
cd planventure-client git switch client-start
- Install dependencies and run: bashCopyEdit
npm install npm run dev
Step 2: Add Authentication
- Use GitHub Copilot to build:
AuthLayout
with centered content and navigationLoginForm
andSignupForm
with validations
- Update routing and context with Copilot prompts
Step 3: Connect to Backend API
- Build API service for login/register
- Update forms to use API
- Start Flask backend: bashCopyEdit
cd planventure-api flask run --debug
Step 4: Add Dashboard and Sidebar Navigation
- Create a dashboard layout with sidebar using Copilot
- Build
TripCard
,TripList
, and a welcoming dashboard - Fetch user trips and handle errors with friendly messages
Step 5: Enable Trip Management
- Use
dayjs
and MUI date pickers - Create
NewTripForm
for adding trips - Build components to manage itineraries (
ItineraryDay
,TimeSlot
) - Add trip editing and options for accommodation and transportation
✅ Final Steps:
- Test all functionality thoroughly
- Debug with GitHub Copilot Chat if needed
- Commit changes regularly using Copilot-generated commit messages
🎯 What’s Next?
You’ve successfully built a fully functional MVP with user auth, trip creation, and itinerary management using GitHub Copilot. Stay tuned for the next episode, where we’ll continue expanding Planventure into a full-featured travel planner.
Have questions? Join the conversation on the GitHub Community thread. Happy coding! 🚀