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

Replace Firebase with Supabase #567

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

vontell
Copy link
Contributor

@vontell vontell commented Jan 24, 2025

Addresses ticket #563

This PR officially replaces all Firebase functionality from PHLask and instead replaces it with Supabase. The transition was actually quite easy, since the Supabase SDK is quite easy to use!

To check out the data, message me (@vontell) to get access to the project on Supabase. Otherwise, you should be able to pull this branch and see that the behavior is the same as before.

We should keep the Firebase database around for now to verify that things are looking good after testing. After a while, we can officially close down that project :)

Note that the new Supabase account has two database - the resources database, and the contributors database.

The one question I have for reviewers - I'd like to insert the API key (don't worry this is a public key similar to the Firebase ones we had) as an environment variable rather than plaintext. Before I do that, I wanted to verify where all the places are that I need to set this. I notice we are not consistent with setting the DB URL, for instance.

Note that part of the changes here seem to be formatting from my editor, sorry for that...

Screenshot 2025-01-24 at 12 36 37 PM Screenshot 2025-01-24 at 12 40 11 PM Screenshot 2025-01-24 at 12 40 57 PM

const resourceDatabaseName =
import.meta.env.VITE_DB_NAME || 'resources';
const databaseApiKey =
import.meta.env.VITE_DB_API_KEY || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndhbnR5Y2Zibnp6b2NzYnRocXpzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzcwNDY2OTgsImV4cCI6MjA1MjYyMjY5OH0.yczsMOx3Y-zsWu-GjYEajIb0yw9fYWEIUglmmfM1zCY';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on our standup chat, lets create a sample .env file for developers to use in the future so that we can pivot away from storing the key in this file.

We should also update the README to include how to request access to the developer .env file in the future.

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

Successfully merging this pull request may close these issues.

2 participants