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

feat(Root): add short links to easy share it 🔗😊 and github authentication 🐙🐈 #125

Closed
wants to merge 9 commits into from

Conversation

dartilesm
Copy link
Contributor

@dartilesm dartilesm commented Oct 7, 2021

Description

Generate short links when using codi.link to easily share with friendly links. For this purpose I am using firebase

TODO list

  • Generate fully shareable short links
  • Enable github authentication 🐙🐈

Preconditions

Firebase Config

As you know we need to use sensitive data to create the database, that is why there are environment variables with the prefix VITE_FIREBASE_, so you can replace it with your personal firebase data.

Github authentication

  1. Add Firebase to your JavaScript project.
  2. In the Firebase console, open the Auth section.
  3. On the Sign in method tab, enable the GitHub provider.
  4. Add the Client ID and Client Secret from that provider's developer console to the provider configuration:
  5. Register your app as a developer application on GitHub and get your app's OAuth 2.0 Client ID and Client Secret.
  6. Make sure your Firebase OAuth redirect URI (e.g. my-app-12345.firebaseapp.com/__/auth/handler) is set as your Authorization callback URL in your app's settings page on your GitHub app's config.
  7. Click Save.

More info here

Demo

Short links

codi-link-short-link

Github authentication

codilink-github

closes #7
closes #8
closes #100

@vercel
Copy link

vercel bot commented Oct 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/midudev-pro/codi-link/5ViC3A75eD46hZmUFxPKuqmt4ECu
✅ Preview: https://codi-link-git-fork-dartilesm-feature-databas-d70bb9-midudev-pro.vercel.app

@javigaralva
Copy link
Contributor

javigaralva commented Oct 7, 2021

Nice @dartilesm 🎉

💡 Some ideas:

  • Create button that create (in that moment) the unique ID.
  • Once the ID has been created, in order to prevent a lot of firebase requests, I'm thinking in two options:
    • Create a button to force save the current link (this is the one I like, because it's the user who ensures when save the content)
    • Make a debounced request (with last updated time?) to autosave (autosave would be an option too)
  • The shareable link may be in readonly mode or write mode (open collabs).
    • If the link is in readonly mode, the save option don't work and a new unique ID creation will be needed, in order to modify the content.

This is, for sure, a big PR and too many decisions will need to take care, don't think?
@midudev, could you help us with some guidelines to follow? So, the PR is not too open to decisions.
Thanks :)

@QuevedoIB
Copy link
Contributor

About realtime collabs there's a nice PR #126 with peerjs and convergencelabs, maybe you should wait for midu to review that PR before trying to implement the same functionality and try to adapt @tomimelo to your needs.

@dartilesm
Copy link
Contributor Author

Nice @dartilesm,

Things to consider:

  • Create button that create (in that moment) the unique ID.

  • Once the ID has been created, in order to prevent a lot of firebase requests, I'm thinking in two options:

    • Create a button to force save the current link (this is the one I like, because it's the user who ensures when save the content)
    • Make a debounced request (with last updated time?) to autosave (autosave would be an option too)
  • The shareable link may be in readonly mode or write mode (open collabs).

    • If the link is in readonly mode, the save option don't work and a new unique ID creation will be needed, in order to modify the content.

This is, for sure, a big PR and too many decisions will need to take care, don't think? @midudev, could you help us with some guidelines to follow? So, the PR is not too open to decisions. Thanks :)

Hi @javigaralva, thank you.

This PR is in an early stage of development, so I will keep these recommendations in mind.

@dartilesm
Copy link
Contributor Author

About realtime collabs there's a nice PR #126 with peerjs and convergencelabs, maybe you should wait for midu to review that PR before trying to implement the same functionality and try to adapt @tomimelo to your needs.

Hi @QuevedoIB,

You're absolutely right, luckily I didn't do anything about real-time collaboration. For now, I put a to-do list to take advantage of using firebase. At the time I was writing this, that wonderful PR did not exist so I will discard that task.

I know that our friend @tomimelo had requested to do this task, but as several days passed I thought he had given up. It was my mistake not to ask before, in the same way that task is his and he already did a great job 🤩🥳

@dartilesm dartilesm changed the title feat(Root): add short links to easy share it 🔗🤗❤and more features 😏 feat(Root): add short links to easy share it 🔗😊and github authentication 🐙🐈 Oct 7, 2021
@dartilesm dartilesm changed the title feat(Root): add short links to easy share it 🔗😊and github authentication 🐙🐈 feat(Root): add short links to easy share it 🔗😊 and github authentication 🐙🐈 Oct 7, 2021
@tomimelo
Copy link

tomimelo commented Oct 7, 2021

About realtime collabs there's a nice PR #126 with peerjs and convergencelabs, maybe you should wait for midu to review that PR before trying to implement the same functionality and try to adapt @tomimelo to your needs.

Hi @QuevedoIB,

You're absolutely right, luckily I didn't do anything about real-time collaboration. For now, I put a to-do list to take advantage of using firebase. At the time I was writing this, that wonderful PR did not exist so I will discard that task.

I know that our friend @tomimelo had requested to do this task, but as several days passed I thought he had given up. It was my mistake not to ask before, in the same way that task is his and he already did a great job 🤩🥳

Hi @dartilesm, thanks!
Yes, I was very busy at work so I couldn't spend a lot of time on it. Anyway, I think with your PR and a Firebase integration we could extend the collab sessions functionality a lot more. Something like persistent sessions, add friends, a chat...
Also, like @javigaralva mentioned, we could add a option to set the session as read-only mode.
The way codilink is growing is huge!

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