This is a comprehensive backend application for an Online Book Review System built with Node.js and Express.js. The application provides RESTful APIs for managing books, user authentication, and book reviews with support for concurrent user operations.
- β Retrieve list of all available books
- β Search books by ISBN
- β Search books by Author
- β Search books by Title
- β View book reviews
- β User registration
- β User login with JWT authentication
- β Add book reviews (authenticated users only)
- β Modify own book reviews
- β Delete own book reviews
- β Session-based authentication
- β Async/Await implementation for all CRUD operations
- β Promise-based API calls
- β Concurrent user support
- β JWT token-based authentication
- β Session management
- Backend Framework: Express.js
- Runtime: Node.js
- Authentication: JWT (JSON Web Tokens) + Express Sessions
- Async Operations: Promises, Async/Await
- Testing: Postman
expressBookReviews/
βββ final_project/
βββ index.js # Main server file
βββ package.json # Dependencies
βββ booksdb.js # Book database
βββ router/
βββ general.js # Public routes
βββ auth_users.js # Authenticated routes
-
Clone the repository:
git clone https://github.com/allenjose24/expressBookReviews.git cd expressBookReviews/final_project -
Install dependencies:
npm install
-
Start the server:
node index.js
-
Server will run on:
http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get all books |
| GET | /isbn/:isbn |
Get book by ISBN |
| GET | /author/:author |
Get books by author |
| GET | /title/:title |
Get books by title |
| GET | /review/:isbn |
Get book reviews |
| POST | /register |
Register new user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /customer/login |
User login |
| PUT | /customer/auth/review/:isbn?review=<review> |
Add/modify book review |
| DELETE | /customer/auth/review/:isbn |
Delete book review |
POST http://localhost:5000/register
Body (JSON):
{
"username": "testuser",
"password": "testpass"
}
POST http://localhost:5000/customer/login
Body (JSON):
{
"username": "testuser",
"password": "testpass"
}
GET http://localhost:5000/
GET http://localhost:5000/isbn/1
PUT http://localhost:5000/customer/auth/review/1?review=This is a great book!
DELETE http://localhost:5000/customer/auth/review/1
The application comes pre-loaded with 10 classic books:
- Things Fall Apart - Chinua Achebe
- Fairy tales - Hans Christian Andersen
- The Divine Comedy - Dante Alighieri
- The Epic Of Gilgamesh - Unknown
- The Book Of Job - Unknown
- One Thousand and One Nights - Unknown
- NjΓ‘l's Saga - Unknown
- Pride and Prejudice - Jane Austen
- Le Père Goriot - Honoré de Balzac
- Molloy, Malone Dies, The Unnamable, the trilogy - Samuel Beckett
- JWT Tokens: Used for secure authentication
- Session Management: Express sessions for maintaining user state
- Password Protection: Users can only modify/delete their own reviews
- Access Control: Certain endpoints require authentication
All CRUD operations are implemented with:
- Async/Await functions for better performance
- Promise-based operations for non-blocking I/O
- Concurrent user support allowing multiple users simultaneously
- Timeout simulation to demonstrate async behavior
All functionality has been tested and documented with screenshots:
1-getallbooks.png- Get all books2-gedetailsISBN.png- Get book by ISBN3-getbooksbyauthor.png- Get books by author4-getbooksbytitle.png- Get books by title5-getbookreview.png- Get book reviews6-register.png- User registration7-login.png- User login8-reviewadded.png- Add book review9-deletereview.png- Delete book reviewtask10.png- Async implementation (Get all books)task11.png- Promise implementation (Get by ISBN)task12.png- Async implementation (Get by author)task13.png- Async implementation (Get by title)
This project successfully implements all 14 required tasks:
General Users (Tasks 1-5):
- β Task 1: Get book list
- β Task 2: Get books by ISBN
- β Task 3: Get books by Author
- β Task 4: Get books by Title
- β Task 5: Get book reviews
Authentication (Tasks 6-7):
- β Task 6: Register new user
- β Task 7: User login
Registered Users (Tasks 8-9):
- β Task 8: Add/modify book review
- β Task 9: Delete book review
Async Implementation (Tasks 10-13):
- β Task 10: Get all books (Async/Await)
- β Task 11: Search by ISBN (Promises)
- β Task 12: Search by Author (Async/Await)
- β Task 13: Search by Title (Async/Await)
Submission (Task 14):
- β Task 14: GitHub repository submission
This project was developed as part of the IBM Full Stack Software Developer course on Coursera. It demonstrates proficiency in:
- RESTful API development
- Node.js & Express.js framework
- JWT authentication & session management
- Asynchronous JavaScript programming
- Database operations & CRUD functionality
- Testing with Postman
This project is part of the IBM Developer Skills Network educational content.
Developed by: Allen Jose
Course: Developing Backend Apps with Node.js and Express - IBM Coursera
Project: Final Project - Book Review Application