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

Path to a stable backend.. #1

Open
3 tasks
retrixe opened this issue Jul 7, 2018 · 3 comments
Open
3 tasks

Path to a stable backend.. #1

retrixe opened this issue Jul 7, 2018 · 3 comments

Comments

@retrixe
Copy link
Member

retrixe commented Jul 7, 2018

  • File naming nomenclature
  • Upvote authentication and confirmation
  • Setup on Google Cloud Platform and implementation
@retrixe retrixe changed the title Path to a stable backend Path to a stable backend.. Jul 7, 2018
@retrixe
Copy link
Member Author

retrixe commented Jul 7, 2018

File naming nomenclature
My current plan is to create multiple folders under a GCP bucket named after different categories which can be retrieved through getCategories query to the server. Each file will be named with _ replacing spaces and -by- separating the author and the image name. Each image will be assigned a 4 digit ID which will be in the file name at the end: |<insert ID here>. This will be sufficient for storing 10k messages.

GraphQL query proposal: getFiles (takes optional or required category, TBD), getCategories

@retrixe
Copy link
Member Author

retrixe commented Jul 7, 2018

Setup on Google Cloud Platform
Initially (only basic functionality right now, no file storage),

  • Compute Engine with GraphQL server
  • Cloud Datastore as database

Then (enables file storage),

  • Compute Engine running GraphQL server
  • Cloud Datastore as database
  • Cloud Storage with files

Then (Cloud Function for GraphQL server and an ease of convenience function for adding an image to our app),

  • Cloud Function to generate image IDs (for our internal usage)
  • Cloud Function as GraphQL server
  • Cloud Datastore as database
  • Cloud Storage with files

@retrixe
Copy link
Member Author

retrixe commented Jul 7, 2018

Upvote authentication and confirmation
This is a confusing topic where we can do one of two things, both of which are acceptable and equally simple to implement.

  • Use Google authentication through Expo to enable upvotes and downvotes, store ID in SecureStore (Expo) and use it for upvotes/downvotes - One vote per image per user|requires user to login
  • Fingerprint the device and use device fingerprint (Do not get confused with human fingerprints lol, its a unique ID for identifying a device) for authentication (I have a slight inclination towards this one as it is user intuitive and has little scope for exploitation) - One vote per image per device|no login requirement

In addition to these measures, we need to implement proper checks to see if the image exists before voting.

GraphQL query proposal: getUpvotes, upvoteAndQuery, downvoteAndQuery (take authentication token and our own app token (to safeguard from external API communication) as argument)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant