> For the complete documentation index, see [llms.txt](https://personal-space-4.gitbook.io/complete-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://personal-space-4.gitbook.io/complete-guide/instructor_notes_gitbook/detailed-live-coding-script/pembukaan.md). Agents can also search and read this documentation through its [MCP server](https://personal-space-4.gitbook.io/complete-guide/~gitbook/mcp).

# Pembukaan

Opening script dan project tour.

{% hint style="danger" %}
**CONFIDENTIAL - DO NOT SHARE WITH STUDENTS**

This is the complete step-by-step guide with debugging checkpoints, theory references, and flow management.
{% endhint %}

***

## PEMBUKAAN (5 minutes)

#### \[00:00 - 00:02] Welcome & Context

**Script:**

{% hint style="info" %}
"Selamat datang di workshop React Hooks! Hari ini kita akan belajar **kapan**, **kenapa**, dan **bagaimana** menggunakan hooks melalui case study yang praktis: Chatbot UI.

Kenapa chatbot? Karena chatbot adalah perfect example untuk hooks:

* State yang berubah (messages, loading, error)
* Async operations (bot response)
* Side effects (auto-scroll)
* Complex logic yang perlu clean architecture

Tujuan kita: **Understanding over syntax**. Bukan cuma bikin chatbot jalan, tapi paham reasoning di balik setiap keputusan."
{% endhint %}

**Checklist:**

* Students tau tujuan workshop
* Students paham kenapa case study ini dipilih

***

#### \[00:02 - 00:03] Show Project Structure

**Terminal:**

```bash
cd case-study-chatbot-ai
npm run dev
```

**Browser:** Navigate to `http://localhost:5173`

**Show to students:**

1. UI sudah complete (ChatShell, input, messages)
2. 3 static messages tampil
3. Input tidak berfungsi (expected!)
4. Clear button tidak berfungsi (expected!)

**Explain:**

{% hint style="success" %}
"UI components sudah jadi lengkap - ChatShell untuk container, ChatComposer untuk input, MessageBubble untuk display. Ini semua pure presentation components.

Fokus kita: **Chat.jsx** - di sinilah magic happens. Di sinilah kita implement hooks step by step."
{% endhint %}

***

#### \[00:03 - 00:05] Project Tour

**Open in VS Code:**

```
src/
├── components/
│   ├── Chat.jsx          ← FOKUS KITA
│   ├── ChatShell.jsx     ← Complete (UI only)
│   ├── ChatComposer.jsx  ← Complete (UI + local state)
│   └── MessageBubble.jsx ← Complete (UI only)
├── App.jsx               ← Minimal (hanya import Chat)
└── main.jsx
```

**Open Chat.jsx:**

**Point out structure:**

{% hint style="info" %}
"Lihat file Chat.jsx. Ada 3 bagian besar:

1. **Mock data** di atas (untuk starting point)
2. **TODOs dengan komentar lengkap** - ini roadmap kita
3. **JSX return** di bawah - sudah jadi

Strategi: kita implement TODOs satu per satu, test setelah setiap step, dan **understand WHY** sebelum move on."
{% endhint %}

**Checklist Pembukaan:**

* All students dapat buka project di browser
* All students dapat buka Chat.jsx di editor
* Students paham file structure
* Students tau file mana yang akan di-edit

***
