Web ICP7 - abndnc/CS5590-0003 GitHub Wiki
Source Code: https://umkc.box.com/s/krfazbaxrjs08uqvh8gclejxgpauku22
Instructions to execute Source Code: LibraryManagementSystem
Step 1: Start the Mongo Server(Refer Installation PPT)
Step 2:Install node modules (command: 'npm install')
Step 3: Start node server (command: 'npm run start')
Step 4: Navigate to localhost (http://localhost:3000/) to display and interact with the application
In Class Programming (ICP):In the above use case, implement update and delete functionality (user should able to update the book details and delete the book from the database)
Implementation: To finish the back-end, two additional functions, update book(allow users to edit the book information) and delete book(allow users to delete the book information from the list), were added into router book.js.
The main page displays the list of the books that are stored in the database by using getBook() function. It is also linked to book-create page.
All the users' inputs are stored in bookForm. form() getter is used to manipulate the data between inputs and bookForm. onSubmit() function is used to check the validation of the datas and upload the information into the gallery if they are valid. onReset() is used to reset all the information if users want to redo everything.
In book-detail page, getbookDetails() function is used to display the book information. deleteBook() function is used to delete all the book information from the database.
Most of the book-edit structure is identical to the book-create but deleteBook() function is needed to delete old books' information and replace the new one in the database.
Output: