Classical Collection is a web database and web MP3 player specific to Western classical music. It aims to document notable composers of classical music, their works, and serve as a platform to play their works. Kind of like Spotify, but with a more narrowed scope.
This project is my submission for the course CS50 Web Programming in Python and JavaScript offered by Harvard.
Classical Collection has some of its minor concepts inspired from the previous projects, but the overarching concepts are completely unique. It is somewhat a crossover of YouTube and Spotify for music playing and documentation of classical music. It is not an e-commerce website and utilize no relevant concepts to e-commerce except for commenting functions. Similarly, this is not a social network media website except for the commenting and upvoting function which is similar but slightly more complex. In addition, Classical Collection is notably more complex than all of my previous 5 projects. The following are the evidence for this claim:
- The Application has 8 different models. This includes:
- User (entity, for authentication purpose)
- Composer (entity, representing a composer of classical music)
- Piece (entity, representing a classical music composition)
- Favorite (relation, representing a list of user's favorite composer and pieces)
- Period (entity, representing the classical music era the works are written in)
- Difficulty (entity, if applicable for piano, representing how difficult the composition is)
- Comment (relation, representing a comment on each musical piece)
- Upvote (relation, representing likes for comment)
- The application uses HTML, CSS, and JavaScript for front-end user interaction. For the back-end, it uses Django, Python, and SQLite3 database.
- Users can post a classical music composer and post a work of the composer themselves, including a MP3 file for the piece they are uploading which will be controlled and used by the web application to play the music. Users can also choose to add the composers and pieces to their personal favorite or remove them. In each pieces, users have the option to write a comment, read others' comments, edit their comment, or delete their comments (basic CRUD functionalities). In addition, users can filter search a composer or a piece of work, and they can sort the comment by time and upvote for their convenience.
- Good practice of User Interfaces are implemented - with application of the Single-Page-Application principle and usage of Pagination to limit the number of entries shown.
- Utilize good practices of software engineering. This includes:
- Package restructure and organization
- Some adherence to OOP principle and design pattern of SWE
- Code quality
- Unit Testings
- Documentation (through README.md)
- Utilize various advanced and new concepts of Python and Computer Science, such as:
- Regular expression matching
- Similarity ratio
- Prerequisites:
- Have a web browser that supports MP3 reading/loading/playing
- Is connected to the Internet
- Have installed Django and Python to the computer. The application is developed using Python 3.9.5 and Django 3.2.6 and can work on any version higher than that
- Access the inner files of Classical-Collections, run
python manage.py makemigrations
, then runpython manage.py migrate
- Run
python manage.py runserver
, and access the local hosthttp://127.0.0.1:8000
to use the web application
Should there be any problems running the files, please make sure that Django and Python are installed to the system. Alternatively, you can run python3
instead of python
if you are using Linux/Ubuntu.
- Authentication (including password strength check for registration)
- Rule: Password must have at least 8 characters, must not be >90% similar to username, and must contain at least an alphanumeric character and a special character
- Uploading or View a Composer
- Uploading or View a Piece
- Play the MP3 file and controls them by various means (volume, timestamp, downloading, muting...)
- Write, update, and delete comments on each pieces of music
- Upvoting comments
- Filter search a work by period of composition, difficulty, or query
- Filter search a composer or a piece by query
- View, save, or remove favorite composers/pieces from personal list
- View (or edit if have administration access) the descriptions of difficulty or periods of composition
- Adding CI/CD pipeline and utilizing GitHub Actions
- Add more testing (including GUI Web Testing)
- Deployment using Heroku/Netlify or other web-hosting services
- Incorporating Cloud database for media uploading
- More extension features and possible usage of AI/ML
models.py
: Create the models for Django entities and relationsurls.py
: Create the urls for the view of the web application- View files, set on a subdirectory of ClassColl:
Attributes.py
: Deal with the modelPeriod
andDifficulty
and their related viewsAuthentication.py
: Deal with user login, logout, and registration of accountComposers.py
: Deal with the composer pages (all composers, single composers,...)Discussion.py
: Deal with user interaction activities like Comments and UpvoteIndex.py
: Deal with the landing page (home page)Pieces.py
: Deal with the musical work page (list all works and list a single work)UserFavorite.py
: Deal with the favorite works and composers of a user
- Utility files, set on a subdirectory of ClassColl:
ComposerSearch.py
: Search for a composer with the nearest similarity to the user inputPasswordStrength.py
: Assert the minimal strength of a password that user is registering forPieceSearch.py
: Test condition of a piece filtering (by name, period, and difficulty)
- Test files
UserTest.py
: Test authentication and utils of PasswordStrength classComposerTest.py
: Test composer searching and matching of 80% similarityPieceTest.py
: Test matching condition of piece filtering
- All available HTML files:
all_composers.html
: list all composers on the page (with pagination)all_pieces.html
: list all musical works on the page (with pagination)composer.html
: list the details of a composer and his related worksdifficulty.html
: list the difficulty of a musical work by the dropdown select buttonerror.html
: if user search for an invalid query related to composer or piecefavorite.html
: list the user favorite pieces and composersindex.html
: redirect the landing page with the randomized and about contentlayout.html
: the root structure of the HTML content, including a top nav-barlogin.html
: redirect users to a login page to signin the web applicationperiod.html
: list the period of a musical work by the dropdown select buttonpiece.html
: list the details of a piece of music and its comments/upvotesregister.html
: redirect users to a registration page to create a new accountpagination.html
: serves as a common template for pagination purposes
- All available JavaScript files:
all_composers.js
: interact with the all_composers page to hide and show the views when buttons are clickedall_pieces.js
: interact with the all_pieces page to hide and show the views when buttons are clickedcomposer.js
: interact with the button to add favorite, hide and show content as requestedfavorite.js
: interact to show the favorite composers or piecespiece.js
: interact to show the piece, comment, edit comment, delete comment, or upvote a comment as requested...
All sample datas are taken from YouTube and Wikipedia, and I do not own anything. I used the data purely for demonstration and sample purposes, and I do not claim them as my own.
Acknowledgement for the background has been done on the Index page.
Acknowledgement to Adobe Spark for the logo I have created on their platform
Acknowledgement to Django documentations and Python documentations for reference to some concepts I have utilized (Difference Library, Regular Expressions...)