speak-her-db icon indicating copy to clipboard operation
speak-her-db copied to clipboard

Move API keys to a backend

Open ann-kilzer opened this issue 5 years ago • 3 comments

Create a backend to proxy API requests between the client and Airtable

Short-term solution:

  • Move Airtable calls to Netlify unbundled lambda functions as a proxy server so we won't expose the API key on requests

Long-term solution (will create follow-up tickets for this):

  • Pick a tech-stack, implement and host a proper backend server
  • Migrate database from Airtable to a proper db and access from the backend server

Privacy reasons: We want to protect our database and limit access to sensitive columns such as user contact information. Related #13

Migration checklist

  • [x] Location requests
    • Fetch on views/FindSpeaker.vue
    • Fetch on components/LocationInput.vue
  • [x] Topics requests:
    • Fetch on views/FindSpeaker.vue
    • Fetch on components/TopicsInput.vue
  • [x] Languages requests:
    • Fetch on views/FindSpeaker.vue
    • Fetch on components/LanguageInput.vue
  • [ ] Speakers requests:
    • [ ] Fetch on views/FindSpeaker.vue
    • [ ] Create on components/NominateForm.vue

ann-kilzer avatar May 24 '20 08:05 ann-kilzer

Would love to get help on this one, but please sync up with @tuttiq and myself first.

ann-kilzer avatar Sep 07 '20 07:09 ann-kilzer

I think the MVP for this might be a node function, hosted on Netlify functions feature. Just a wrapper to send requests to Airtable using the API key.

On a more long term solution, I was thinking about migrating from Airtable to a proper backend + database.

I could work on the side to spin up a quick Ruby on Rails server with a basic API and migrate the data from Airtable to MySQL or Postgres. This can be done easily with Rails scaffolding and hosted for free on Heroku.

Let me know any thoughts!

tuttiq avatar Sep 07 '20 16:09 tuttiq

Oooh, might be cool to have it all inside Netlify for simplicity. I was watching some of casidoo's tweets on some fancy features inside Netlify. Heroku is great too. Up to you.

ann-kilzer avatar Sep 07 '20 17:09 ann-kilzer