In completing this assignment you MAY use/access the following resources:
You may NOT use/access:
- Resources not expressly listed above, including, but not limited to,
the following ...
- Source code not provided as part of this assignment. (Obviously, this
includes, but is not limited to, source code written by other students
whether current or in the past).
- Code-generating tools (of which ChatGPT is one example).
- Any web sites not directly linked to from the homework assignment.
Failure to abide by these guidelines will result in a zero for the assignment
and the incident will be reported to the university provost as a violation of
the university academic integrity policy. A second incident of academic
dishonesty (whether from this course or another computer science course) will
result in an F in the course.
For this assignment you will create a static book seller's site built using the
NodeJS template from the previous assignment. Since the site will be static we
will not be utilizing models or any database code. You will simply put a couple
of hard-coded entries on pages as placeholders for data that normally would have
come from the database.
Do your work in a directory called hw13 in the repository you shared
with the instructor in the previous assignment.
Your completed assignment should make use of the EJS templating system for
views and you should utilize a layout that has a header document and a
footer document. The header document should generate the everything up to and
including the menu of your application. The footer should contain whatever
elements are common to the bottom section of all pages in your application.
Of course have the title will need to parameterized in the head. Depending
on how your menu works you may need to pass additional parameters to identify
which menu item is to be highlighted.
Your application should provide the following pages, all of which will import
the header and footer just described:
- index displays the home page which contains a list of book (you'll
just hard-code a couple of books formatted in an attractive way).
- add-book displays a form that allows a new book to be added
- book-detail displays all information about a particular book along
with a delete button and a modify button
- login provides a login form
- signup provides a registration form
- error displays error messages according to the type of error (which
is passed as a query parameter)
You might consider using the HTML/CSS from the pages built in homework 5 as a
starting point for your templates and views.
Some additional requirements:
- Your CSS and client-side JS assets should be served from the public
directory in accordance with the design of the previous homework.
- You should separate authentication routes and controllers from book
routes and controllers.
- Your solution should be built from the template you built in the previous
assignment.
- The error controller function should handle the following types of errors:
unexpected errors, book-not-found errors, invalid-book-id errors.
Make sure that your assignment has been pushed to the bitbucket repository you
shared with the instructor in the previous assignment.