# Milestone 1.9 — Message API + Echo Response Learning Guide

This directory documents the implementation of **Milestone 1, Step 1.9: Message API + Echo Response**.

---

## Documents in this folder

- **[01-message-echo.md](file:///c:/Users/alokc/chatbot/backend/docs/learning/m1-9-message-echo/01-message-echo.md)** — Explains the `POST /api/v1/message` endpoint architecture, request/response schemas, session validation, and UI message bubble rendering.
- **[02-m1-9-revision.md](file:///c:/Users/alokc/chatbot/backend/docs/learning/m1-9-message-echo/02-m1-9-revision.md)** — Short revision summary and top 5 interview Q&As.

---

## How to Verify Milestone 1.9

1. **Run Backend Pytest Suite:**
   ```bash
   cd backend
   .\venv\Scripts\python.exe -m pytest
   ```
   *Verifies 13 passing unit tests.*

2. **Run Backend Server:**
   ```bash
   uvicorn app.main:app --reload --port 8000
   ```

3. **Verify Interactive Chat in Widget Demo:**
   - Open `widget/demo.html` in browser.
   - Click floating chat bubble to open panel.
   - Type `"Hello Chatbot!"` into the input field and press Enter (or click Send).
   - Observe User message bubble (blue, right-aligned) appearing immediately.
   - Observe Bot Echo message bubble (`"Echo: Hello Chatbot!"`, gray, left-aligned) returning from backend!

---

## What You Should Understand Before Moving to M1.10

- In **Milestone 1.10**, we perform the final Milestone 1 test harness verification and end-to-end audit across all M1 features (M1.1–M1.9).
