Skip to content

Commit 2efa76b

Browse files
authored
Merge pull request #28 from Eric-Zhang-Developer/feat(tutorial)/hello-world-skeleton
Feat(tutorial)/hello world skeleton
2 parents fe50805 + ed2c964 commit 2efa76b

File tree

5 files changed

+188
-12
lines changed

5 files changed

+188
-12
lines changed

package-lock.json

Lines changed: 67 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
"@supabase/ssr": "^0.7.0",
1313
"@supabase/supabase-js": "^2.75.0",
1414
"daisyui": "^5.3.7",
15+
"lucide-react": "^0.548.0",
1516
"next": "15.5.3",
1617
"react": "19.1.0",
17-
"react-dom": "19.1.0"
18+
"react-dom": "19.1.0",
19+
"react-youtube": "^10.1.0"
1820
},
1921
"devDependencies": {
2022
"@eslint/eslintrc": "^3",

src/app/dashboard/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ export default async function DashboardPage() {
3333
</form>
3434
</div>
3535

36-
<p className="mt-4 text-neutral-600">
36+
<p className="my-4 text-neutral-600">
3737
You&apos;re logged in as: <span className="font-bold">{user.email}</span>.
3838
</p>
39+
40+
<Link href="tutorial-hello-world" className="btn btn-neutral btn-outline">
41+
Hello World Tutorial
42+
</Link>
3943
</main>
4044
);
4145
}
Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,103 @@
1+
"use client";
2+
3+
import BackToDashBoardLink from "@/components/back-to-dashboard-link";
4+
import YouTube from "react-youtube";
5+
16
export default function TutorialHelloWorld() {
27
return (
3-
<>
4-
<h1>Hello World</h1>
5-
</>
8+
<div className="min-h-screen bg-gray-50 p-8">
9+
<BackToDashBoardLink></BackToDashBoardLink>
10+
11+
<article className="max-w-5xl mx-auto bg-white p-6 md:p-10 rounded-lg shadow-md space-y-6">
12+
{/* Quest Title */}
13+
<h1 className="text-3xl md:text-4xl font-bold text-indigo-700 border-b pb-2 mb-6">
14+
Quest: The Oracle&apos;s First Greeting - Whispering &quot;Hello World&quot;
15+
</h1>
16+
{/* Flavor Text*/}
17+
<p className="text-lg italic text-gray-600">
18+
Welcome, brave coder! Your journey into the mystical lands of programming begins now.
19+
Before you can conjure complex spells or build mighty digital fortresses, every adventurer
20+
must learn the first incantation, the universal greeting recognized across all realms:{" "}
21+
<strong className="font-semibold text-indigo-600">&quot;Hello World&quot;</strong>. This
22+
simple phrase is your key to unlocking the power of code.
23+
</p>
24+
<p className="text-gray-700">
25+
This quest will guide you through understanding and wielding this fundamental magic.
26+
</p>
27+
28+
<hr className="my-6" />
29+
{/* Section 1 */}
30+
<section className="space-y-3">
31+
<h2 className="text-2xl font-semibold text-gray-800">
32+
What is this &quot;Hello World&quot; Sorcery?
33+
</h2>
34+
<p className="text-gray-700">
35+
In the ancient scrolls of programming, &quot;Hello World&quot; is the traditional first
36+
spell learned. What does it do? It simply commands the machine - your loyal golem - to
37+
display the message{" "}
38+
<code className="bg-gray-100 px-1 rounded text-indigo-700">
39+
&quot;Hello World!&quot;
40+
</code>{" "}
41+
on the screen.
42+
</p>
43+
<p className="text-gray-700">
44+
Think of it like teaching a parrot its first words. You&apos;re not asking it to recite
45+
poetry yet, just to say &quot;Hello!&quot; It&apos;s the basic proof that you can
46+
communicate your intentions to the machine and make it respond.
47+
</p>
48+
</section>
49+
50+
<hr className="my-6" />
51+
{/* Section 2 */}
52+
<section className="space-y-3">
53+
<h2 className="text-2xl font-semibold text-gray-800">Why This First Greeting Matters</h2>
54+
<p className="text-gray-700">Why start with something so simple?</p>
55+
<ul className="list-disc list-inside space-y-2 text-gray-700 pl-4">
56+
<li>
57+
<strong className="font-semibold">It&apos;s Tradition:</strong> Like a knight
58+
receiving their first sword, programmers worldwide start here. It connects you to
59+
generations of coders before you!
60+
</li>
61+
<li>
62+
<strong className="font-semibold">It&apos;s a Test:</strong> Successfully making the
63+
machine say &quot;Hello World&quot; proves your basic setup is working. Your coding
64+
environment, the language you&apos;re using - they&apos;re all aligned and ready for
65+
more complex commands. It&apos;s like checking if your magic wand sparks before trying
66+
to levitate a mountain.
67+
</li>
68+
<li>
69+
<strong className="font-semibold">It&apos;s Confidence:</strong> Seeing your very
70+
first command come to life, even a simple one, is a powerful boost! It&apos;s the
71+
first step on your epic journey.
72+
</li>
73+
</ul>
74+
</section>
75+
<hr className="my-6" />
76+
{/* Section 3 */}
77+
<section className="space-y-3">
78+
<h2 className="text-2xl font-semibold text-gray-800">
79+
Visualizing the Incantation (Conceptual Example)
80+
</h2>
81+
<p className="text-gray-700">
82+
Imagine you have a magical scroll (your program). To perform the &quot;Hello World&quot;
83+
greeting, you&apos;d write an instruction similar to this:
84+
</p>
85+
<pre className="bg-gray-100 p-4 rounded-md font-mono text-sm text-gray-800 overflow-x-auto">
86+
<code>{`// Command the Oracle (or Screen) to speak:\nDisplay: "Hello World!"`}</code>
87+
</pre>
88+
<p className="text-gray-700">
89+
Different programming languages (spellbooks) have slightly different words for the
90+
&apos;Display&apos; command (like{" "}
91+
<code className="bg-gray-100 px-1 rounded text-indigo-700">print</code>,{" "}
92+
<code className="bg-gray-100 px-1 rounded text-indigo-700">console.log</code>,{" "}
93+
<code className="bg-gray-100 px-1 rounded text-indigo-700">echo</code>), but the core
94+
idea is the same: tell the machine to show those exact words.
95+
</p>
96+
</section>
97+
<hr className="my-6" />
98+
99+
<YouTube videoId="hp4pYFASTrc"></YouTube>
100+
</article>
101+
</div>
6102
);
7103
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ArrowLeft } from "lucide-react";
2+
import Link from "next/link";
3+
4+
export default function BackToDashBoardLink() {
5+
return (
6+
<Link
7+
href="/dashboard"
8+
className="mb-4 inline-block text-indigo-600 hover:text-indigo-800 transition hover:scale-105 group"
9+
>
10+
<ArrowLeft className="inline-block w-5 h-5 mr-1" />
11+
<span className="text-sm font-medium">Back to Dashboard</span>
12+
</Link>
13+
);
14+
}

0 commit comments

Comments
 (0)