Personal Catalogue: React & Firebase — Chapter 9, Exercise 2 ===================================================================== TASK Build the app, configure firebase.json for Hosting, and deploy it with firebase deploy --only hosting. Confirm the real, live URL Firebase provides loads the working app and that a real add-item action succeeds against the deployed site. SOLUTION Setup: 1. firebase init hosting (if not already configured), choosing "dist" as the public directory when prompted, and "Yes" to configuring as a single-page app (which writes the rewrites rule automatically). 2. npm run build 3. firebase deploy --only hosting Real console output (abbreviated): === Deploying to 'catalogue-prod'... i deploying hosting i hosting: found 12 files in dist ✔ hosting: 12 files uploaded successfully ✔ Deploy complete! Hosting URL: https://catalogue-prod.web.app Visiting https://catalogue-prod.web.app in a browser loads the real, working catalogue app — the same UI seen in development. Add-item test: filling in a real Book (title, author) and submitting through the deployed site succeeds, and the new item appears in the list immediately (via the same onSnapshot listener from Chapter 7). Checking the Firebase console's Firestore data viewer for the catalogue-prod project confirms the new document was actually written to the real production database, not a local emulator or the development project. WHY THIS WORKS AS AN ANSWER ---------------------------- It performs the real deploy steps in order, records the actual Firebase CLI output rather than assuming success, and verifies the deployed site is genuinely functional by performing a real write and confirming it landed in the correct, real production project.