Giter VIP home page Giter VIP logo

lyr-service's People

Contributors

bdkiran avatar

Watchers

 avatar  avatar

lyr-service's Issues

Create README

Create a readme to contain:

  • Use proper markdown syntax

  • Brief explanation about the repository

  • How to download

  • Dependencies

Add Authentication

Utilizing gothic, authentication with google, facebook and apple should be implemented.

  • Watch out for concerns with xss, website may need to be consolidated on one url.

Query Based on Votes

Create a query to return the "best" lyrics

  • Return lyrics with the greatest scores (# of upvotes - # of downvotes)

Add Tests

Tests should be provided covering all functions, these unit tests should be small if scope but provide sufficient converage. These should exist in their own package :

  • Determine what to do with api calls functions to elastic-search

  • Determine how to test http handler functions

Add upvote functionality

Upvote should reflect an upvote for a single user

  • Users id gets added to the upvoted users array in the lyric.

  • User can only appear once in this array.

  • If already present sent 400

  • If user is currently in the downvote array, remove them.

  • Endpoint: /upvote/{document_id}

Authorize Requests

Some Request require that the caller be authenticated/authorized to complete that action. We need to add a check.

Routes:

  • /upvote/{doc_id}

  • /downvote/{doc_id}

  • Check if request has auth bearer token, if not return 401

  • Check if token is valid (secret is kept in this service) if not return 401

  • Check if user id matches with token user sent

Add Explicit Error Handling

All functions should have all possible errors handled:

  • no _ for errors

  • Generic functions for error, to bubble up to the stack

  • Preventing errors from completely overwhelming the service

Add Form Submission Handling

Message are able to be sent from the front end to the backend. However, information is not stored.

  • Add honeypot to reduce spam

  • Store the messages

  • ^Decide where to store the messages? Mongo, Elastic-search, Postgres?

Add Downvote Functionality

Upvote should reflect a downvote for a single user

  • Users id gets added to the downvoted users array in the lyric.

  • User can only appear once in this array.

  • If user is already present sent 400

  • If user is currently in the upvote array, remove them.

  • Endpoint: /downvote/{document_id}

Exact Match Query Keywords

The exact matching on keywords in the song_lyrics index will cause an issue with the following scenario:

  1. In the elastic-search document, there are songs by the artist roddy ricch

  2. User searches for roddy

  3. The user does not get any results back

This is because the keyword fields of artist and title are looking for an exact match, this needs to be adjusted so that these fields search is not so strict

  • Allow for words contained in a keyword field to be returned.

Resources:
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax
https://stackoverflow.com/questions/54058630/multiple-words-act-as-single-word-in-search-elasticsearch
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Add Logging

Create a new package that will handle all logging for the service
Include

  • Type of log: debug, info, warn, error

  • Timestamp

  • Package/File it was called

Add Health Check

Change the / endpoint to a health check endpoint

  • Query elastic-search to get the health of the cluster

  • Send back a message on the status

Adjust Query for Keyword Fields

The last data structure change in ES alleviated issues concerning duplicate lyrics.
When this was done the artist and title fields in our elastic-search documents were changed from text fields to Keyword fields. This change was made for the future in mind(for aggregations and such).
However, this has left us with an issue since the query performs and "exact" match search on these keyword fields.
For Example take the following document:

/song_lryics/doc1
{
    'artist': 'drake'
    'title': 'cool song'
    ...
}

When a match query is performed using Drake this document would not be returned.
This is because the case difference is and issue with the exact match.

  • Fix case sensitivity for artist field in query
  • Fix case sensitivity for title field in query

Remove Duplicated Lyrics From Results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.