A hands-on museum · Free, no sign-up
All 4 labs
Each lab is a learning model that really runs in your browser. Press things, change things, break things, and start over any time. In the books, each lab sits inside the chapter that explains it.
ROOM 01 · from Book 01 FRONTEND
The web page playground
Build a web page with HTML, CSS and JavaScript and see the result instantly
LAB 01 — Frontend Construction Chamber
The web page playground
Result · what the user sees
- HTML5 pieces on the page
- CSSStyling the page
- JavaScriptOff · nobody listening
What just happened?
Fresh bread every morning
Our own dough, baked in a charcoal oven, delivered to your door
HTML says what is on the page
index.html · the code that matches the screen right now
<body><header>Flour House · Menu · Contact</header><h1>Fresh bread every morning</h1><p>Our own dough, baked in a charcoal oven, delivered to your door</p><img src="bread.png" alt="A round loaf of bread"><button id="order">Order bread</button></body>
ROOM 02 · from Book 02 BACKEND
The server’s coffee shop
Order a coffee and follow the request and response — when it works and when it fails
LAB 02 — Request Processing Engine
The server’s coffee shop
Scenario · choose one before you order
The server works as usual
Browser · customer side
Server · coffee.example
IDLE · waiting for requests
- Receive the requestWaiting
- Check the dataWaiting
- Check stockWaiting
- Save and brewWaiting
- Send the responseWaiting
Shop stock · the browser can’t see this
- Latte6 cups
- Americano8 cups
- Cocoa4 cups
POST /api/orders HTTP/1.1 Host: coffee.example Content-Type: application/json Accept: application/json { "drink": "latte", "qty": 1, "customerName": "Mali" }
// No response yet // Press 'Order now' to send the request
What happened?
Press Order now and watch the blue envelope travel. That envelope is the request: the browser wraps up your order and sends it to the server. Then try changing the scenario above to see how each kind of failure is different — or set the quantity to 0, or delete the name.
4 kinds of outcome · Tried 0/4
- 2xx
Success
You got what you asked for, e.g. 201 Created
- 4xx
Request problem
The sender must fix the request, e.g. 400, 409
- 5xx
Server problem
Not the customer’s fault, e.g. 500
- No code
Never arrived / no answer
A problem on the way. No response
ROOM 03 · from Book 03 DATABASE
The data drawers
Add, find, edit and delete rows, and link the customers table to the orders table
LAB 03 — Data Memory Vault
The data drawers
SELECT *
FROM customers;What happened?
Drawer · TABLE
customers shop customers
| id (Primary Key) | name | city |
|---|---|---|
| 1 | Chiang Mai | |
| 2 | Bangkok | |
| 3 | Khon Kaen | |
| 4 | Phuket |
Try itPress a customer’s name in the top table to see which orders in the bottom table point back to them.
Drawer · TABLE
orders coffee orders
| id (Primary Key) | customer_id (foreign key pointing to customers.id) | item | total ฿ |
|---|---|---|---|
| 101 | Iced latte | 65 | |
| 102 | Hot Americano | 55 | |
| 103 | Blended cocoa | 70 | |
| 104 | Thai iced tea | 50 | |
| 105 | Cappuccino | 60 | |
| 106 | Espresso | 45 |
Who may write to the database?
Browser vs. server
Try changing the price of order #101 (Iced latte, 65 baht) by three routes, and see where each request is stopped.
ROOM 04 · from Book 04 WEBSITE ONLINE
Publish to the world
Take a website from one computer out to users in many countries
LAB 04 — Global Network Observatory
Publish to the world
Who can open itOnly one person can open it: the developer
Step 0 · The website still lives on the developer’s machine
The website is running at localhost:3000. The word localhost means “this machine,” so the browser on our own machine can open it. But if a friend types the same thing, their browser looks for the site on their own machine, not ours.
The command that runs the site on your own machine
$ npm run dev > Ready at http://localhost:3000