77 77. Step 4 - Optional: Preview the Frontend
As of Oct 22, 2026 · Official docs: Next.js
If you want to see the frontend before connecting the backend, you can go back to an early commit of the project that has only the frontend. Run the terminal commands below in your project folder (task-app).
Go to the commits page of your repository on GitHub (
https://github.com/YOUR-USERNAME/task-app/commits). The newest commits are at the top.Scroll to the bottom (you may need to go to the next page of commits) and find the commit labeled “feat: [0] Frontend Boilerplate”. It is the second-oldest commit (the oldest one is “first commit”).
Copy the commit hash. Instead of steps 1 to 3, you can also find the hash in the terminal: this command shows the commit, starting with the short form of its hash (for example
c8d9866):git log --oneline --grep="Frontend Boilerplate"Check out that specific commit:
- Type
git --versionto see your Git version. - Run ONE of the following commands, depending on your Git version:
- Git 2.23 and later:
git switch --detach COMMIT_HASH - older versions of Git:
git checkout COMMIT_HASH
COMMIT_HASHwith the hash you copied. - Git 2.23 and later:
- Type
Run the development server:
npm run devThen open
http://localhost:3000in your browser (if that port is busy, use the address thatnpm run devprints). This version has placeholder backend logic, allowing you to explore the UI without full functionality. When you are done, stop the server: click in the terminal where it is running and pressCtrl+C.To get back to the latest version of the code, run ONE of the following commands, depending on your Git version:
- Git 2.23 and later:
git switch -orgit switch BRANCH_NAME(where BRANCH_NAME is the name of your branch, such asmainormaster)
- older versions of Git:
git checkout -orgit checkout BRANCH_NAME(where BRANCH_NAME is the name of your branch, such asmainormaster)
- Git 2.23 and later:
Practice Questions
Easy
Question 1 · Short answer
What is the point of this optional step? What will you be able to do, and what won’t work?
Question 2 · Short answer
What is a commit hash, and where do you find the one you need for this step?
Question 3 · Write the command
Which command starts the development server so that you can see the app?
Medium
Question 4 · Multiple choice
You have Git version 2.43. Which command takes your project back to the commit whose hash starts with abc1234?
git switch --detach abc1234git clone abc1234npm run abc1234git commit abc1234
Question 5 · Ordering
Put these steps in order:
- Run
npm run dev - Stop the server with
Ctrl+C - Copy the commit hash
- Open the repository’s commits page on GitHub
- Run
git switch -to go back to the latest code - Check out the commit with
git switch --detach <hash> - Click around and explore the UI
Question 6 · Matching
Match each task with the right command.
| Task | Command | |
|---|---|---|
| 1. Go to an old commit (Git 2.23 or later) | A. git checkout main |
|
| 2. Go to an old commit (older Git) | B. git switch --detach <hash> |
|
3. Go back to the main branch (Git 2.23 or later) |
C. git checkout <hash> |
|
4. Go back to the main branch (older Git) |
D. git switch main |
Question 7 · True or false
In the Frontend Boilerplate version, creating a task saves it in your Supabase database.
Hard
Question 8 · Short answer
Why does the page give different commands depending on your Git version?
Question 9 · Scenario
Maria previewed the boilerplate and forgot to switch back. She carries on with the next tutorial steps, but even after she connects the backend, the app still doesn’t really do anything. What happened, and how can she fix it?
Question 10 · Short answer
To get back to the latest code, you can run git switch - or git switch BRANCH_NAME. What does the - mean, and when is naming the branch the safer choice?