A full-stack web application for browsing a curated collection of books. Built with a React frontend and a Node.js/Express backend backed by PostgreSQL.
| Layer | Technology |
|---|---|
| Frontend | React, React Router |
| Backend | Node.js, Express |
| Database | PostgreSQL |
| Containerization | Docker, Docker Compose |
The easiest way to run the full stack is with Docker Compose. This starts the React client, Express server, and a PostgreSQL database together.
Start all services:
npm run docker:startApp URLs:
- Client: http://localhost:3000
- Server: http://localhost:5001
- PostgreSQL:
localhost:5432— user:books, password:books, db:booksdb
Stop services:
npm run docker:stopTear down (including volumes):
npm run docker:downRun the server and client independently without Docker.
cd server
npm install
npm test
npm startThe server runs on http://localhost:5000.
cd client
npm install
npm test
npm startThe client runs on http://localhost:3000.
Run the full stack with file watching enabled so code changes apply automatically — no container rebuilds needed.
npm run docker:dev:startThis enables:
- Client — React fast refresh via
react-scripts - Server — automatic restart via
nodemon
Stop dev mode:
npm run docker:dev:downStream logs:
npm run docker:logsOn startup, the server automatically creates the books table and seeds it from server/db/seeds/books.json if the table is empty.
To disable auto-seeding, set the environment variable:
BOOKS_AUTO_SEED=false
To seed manually:
cd server
npm run db:seed| Method | Endpoint | Description |
|---|---|---|
GET |
/books/:id |
Fetch a book by ID |