"As a student in CS 460 who is preparing for the final exam, I wish to create a complex web application from scratch -- including database, CRUD functionality and some AJAX -- so that I can practice and get a good grade on the exam."
This assignment is based off last years CS 460 Programming Final Exam.
You are to build a demonstration site where buyers and sellers can connect and items can be sold. There are Buyers. They visit the site to make Bids on Items that have been put up for sale by Sellers. Please read the entire assignment and then complete or implement each of the following:
[Modeling & Design] Begin with the domain model. There are four entities: Buyer, Seller, Item and Bid. This page explains the relations between entities and provides seed data. All relations must be present as named constraints in your database schema. Generate an E-R diagram of your database schema to include in your portfolio.
Write an UP script (in App_Data/up.sql) to create the database and a DOWN script (in App_Data/down.sql) to delete all tables.
Build the database.
[Content/Coding] Create a welcome page with the title, Reginald's Ancient Antiquities Auction House, and a menu/navbar that is shared among all pages. Later questions will have you add things to this menu.
[Content/Coding] Implement CRUD functionality for Items and place a menu item on the main menu/navbar to the list page. Items are identified to all parties by their ID. Items are for sale by a Seller, who has a name. It is important for these views to correctly show/handle the item ID, name and seller's name.
Here are the 5 parts needed:
[Content/Coding] Add a Create page for Bids and place a link to it on the main menu/navbar. This is only a create page, nothing else. The user, acting as a Buyer, should be able to select which buyer they are, the item they are bidding on and set their bid price. They should not be able to set the timestamp for the bid -- that must be set by the server to be the current time when the bid was submitted.
There must not be any way to delete or edit Bids. Once a bid is placed, it is final.
Add a button to the welcome page that says Bid on an Item! Clicking on that button should take the user to this create a bid page.
[Content/Coding] Watch bidding feature: add functionality to the Item details page that displays all bids for this item in a list or table, in descending order by price. For each bid you must show the buyer's name and bid price. You must retrieve and display this data using AJAX. It should update automatically every 5 seconds (see: MDN::setInterval()) without reloading the page.
var ajax_call = function() {
//your jQuery ajax code
};
var interval = 1000 * X; // where X is your timer interval in X seconds
window.setInterval(ajax_call, interval);
[Content/Coding] Add a list or table to the home page that shows the most recent 10 bids across all items, ordered chronologically. For each bid you should show the Item ID, Item Name (which should be a link to the item details page), Buyer's Name, Bid Amount and the Bid timestamp. Format the timestamp so that if it was bid today then show only the time. If it was older than that, show the date as well. (Assume everyone is in the same timezone and it's whatever time you're using.)