How chrisblakely01/docker-nodejs-demo works
This is a Docker-oriented Node.js demo whose runtime product is a book catalog plus a loan service that enriches loan records with book details. The main workflow is: a client requests loans, the loan service fetches books from the book service, and returns matched loan/book details. The catalog reads MongoDB and seeds initial records when the database is empty. The README documents Nginx, container networking, and database-in-container capabilities; their exact configuration wiring is not established by the sampled source.
Main entry points: src/index.js Book service · src/index.js Loan service · nginx.conf Nginx · bookModel.js Book model
Components 8
Book catalog
- Book service
book-service/src/index.js - Book model
book-service/src/models/bookModel.js - Database startup
book-service/src/db/db.js
Loan enrichment
- Loan service
loan-service/src/index.js - Loan records
loan-service/src/index.js
Container networking
- Nginx
nginx.conf
Other components
- Client
- MongoDB
Connections 12
- Client → Nginx: sends requests
- Nginx → Book service: routes requests
- Nginx → Loan service: routes requests
- Client → Book service: requests books
- Book service → Book model: queries books
- Book model → MongoDB: reads records
- Book service → Database startup: starts database
- Database startup → MongoDB: connects and seeds
- Loan service → Loan records: matches loans
- Loan service → Book service: fetches books
- Loan service → Client: returns loan details
- Book service → Client: returns books