Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HTMelodies

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Jordan Jordan
July 19, 2022
5

 HTMelodies

Avatar for Jordan

Jordan

July 19, 2022

Transcript

  1. Use Cases Applications of HTMelodies HTMelodies collects and presents information

    about songs, albums, and artists in a convenient, aesthetically pleasing way for users to consume. Users can search for their interests or explore new content.
  2. Use Cases: Search for interests Users search for songs, albums,

    and artists they are already interested in using the global search tool. The local search feature allows users to filter for characteristics of songs, albums, and artists that they find appealing (i.e. genre, popularity). Ex) Global Search “Dra” Ex) Local Search Song with Album name “By”
  3. Use Cases: Explore new content The content pages display data

    from Billboard’s Top 100 songs and their corresponding albums and artists. Each song, album, and artist details page contains links to other pages with related content. Links: Artists: Quavo, Takeoff Album: Hotel Lobby
  4. Project Statistics and Build • Commits: 1014 ◦ Generally noticed

    phase 3 had the most commits • Closed Issues: 54 • Open Issues: 2 • Unit Tests: 36 ◦ 7 Database unit tests ◦ 29 API unit tests • Could have been better with creating more issues and tests, but we did well on the commits • Used makefile to summarize project build commands ◦ Continuous integration ◦ Local testing and GCP deployment • Used two GCP servers for frontend and backend deployment ◦ requirements.txt, app.yaml • Customize jobs on GitLab pipeline using .gitlab-ci.yml
  5. Communication Discord Server • Formated to simulate physical workplace ◦

    Retains benefits of in-person collaboration while eliminating some negatives • Dedicated text channels for relevant information ◦ Keeps everything organized ◦ Memos are easy to send and find • Screen sharing / VSCode Live Share ◦ Pair/Simultaneous programing GitLab Integration • Event notifications in real time ◦ Commits/Pushes ◦ Pipeline Status ◦ Wiki Edits • Event history
  6. Figma • Mainly used for initial website design • Lets

    you add various web dev components ◦ Navbar, buttons, backgrounds, etc..
  7. HTML index.html <div class="collapse navbar-collapse" id="navbarNavAltMarkup"> <div class="navbar-nav ms-auto me-5">

    <a class="nav-link text-white" href="{{url_for('index')}}"><strong>Main Menu</strong></a> <a class="nav-link text-white" href="{{url_for('songs')}}"><strong>Songs</strong></a> <a class="nav-link text-white" href="{{url_for('albums')}}"><strong>Albums</strong></a> <a class="nav-link text-white" href="{{url_for('artists')}}"><strong>Artists</strong></a> <a class="nav-link text-white" href="{{url_for('about')}}"><strong>About</strong></a> </div> </div> index.js RouteSwitch.js App.js Splash.js NavBar.js Phase II & III: Dynamic Components NavBar.js const NavBar = (navBar) => { return ( <nav className="navbar sticky-top navbar-dark navbar-expand-lg" style={{backgroundColor: "black"}}> … <div className="collapse navbar-collapse" id="navbarNavAltMarkup"> <div className="navbar-nav ms-auto me-5"> {navBar.pages.map(page => { return ( <Link to={page[“Path”])} className="nav-link text-white"<strong>{page[“Title”]}</strong></Link> ) })} </div> </div> </nav> ) } export default NavBar; Phase I: Static Templates React Router
  8. CSS • Used in various places to improve design of

    barebone HTML elements • Used to implement typing animation on Splash page • Used to apply smooth transitions for the background carousel displayed on the songs, albums, and artists pages BackgroundSplash.css .typing::before { animation: cursorBlink 1s steps(3) infinite; } @keyframes cursorBlink { 0%, 75% { opacity: 1; } 76%, 100% { opacity: 0; } } .typing h1 { animation: type 5s steps(14); } @keyframes type { 30% { width: 367px; } 0% { width: 0px; } }
  9. Bootstrap • Main framework for website UI ◦ Essentially combines

    HTML and CSS for seamless integration ◦ Very simple to incorporate: ▪ <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> • All of the pages and their respective components were basically designed using Bootstrap ◦ Compatibility across device sizes using grid system ◦ Accordions, carousels, nav bar, pagination (design only), tables • Used in conjunction with React to create the frontend
  10. React • Object-oriented design and navigation in the frontend •

    React components enable code reusability • To receive information from backend: ◦ axios, useState, useEffect (with dependencies) about.json { “Website”: “HTMelodies”. … “UMLDiagram”: “UML_Diagram.png” } main.py @app.route(‘/about/’) def about(): about_page ={} with open(“data/about.json”) as json_file: about_page = json.load(json_file) return jsonify(about_page) About.js const About = about => { const [web, setWeb] = useState(“”) const [uml, selUml] = useState(“”) useEffect(() => { axios.get(API + ‘/about/’) .then(res => { setWeb(res.data[“Website”]) setUml(res.data[“UMLDiagram”]) }) .catch(err => console.log(err)) }, []) } export default About; Backend Flask Frontend React
  11. Frontend • Navigation ◦ Using React Router • Table Sorting

    • Table Pagination • Visualizations Functionality
  12. Navigation • Implemented navigation bar using Bootstrap libraries <nav className="navbar

    sticky-top navbar-dark navbar-expand-lg" style={{backgroundColor: "black"}}> • Implemented scroll wheel navigation to icons Scroll wheel navigation <a href="#icons"><img data-mdb-toggle="animation" data-mdb-animation-start="onHover" src={bgSplash.pic} … /></a> <div className="bg-white" style={{height: "44vh"}} id="icons"> Icons <img src={pic["Link"]} className="img-fluid" alt=""></img>
  13. Using React Router • Bind our components to API endpoints

    in RouteSwitch.js using Route components • Use Link components to navigate within our components index.js RouteSwitch.js NavBar.js
  14. Table Sorting • Done through Kryogenix JavaScript Library ◦ <script

    src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script> • Allows for ascending and descending order for any category ◦ Lexicographical order for strings ◦ Numeric order for ints and times
  15. Table Pagination • Mainly done in the frontend ◦ Allows

    for faster loading of pages (only one API request needed) • Pagination occurs after any filtering and searching in the backend • Generates pages based on the number of items ◦ 10 items per page
  16. Frontend • What did we do well? • What can

    we do better? • What did we learn? • What puzzles us? Critique
  17. What did we do well? • Website name • Did

    very well with the aesthetic ◦ Using various components ◦ Consistent color schemes and models ◦ Flexible pages ◦ Formatting tables • Meeting deadlines ◦ Able to fulfill all of the requirements in the project specifications • Using components efficiently ◦ Organized extremely well ◦ Lended to reusability What can we do better? • Could have made the sorting feature more explicit ◦ Have to click on the headers of the table • Incorporate more diverse visualizations • Add genre page to allow for more exploration ◦ Could link to genre page from artist details page
  18. • How to incorporate pagination with backend in a more

    efficient manner ◦ Currently, we are only using frontend ◦ Backend requires too many API calls ◦ Is there a better way of accomplishing this with the both frontend and backend? • Bubble chart visualization ◦ Component didn't mount error • Bootstrap buttons are not very customizable unless you do it yourself What puzzles us? • Never had previous experience with software engineering ◦ Learned about the concept of the development stack • Learned a lot about the general structure of web development ◦ How it all comes together • Using ReactJS and Bootstrap ◦ Incorporating HTML, CSS, and Javascript ◦ React-router What did we learn?
  19. Backend • Data Collection • Database Implementation • API Implementation

    ◦ Local Filtering ◦ Global Searching • Postman Documentation • Postman Tests • Unittests Functionality
  20. Data Collection Tools • Python • Public APIs ◦ Spotify

    Web API ◦ Napster API • Song Data • Artist Data • Album Data Album Name Album Data Song/Artist Data Playlist ID
  21. Database • Worked closely with data collection peeps to know

    what to expect ◦ Agree on common data format, attribute keys, etc. ◦ Able to stay flexible while data collection peeps worked around inconsistent data • Able to use Spotify IDs as our PKs • Data loaded sequentially by pillar ◦ Made dummy objects for connections not loaded yet ◦ Support duplicate objects / replacing dummy objects during loading • 4 tables (3 for pillars + 1 extra) ◦ Artist, Album, Song, (Genre)
  22. API: Phase II • Get data for all songs/albums/artists •

    Get data for individual song/album/artist by ID
  23. Filtering Strengths and Weaknesses Strengths • Getting all songs/albums/artists is

    faster than searching/filtering • Getting individual songs/albums/artists is fast • Filtering on multiple attributes • Attributes are optional Weaknesses • Filtering code is complicated and messy • Not enough weaknessnes • Weaknesses is spelled wrong
  24. Global Search Search the entire database by string for songs,

    artists, albums, labels, and genres 1. Song 2. Artist 3. Album 4. Label 5. Genre Priority
  25. Postman Tests • Test that the URL is working •

    Verify the correct number of objects are returned • Confirm that the objects returned have the correct number of elements
  26. Unittests db_tests.py > dp_tests_output.txt api_tests.py > api_tests_output.txt • Uses coverage

    and coverage report ◦ db_tests.py coverage report on db.py ◦ api_tests.py coverage report on main.py • Can execute unittests from About page ◦ Uses Popen and PIPE from Python’s subprocess library ◦ Complicated to synchronize execution
  27. Backend • What did we do well? • What can

    we do better? • What did we learn? • What puzzles us? Critique
  28. What did we do well? • Search, filtering, DB queries

    all work • Relation tables ◦ We think we got the relations right ◦ We think we organized the tables well • Combine different data sources by matching up attributes to make a unified data set • DB Tests ◦ We have informative output for debugging, but the actual tests are not as complex • Postman Tests ◦ Test the basics, not very complex ◦ Lots of room for expansion • Highlighting is vulnerable to cross-site-scripting! ◦ We add html in the backend What could we do better?
  29. What did we learn? • How to scrape and store

    data in an efficient manner • How to do less work by dynamically generating pages with templates • How to search and filter through data quickly and efficiently • How to test our API and database with Postman and unittests • The semantics of [Model].update({argmap}) • db.Table vs db.Model • When we run tests from the About page, our website will serve HTTP 499 errors while the tests are running What puzzles us?
  30. What can we do better? • Understanding the application stack

    chain of communication ◦ This is wrapped up in a strength: We are eager to help each other! ◦ Communication only flows as such ▪ Data Collection → Database → API endpoint ←→ Frontend ◦ We made changes with intent of making things easier for Frontend in Data Collection without realizing those changes need to be made at the API endpoint level • Overextending to meet deadlines ◦ Occasionally disregarded self-care to finish things; a few all-nighters ◦ Occasionally people missed class because they needed sleep ◦ Four of us met in CS 349 and had overlapping deadlines with CS 373 ▪ 2/3 of our team was regularly overworked • As a leader, I could have communicated more fully ◦ Curse of knowledge ◦ I didn't fully explain some things because I didn't know what I knew but others didn't necessarily know (e.g., application stack communication)
  31. What did we do well? • Meeting regularly, helping each

    other, staying positive ◦ Started with longer meetings & team-building → evolved into scrum-style meetings ◦ Kept meetings productive and not too long ◦ Focus on team success and whole outcome; no "I'm done, I did my part" mindset • Individual leadership and expertise ◦ Sumedh → Design & Bootstrap, Davie & Nghia → Data & search ◦ Jordan → React & Scripts, Angela → API, Canyon → Database, GCP ◦ Informal expertise network supported our development team • Very Successful Website ◦ Met our goals ◦ Made the deadlines ◦ Proud b/c we know how much went into the website
  32. GameHub Critique • What did they do well? • What

    can they do better? • What did we learn from their website? • What puzzles us about their website?
  33. What did they do well? • Even team contribution •

    Website design fits well with information displayed • Cool logo design ◦ "Gaming is a way of life" - We approve • Attention-grabbing buttons • Great visualizations • Companies and Genres pages: like use of cards over basic list • Game page: like background of faded image • Global search page: like how the results are divided into pillars • Quick search results • Clean code (esp main.py)
  34. What can they do better? • Different color hyperlinks (blue

    link on purple background difficult to see) • Missing PFP on About page ◦ Daniel’s picture on Firefox • Sort visualization data • Search when user presses enter button
  35. What can they do better? • Games page: use cards

    over basic list (similar to Genres and Companies) • Genres and Companies pages: can implement accordion within cards to fix different heights ◦ Accordion headers for Companies: Year, Location, Main Genre, Total Number of Games ◦ Accordion headers for Genres: Games, Companies, # Popular Games, Topics • Genre and Company page: background of faded image (similar to Game)
  36. What did we learn from their website? • Popular game

    genres used across industries ◦ Action, adventure, arcade, board games, card, casual, educational, family, fighting, indie, massively multiplayer, platformer, puzzle, RPG, racing, shooter, simulation, sports, strategy • Visualizations ◦ Majority of Jobs are IT located in San Francisco ◦ Majority of Companies are in the technology industry
  37. What puzzles us about their website? • Some of our

    members couldn't access the site ◦ Seems to work on Firefox but not Chrome ◦ We had a similar issue and traced it to backend API calls using HTTP • iOS Development on About Page??? :O • Quick search results 🥺(we're jelly, is searching done frontend?) • Weird search bug ◦ Navigate to Game X ◦ Search for Game Y ◦ Open Game Y in new tab → Opens Game X instead • Database model relationships ◦ We suggest a Many—Many relationship for Genre—Games, Genre—Companies, and Games—Companies