This is a simple Book Management web application built using Node.js, Express.js, PostgreSQL, and EJS as the templating engine.
├── node_modules/
├── public/ # Static assets (CSS, JS, Images)
├── views/ # EJS view templates
│ ├── add.ejs
│ ├── edit.ejs
│ └── index.ejs
├── index.js # Main server file
├── package.json # Project metadata and dependencies
├── package-lock.json
- Add a new book (title, summary)
- View list of all books
- Edit or update book details
- Delete books
- Node.js
- Express.js
- PostgreSQL (with
pgmodule) - EJS for templating
- Bootstrap (optional via CDN for UI)
git clone https://github.com/your-username/book-management-app.git
cd book-management-appnpm installCreate a database named books and a table using:
CREATE TABLE mybooks (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
summary TEXT,
url TEXT
);Update credentials in index.js:
const db = new pg.Client({
user: "your_pg_user",
host: "localhost",
database: "books",
password: "your_pg_password",
port: 5432,
});node index.jsOpen http://localhost:3000 in your browser.
This project is for educational purposes only.