Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment 1 - Watch Pit Overview This is an individual assignment in which you are required to develop a dynamic web application as described below. Important: This assignment speciļ¬cation is...

1 answer below Ā»
Assignment 1 - Watch Pit
Overview
This is an individual assignment in which you are required to develop a dynamic web application as described below.
Important: This assignment speciļ¬cation is generated just for student id XXXXXXXXXXDo not distribute this speciļ¬cation.
Timelines and Expectations
Percentage value of task: 20%
Due: Refer to Course Description
Assessment Details
For this assignment, you will create an online marketplace - a bit like Facebook Marketplace or eBay.
Your marketplace, Watch Pit is dedicated to community members selling or exchanging watches with other local members.
Users can create accounts,
owser watches that are up for sale or exchange, make an oļ¬€er, and message the winner to a
ange the exchange.
You must implement this platform using PHP and MySQL or MariaDB, with some JavaScript for validation.
Database Structure
The web application uses a relational database. The database has the following structure: User ( id, name, email, password, location )
Watch ( id, user_id, title, description, seeking, submitted )
Oļ¬€er (id, user_id, watch_id, oļ¬€er, accepted, submitted) Message (id, from_user_id, to_user_id, oļ¬€er_id, sent, text)
(
Page
2
of 6
)
    Watch
    PK
    id
    FK
    user_id title description seeking submitted
(
PK
from_user_id to_user_id oļ¬€er_id
sent
text
FK FK FK
id
PK
Message
name email password location
id
Use
user_id watch_id
oļ¬€er accepted submitted
FK FK
id
PK
Oļ¬€e
)Primary keys are indicated with underlines or bold formatting, and foreign keys are italicized.
Each record in the User table represents a member of the site. Members can add watches to the site, and review and make oļ¬€ers on the watches added by others.
Each record in the Watch table represents a watch that a user has put up for sale or exchange. The
Seeking ļ¬eld is free text and indicates what the user is willing to accept in exchange for the item.
The Offer table stores oļ¬€ers made by other users for a particular watch. Users may make multiple oļ¬€ers for a single item.
Finally, Watch Pit should allow members to send messages to each other to a
ange the exchange. The Message table tracks messages sent between members about a particular oļ¬€er, along with the date and time that the message was sent.
The following constraints should be applied when implementing the application:
The User password ļ¬eld should be a VARCHAR of 255 characters. The name, email, and location
ļ¬elds should be VARCHAR of a length that you determine to be reasonable and suļ¬ƒcient; The Message.text and Offer.offer ļ¬elds may be either VARCHAR or TEXT.
The Watch.submitted, Offer.submitted, and Message.sent ļ¬elds should all be be MySQL
TIMESTAMPs.
The Watch.accepted ļ¬eld can be either a Boolean indicating whether this oļ¬€er was successful, or a nullable TIMESTAMP indicating when the oļ¬€er was accepted.
Only one oļ¬€er may be accepted per watch - this is not enforced by the database design but must be enforced by the application. You may change the schema to make it enforced by the database if you prefer.
Please note that you are free to extend this database schema if required.
Initial Data
When the database is created, it should be populated with data of your own invention, appropriate to the theme (keep it clean).
You should have at least:
5 users;
3 watches;
5 oļ¬€ers, at least one of which is submitted by the tutor user, and accepted by the seller; and
3 messages about a single accepted oļ¬€e
One of the users must be you (even if you are not interested in watches). Use your student id XXXXXXXXXXfor the username, and your real name and email address.
One of your users must have the username tutor and the password guest.
Invent other users as necessary - perhaps use characters from your favourite movie or band.
Include this data as part of your written report.
Database creation DDL
Create a single SQL ļ¬le that creates the MySQL database, creates the four tables above, and populates them with your initial data.
Use your student id and course code as the database name as follows:
ITECH3108_30350334_A1.
Passwords should be hashed using, at minimum, the crypt() PHP function. Prefer to use the PHP
password_hash() function to generate password hashes.
For the password 'guest', the following hash may be used in your database:
PASSWORD = '$2y$10$123433053030000999999uvsd9CTrKeo.85rl8emhkj5XSAHZbSLe'
It is acceptable for all initial users to share the same password for testing.
Use of MD5 or SHA1/2 for password hashes is not acceptable.
Write SQL queries that display all of the initial data using SELECT statements, and list these queries in your report.
User accounts
Write PHP and HTML to allow new users to sign up. The form should request a username, email address and password. The password must be hashed before storing it in the database.
Using PHP, validate that the username is unique, and the password is at least 5 characters (before hashing).
Write PHP code to allow users to log in and log out. This will require the use of sessions and/or cookies.
Viewing items
Write PHP and HTML to allow users to view a list of all items cu
ently oļ¬€ered, including any oļ¬€ers made for each. The list should be sorted so the most recent items are listed ļ¬rst.
Watches with accepted oļ¬€ers should still be displayed, but highlighted in some way, including highlighting the successful oļ¬€er.
You may implement this using whatever User Interface approach makes sense to you.
Making and Accepting Oļ¬€ers
Write PHP and HTML that allows users to make an oļ¬€er on a particular watch. This should only work on items that don't have accepted oļ¬€ers.
Users should be able to review oļ¬€ers made on their watches, and accept one.
Messages
Write PHP and HTML to allow the users in an accepted exchange to message each other.
Create a messages page that displays the messages sent and received by the logged-in user, including the date and time for each message.
Aggregate data
Create a page that displays the following information, using SQL aggregation such as COUNT and SUM, subqueries or nested SELECT statements, inner joins and (left or right) outer joins.
The total number of watches on the site;
The top 3 most-wanted watches, ordered in descending order by number of oļ¬€ers made;
Bonus challenge task (optional!) - Moderation
Extend the data model and write code to implement moderation features:
Users can report users for violating site rules (for example, by posting inappropriate oļ¬€ers);
A moderator can review reported users, sorted by number of reports, weighted by the reporting user's
eputation (descending order)
Users found to be in violation of site rules should have their accounts disabled, but should not be deleted Users who inco
ectly report users for being in violation when they are not should have reputation reduced, so their reports are less important in future
Users who co
ectly report other users should have their reputation increased, so their reports are more
important in future
There are no partial marks awarded for this bonus task ā€“ you must complete all features to attain the bonus marks.
It is possible to attain full marks for this assignment without completing this challenge task.
Further details
Documentation
Include a written report containing:
The SQL queries you used to test your database
A list of parts of the assignment you have completed or not completed.
Details of speciļ¬c assistance you received from people other than your lecturer or tutor, and the names of those assisting.
Anything interesting or cool you'd like to draw your marker's attention to.
Assignment support
This assignment is supported by the ļ¬rst 5 lectures and the ļ¬rst 6 labs. Work on the assignment should be spread over several weeks after the relevant lab has been mastered.
Submission
All ļ¬les should be submitted to Moodle by the due date and time. Check with your tutor as to whether a hard copy is required in addition to the electronic submission.
Marking Criteria/Ru
ic
Refer to the attached marking guide.
Plagiarism
Plagiarism is the presentation of the expressed thought or work of another person as though it is one's own without properly acknowledging that person. You must not allow other students to copy your work and must take care to safeguard against this happening.
Marking Guide: Assignment 1
    Feature
    Criteria
    Maximum
    Obtained
    Initial data
    Requirements satisļ¬ed
    1
    
    
