top of page

Web application development I sample assignment

Need help with Web Programming Assignment Help or Project Help? At Codersarts we offer 1:1 session with expert, Code mentorship, Course Training, and ongoing development projects. Get help from vetted Machine Learning engineers, mentors, experts, and tutors.


Overview:

Using your knowledge of NodeJS and ExpressJS and the Web App Template provided, complete the Favourite Book List web app that you will share on GitHub and deploy to Heroku (or another cloud provider). Your web app already includes basic navigation controls, a Landing Page, a BookList page and a BookDetails page. Your task is to complete the code that is missing from the routing files and the Books List page so that a user can Add, Delete and Edit any Book item from the Database.

Web application development I sample assignment
Web application development I sample assignment

Project Setup:

  • Rename the Web App Template provided to COMP229-F2020-MidTerm-[YourStudentID]. (e.g. COMP229-W2020-MidTerm-300929668).

  • You will need to create a new Mongo Database on MongoDB Atlas. You will need to change the URI variable in the db config file (config/db.js) to point MongoDB Atlas.

  • You will need to add some example Book data in the database.

Instructions:

  1. The BooksList page (views/books/index.ejs) already lists your favourite books. Your job is to fix the Add Button, and insert the appropriate code for the Edit and Delete Buttons

    1. Fix the Add Button on this page so that it links to the BookDetails page (views/books/details.ejs). Hint: insert the correct route in the href attribute

    2. Add an Edit Button to each row of the existing Table (the insertion point has been marked for you). Ensure that when the user clicks on the Edit button, they are linked to the BookDetails page and the _id of the book they wish to edit is passed to that page via the URL. Hint: the href attribute requires a reference to the _id of the book being edited

    3. Add a Delete Button to each row of the existing Table (the insertion point has been marked for you). Ensure that when the user clicks on the Delete button, that the _id of the book to be deleted is passed to the router. Hint: the href attribute requires both a link to the delete route and a reference to the _id of the book being edited

  2. The Books Routing File (routes/books.js) already has a route working to find all the books in the books collection and render your BooksList page. Your task for this section is to complete the logic for each of the other routes to render the book details page when the Add or Edit Buttons are clicked, process a request to Add or Edit a Book, and process a request to Delete a book

    1. Complete the get('/add') router logic that renders the book details page (views/books/details.ejs). The form on the book details page will initially be blank. You must pass an appropriate value for the title property and blank value for the books property

    2. Complete the post('/add') router logic that processes the insertion of a new book into the database. You need to instantiate an object of the book model (excluding the _id property) and pass this object to the create method of the book model to add a new book to the database. Hint: the values for the book object will come from the name attributes of each field of the book details page. Redirect the user back to the BookList page ('/books') when the insertion is completed

    3. Complete the get('/:id') router logic that renders the book details page (views/books/details.ejs) and uses the id from the URL to select the book to document to be updated. Declare an id variable and set its value to the id property of the request object. Pass this id to the book model’s findById method to render the book details view. You must set an appropriate title property value and set the books property to the book that was returned from the database as you render the view.

    4. Complete the post('/:id') router logic that processes the update request of an existing book by using its id property. Declare an id variable and set its value to the id property of the request object. You need to instantiate an object of the book model (including the _id property) and pass this object to the update method of the book model to edit an existing book in the database. Hint: the values for the book object will come from the name attributes of each field of the book details page. Redirect the user back to the BookList page ('/books') when the update is completed

    5. Complete the get('/delete/:id') router logic that processes the user’s delete request and removes an existing book from database by using its id property. Declare an id variable and set its value to the id property of the request object. Pass the id to the book model’s remove method. Redirect the user back to the BookList page ('/books') when the removal is completed

  3. Include Internal Documentation for your site

    1. Ensure you include a comment header for your JavaScript file that indicate: The File name, Author's name, StudentID, and Web App name

    2. Ensure you include a section header for any JavaScript functions

    3. Ensure all your code uses contextual variable names that help make the files humanreadable

    4. Ensure you include inline comments that describe your GUI Design and Functionality. Note: Please avoid “over-commenting”

  4. Share your files on GitHub to demonstrate Version Control Best Practices and push your site to a cloud host

    1. Your repository must include your code and be well structured

    2. Your repository must include commits that demonstrate the project being updated at different stages of development – each time a major change is implemented

    3. You must deploy your site to your Cloud Server using git

  5. Create a Short Video presentation on YouTube or another streaming provider. You must include a short PowerPoint (or Google Slides) Slide Deck that includes a single slide to start your video

    1. The first (and only) Slide of your Slide Deck must include a current image of you (no avatars allowed) that is displayed appropriately on the page. You must also include your Full Name, Student ID, the Course Code, Course Name, and your Assignment information.

    2. You will demonstrate your site’s functionality. You must show each page working properly

    3. You will describe the code in your app.js file that drives the functionality of your site

    4. Sound for your Video must at an appropriate level so that your voice may be clearly heard, and your screen resolution should be set so that your code and site details are clearly visible

    5. Your Short Video should run no more than 5 minutes



bottom of page