The Book Notes App is a full-stack CRUD application designed for managing your reading collection and notes. Users can add, edit, view, and delete notes for their favorite books. The application fetches book covers and metadata from OpenLibrary API to provide a rich visual experience.
- Create: Add new book notes with details such as title, author, rating, review, and date read.
- Read: View a list of all book notes with book covers from OpenLibrary.
- Update: Edit existing book notes to update any information.
- Delete: Remove book notes that are no longer needed.
- Star Rating System: Interactive 5-star rating system for books.
- Book Covers: Automatic fetching of book covers using OpenLibrary's API.
- Responsive Design: Mobile-friendly interface that works on various screen sizes.
- Enhanced UI: Visual hover effects on clickable elements for better user experience.
- Auto-scroll: Automatically scrolls to newly added books for a better user experience.
- Backend: Node.js, Express.js
- Database: PostgreSQL
- Frontend: EJS (Embedded JavaScript) for templating, CSS, JavaScript
- API Integration: OpenLibrary API for book metadata and covers
- Other: Axios for HTTP requests, Method-override for RESTful routes
book-notes-app
├── public
│ ├── css
│ │ └── styles.css
│ ├── js
│ │ └── scripts.js
│ └── images
├── views
│ ├── partials
│ │ ├── header.ejs
│ │ ├── navbar.ejs
│ │ └── footer.ejs
│ ├── index.ejs
│ ├── books.ejs
│ ├── add-book.ejs
│ ├── edit-book.ejs
│ └── about.ejs
├── app.js
├── package.json
├── README.md
├── .gitignore
└── .envmock
- Clone the repository:
git clone <repository-url> - Navigate to the project directory:
cd book-notes-app - Install the dependencies:
npm install - Create a PostgreSQL database for the application.
- Create a
.envfile based on.envmockwith your database credentials:DB_USER=your_username DB_HOST=localhost DB_NAME=your_database_name DB_PASSWORD=your_password DB_PORT=5432 PORT=3000
Create a books table in your PostgreSQL database:
CREATE TABLE books (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(255) NOT NULL,
rating INTEGER NOT NULL,
review TEXT,
date_read DATE,
olid VARCHAR(255)
);- Start the server:
Or for development with auto-reload:
npm startnpm run dev - Open your browser and go to
http://localhost:3000to access the application.
The app uses the OpenLibrary API to fetch book covers based on the title and author. If a match is found, the book's cover is displayed; otherwise, a placeholder image is shown.
An interactive 5-star rating system allows users to rate books on a scale of 1 to 5. The UI updates dynamically as users interact with the stars.
The application is fully responsive and provides an optimal viewing experience across a wide range of devices.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
This project is licensed under the MIT License.
- OpenLibrary API for providing book metadata and cover images
- Font Awesome for the icons used throughout the application