Creating the database
    Table structure, data types, ļ¬eld lengths, initial data entry
    
1
    
    
User accounts
    Account sign-up
    1
    
    
    Validation that password meets complexity requirements (at least 5 characters)
    
1
    
    
    Log in and Log out
    1
    
    
    Inappropriate password hashing (MD5, SHA1 or plain-text passwords)
    
(-2)
    
    
Viewing items
    List of all items
    2
    
    
    Unavailable and accepted oļ¬€ers indicated
    1
    
    
Making oļ¬€ers
    Users can make an oļ¬€er on an item
    2
    
    
    Oļ¬€ers only on available items
    1
    
    
    Users can review oļ¬€ers made on their items
    2
    
    
Messages
    Send a message to a use
    2
    
    
    List messages from other users
    2
    
    
Aggregate data
    Total items on the site
    1
    
    
    Top three most-wanted items
    1
    
    Bonus optional task - Moderation
    Meets speciļ¬cation (user report, moderator list, reputation system) (no partial marks)
    
(+3)
    
    
Documentation
    Initial data and test queries
    1
    
    
    Completion of tasks, Assistance statement (lose 1 mark each if not included)
    
(-2)
    
    
Quality of code
    Layout, structure, indentation
    (-1)
    
    
    Appropriate and consistent naming scheme
    (-1)
    
    
    Valid HTML5
    (-1)
    
    Total:
    20
Answered Same Day Sep 12, 2021

Solution

Sanghamitra answered on Sep 17 2021
162 Votes
INstructions
The SQL queries you used to test your database
select * from watch;
select * from offer;
select * from message;
select * from user;
A list of parts of the assignment you have completed or not completed.
Bonus part which is optional not completed
Details of speciļ¬c assistance you...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions Ā»

Submit New Assignment

Copy and Paste Your Assignment Here