Next.js Capstone: My Bookshelf, Live
The Bookshelf is finished. It lists books, searches them, adds new ones, and signs the reader in.
The search works
One check asks for dune. The page answers with one result.
curl -s "http://localhost:3110/search?q=dune" | grep -o "1 result for “dune”" | sort -uDocker is not running here
The Docker tool is installed, version 29.1.3. Its server is not running, so no image was built. This is the error line from the check.
docker infoExample
node -e 'const routes=["/","/books/dune","/search?q=dune","/gallery","/cached","/env"]; console.log("Routes live:", routes.length); routes.forEach(r=>console.log("-", r));'Key points
- The home page lists four books. Dune, Pride and Prejudice, The Hobbit, and Neuromancer.
- The search finds one book for "dune". The page shows "1 result for “dune”".
- The book page shows its own title. Dune gets "Dune by Frank Herbert | My Bookshelf".
- The add page adds a book and returns home. The sign-in page remembers the name in a cookie.
- The plain-Node deploy is npm start. Six routes answered 200 on this machine.
- The Docker image steps are stated, not run. The Docker tool is installed, but its server is not running.
In this example, the list holds the six routes of the finished app. Six routes are live. The home page lists the books. The book page shows one book. The search page finds books. The gallery shows the covers. The cached page shows the cache. The env page shows the env vars. The app is done, and it serves on plain Node. The Docker image is the next deploy to try, once the Docker server runs.
Note
Next steps: a real database, deeper tests, and a shop.
Try it Yourself
Edit the code, then press Run.
Running is simulated · TypeScript Playground
Exercise
How many routes does the finished Bookshelf serve?