CS 257: Software Design

Web application: first draft

Folder: webapp

Goals

Create a functional first draft of your web application's:

Your classmates will provide feedback on this draft, which should help you polish your final submission.

Rubric

1 readme.txt lists the features that are working, and those that are not 1 - data.sql loads into an empty database without error 1 - the app runs, and has an /api/help endpoint (see below) 2 - the API endpoints respond as described in the /api/help output 2 - the / endpoint takes a browser to your home page 5 - evidence of a good-faith effort to produce a functional first draft with core functionality working; users can search for something and get intelligible results; navigation makes sense; etc. (see below)

Note that "code quality" is not in this rubric. The grader won't look at your code unless the app fails to function. However, in the code review involving this first draft, your classmates and I will absolutely look at your code, so you might as well think about code quality now anyway, since it will receive a bunch of rubric points on the final submission. (Also, because you have pride in your work.)

Your tasks

How we will test this draft

You can replicate the following steps to ensure that everything will work for me, the grader, and your classmates.

Sample API documentation

Suppose I'm doing a books/authors API. I like to have documentation with REQUEST (including GET parameters), RESPONSE, and EXAMPLES. Like this.

REQUEST: /authors GET parameters search_text (Optional, default: '') -- return only authors whose first or last names contain search_text, case-insensitively start_year (Optional, default: -infinity) -- return only authors who were born no earlier than start_year end_year (Optional, default: -infinity) -- return only authors who died no later than end_year RESPONSE: a JSON list of dictionaries, each of which represents one author, sorted alphabetically by last name (and sorted alphabetically by first name when last names are equal). Each dictionary in this list will have the following fields. last_name -- (TEXT) the author's last or family name first_name -- (TEXT) the author's first or given name or names birth_year -- (INTEGER) the year the author was born death_year -- (INTEGER) the year the author died (or 'NULL' if still alive) EXAMPLE(S): /authors?search_text=bront&start_year=1817 [{'last_name':'Brontë', 'first_name':'Ann', birth_year:1820, death_year:1849}, {'last_name':'Brontë', 'first_name':'Emily', birth_year:1818, death_year:1848}] (no Charlotte, since she was born in 1816)

Have fun!