Skip to content
ZeroAsadPublic

About

Bookstore Project (Node.js)

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Bookstore - Simple Node.js / Express Project

This is a ready-to-run project for a coursework assignment (in-memory data).

Features

  • General routes (no login): list books, search by ISBN, author, title, get reviews.
  • User routes (requires username+password in request body for protected actions): add/update/delete reviews.
  • Axios client with async/await and Promises for Tasks 10-13.

How to run

  1. Install dependencies:
    npm install
    
  2. Start the server:
    npm start
    
  3. Server runs on port 3000 by default.

API Endpoints

  • GET /general/books — Get all books
  • GET /general/isbn/:isbn — Get book by ISBN
  • GET /general/author/:author — Get books by author
  • GET /general/title/:title — Get books by title
  • GET /general/review/:isbn — Get reviews for a book
  • POST /general/register — Register (body: { username, password })
  • POST /general/login — Login (body: { username, password })
  • PUT /user/review/:isbn — Add/Modify review (body: { username, password, review })
  • DELETE /user/review/:isbn — Delete review (body: { username, password })

Client (Tasks 10-13)

  • client/node_client.js contains functions using axios:
    • getAllBooks() — async/await
    • getBookByISBN(isbn) — Promises
    • getBooksByAuthor(author) — async/await
    • getBooksByTitle(title) — async/await

Notes

  • Data is stored in-memory. Restarting the server will reset books/users/reviews.

About

Bookstore Project (Node.js)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages