A full-stack Book Tracker web application built with Node.js, Express.js, PostgreSQL, EJS, HTML, and CSS. The application allows users to maintain a personal reading journal by adding books, rating them, writing notes, and managing their reading history. Book covers are automatically fetched using the Open Library Covers API based on the ISBN number.
- 📖 Add new books with complete details
- ⭐ Rate books from 1 to 5
- 📝 Save personal notes and reviews
- 📅 Record the date a book was read
- 🔢 Store ISBN numbers
- 🖼️ Automatically display book covers using ISBN
- ✏️ Update book ratings and notes
- 🗑️ Delete books from the collection
- 📊 Display books sorted by highest rating
- 💾 Store all data in PostgreSQL
- 🎨 Clean and responsive user interface
- HTML5
- CSS3
- EJS
- Node.js
- Express.js
- Body Parser
- PostgreSQL
- Open Library Covers API
Book-Tracker/
│
├── public/
│ └── styles.css
│
├── views/
│ └── index.ejs
│
├── index.js
├── package.json
├── package-lock.json
└── README.md
git clone https://github.com/yourusername/book-tracker.gitcd book-trackernpm installCREATE DATABASE "My books";Create the table:
CREATE TABLE book (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(255),
rating INTEGER,
date_read DATE,
isbn VARCHAR(20),
notes TEXT
);Update the PostgreSQL connection in index.js.
const db = new pg.Client({
user: "postgres",
host: "localhost",
database: "My books",
password: "your_password",
port: 5432
});node index.jsor
nodemon index.jsVisit:
http://localhost:3000
Displays all books stored in the PostgreSQL database.
Books are automatically sorted by highest rating.
Users can add:
- Book Title
- Author Name
- Rating
- Date Read
- ISBN Number
- Personal Notes
The information is stored in PostgreSQL.
The application automatically loads the book cover using the ISBN.
Example:
https://covers.openlibrary.org/b/isbn/9781612620244-M.jpg
Users can update:
- Rating
- Notes
Changes are immediately saved to the database.
Books can be permanently removed from the collection.
| Column | Type |
|---|---|
| id | SERIAL PRIMARY KEY |
| title | VARCHAR(255) |
| author | VARCHAR(255) |
| rating | INTEGER |
| date_read | DATE |
| isbn | VARCHAR(20) |
| notes | TEXT |
Add
screenshots/
│
├── home.png
├── add-book.png
├── edit-book.png
└── delete-book.png
{
"dependencies": {
"axios": "^1.x",
"body-parser": "^1.x",
"ejs": "^3.x",
"express": "^4.x",
"pg": "^8.x"
}
}- Responsive layout
- Card-based design
- Automatic book cover preview
- Beautiful color palette
- Easy-to-use forms
- Smooth hover animations
- 🔍 Search books by title
- 📚 Filter by author or rating
- ❤️ Favorite books
- 🌙 Dark Mode
- 📱 Better mobile responsiveness
- 🔐 User authentication
- ☁️ Deploy to Render/Railway
- 📈 Reading statistics dashboard
- 📄 Export books to PDF or CSV
- 🌐 Fetch complete book details from Open Library API
Current code has a small issue in the delete route.
Current query:
DELETE FROM books WHERE id = $1;Correct query:
DELETE FROM book WHERE id = $1;Also, make sure the Edit form is properly closed before starting the Delete form in index.ejs.
Rahul Pawar
Engineering Student | Full Stack Web Developer
This project is licensed under the MIT License.
⭐ If you found this project helpful, don't forget to Star the repository!