Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Search #2

Open
nickcreel opened this issue Jan 4, 2022 · 1 comment
Open

Basic Search #2

nickcreel opened this issue Jan 4, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request Search

Comments

@nickcreel
Copy link
Owner

  • Grab search filters from Lolibrary site on setup
    • The search filters are not fetched using a network request, I believe they are pre-baked into the front end somehow (maybe server side rendering, but I'm not sure what the request would be). Either figure out a way to get these through an API request (rabbit hole) or go to the base search page and scrape (more costly during setup but really only needs to happen once per session).
  • Allow user input for keywords and different filters
  • Make a request to Lolibrary API using user input
  • Use returned JSON to build list of search results on the fly
    • Need to build components for search results. Start with a simple list item / flat list that shows image, name, category, and brand for each item.
      • Image
      • Details
      • Use index of list item to get full data from array instead and have this.state.searchResults store raw response body?
    • Individual items in the list can be tapped to go to full detail page. This page will also have a link to the main lolibrary page either as a button or as a "share" link
    • All of the information returned from lolibrary will be shown on the detail page.
@nickcreel nickcreel self-assigned this Jan 4, 2022
@nickcreel nickcreel added enhancement New feature or request Search labels Jan 4, 2022
@nickcreel
Copy link
Owner Author

nickcreel commented Jan 12, 2022

Future issues:
Getting filters for search. Lolibrary uses Laravel Nova to manage data. I want to programatically get the values for different filters (brand, color, tags, etc) rather than hardcoding them so that the app always has the same filters as the Lolibrary database.

Using data from the database requires making requests to the nova API, which requires logging in to lolibrary. Logging in can be done using a simple post request, but the post request requires a token which must be grabbed from the metadata of the database login page https://lolibrary.org/library/login. this token is expired upon use and must be fetched for each login attempt.

Login parameters are passed as form data, simply email, password, and _token. _token is the token from the login form mentioned above. Without the token, the login request will get a response that says the page has expired. I don't want to make any dubious requests so going through this process will likely be required. At a certain point, would it be possible to have a user login and use their credentials for this request? I am worried that using one account to request the filters may result in some rate limiting depending on implementation. The request for filters could be made once during app setup to prevent this, then cached?

@nickcreel nickcreel mentioned this issue Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Search
Projects
None yet
Development

No branches or pull requests

1 participant