/CO1706-Assignment-2

Interactive Applications Assignment 2

Primary LanguagePHP

CO1706-Assignment-2

By: Cameron Fleming (Nevexo)

This was a university assignment and is now archived, this webapp is a prototype/mock-up music streaming platform, built in PHP with a Bootstrap front-end.

This project is no-longer maintained, the project can be started with docker compose up - the provided SQL file in sql-init will create demo users and populate the database with the provided data automatically.

The following is documentation provided with the final assignment.

Features Implemented

  • Third (40%+)
    • Connects to database with PDO (php/database.php)
    • Logon page (pages/login.php)
    • Homepage displays currently available subscriptions
    • Tracks page (pages/tracks.php)
  • 2:2 (50%+)
    • Session tracking
    • Tracks page displays artwork (pages/tracks.php)
    • HTML5 Player (pages/track.php)
    • Users can browse tracks by genre
    • User greeted on all pages with their username (top right)
    • Validation on all forms
    • 404 Page (.htaccess, pages/404.html)
  • 2:1 (60%+)
    • Registration Page (pages/register.php)
      • Username
        • Duplicates not allowed
      • Password
      • Pricing plan
    • Track information page (pages/track.php)
    • Users can review tracks (pages/track.php + php/reviews.php)
    • HTML/JavaScript form validation on all forms
    • Passwords stored with hashes (php/auth.php)
  • First (70%+)
    • Playlist Function
      • Random selection of tracks
    • Users can browse for music by album and artist
    • Album description page
    • Search page
    • Average review ratings displayed on
      • Tracks page
      • Track information page
      • Playlist page
    • All HTML/CSS passes validation
  • 90%+
    • Recommendation System

Users

Registration is enabled on the Vesta server, so accounts can be created when needed, the following accounts were created for demo purposes and can be logged into.

Username Password Use Case
DemoUser Passw0rd! Testing the platform without creating another user
Bobby EcksMusicBobby A default user account holding a review on track 1
Brendan EcksMusicBrendan A default user account holding reviews on tracks 1 and 61

Running with Docker

This assignment was tested with Docker, using the Dockerfile found in php-image and MariaDB. Run docker-compose up -d from the root directory and navigate to http://localhost

If testing through some other means, it may be necessary to alter the database connection details, these can be found in src/php/vars.php file.

References

All references are cited where they are used.

Bootstrap (CSS Framework)

Used in: All Frontend Pages

Link: https://getbootstrap.com/

Object Sorting with usort - Stackoverflow Answer

Used in: src/php/recommend.php (line 135)

Author: Scott Quinlan

Link: https://stackoverflow.com/questions/4282413/sort-array-of-objects-by-object-fields