simplajs / simpla

Open, modular, and serverless content management for a modern web
https://www.simplajs.org
MIT License
527 stars 36 forks source link

Firebase adapter #90

Closed kpsrinivas closed 6 years ago

kpsrinivas commented 6 years ago

Type of change

New feature

Description

An adapter to work with firebase. A single firebase project can be used with many projects. We are working on a feature to deploy assets to firestore storage.

bedeoverend commented 6 years ago

Thanks for the PR, looks great!

Would you mind reverting your changes to the README? Can then add Firebase docs to the main docs repo

madeleineostoja commented 6 years ago

@bedeoverend do we need to finalise (and document, but at least finalise) adapter interface, before merging this? In case of breaking changes

kpsrinivas commented 6 years ago

@seaneking I am with you. I think its better to finalise adapter interface. Better finalise the architecture. Also working on deploy to firebase with functions and SEO. Might as well not need github to store data. We can store that json in realtime database. @bedeoverend will update the docs.

kpsrinivas commented 6 years ago

I did write an initial Readme - https://github.com/heresy/simpla Sorry that I changed the README. We might have to revert it back to original and append this to it. I will do that.

kpsrinivas commented 6 years ago

If I may also suggest, can we split this to different packages ? I can write the storage functionality and https(using their socket instead of the rest API) library for firebase. People can install saying @simpla/firebase-auth @simpla/netlify @simpla/firebase-hosting or @simpla/github-hosting

bedeoverend commented 6 years ago

Happy to wait until we’ve finalized adapter architecture, though I’m not too concerned about breaking changes while the adapters are about of Simpla’s core. On that point, once we do settle up on architecture, anyone can create a package outside of core. Unless we do a mono repo, @seaneking thoughts?

Also FWIW definitely worth thinking about storage adapter, not just authentication - agree it’d be great to add firebase storage!

bedeoverend commented 6 years ago

Also with Christmas and New Years probably won’t have time to look at this until mid Jan

madeleineostoja commented 6 years ago

Just re: docs - sorry if it wasn't clear, but we're not using the README here for documentation (the snippet with Netlify is just an example to give people a glimpse of Simpla). We'll need a PR with a guide and API reference in Simpla's docs. Use SimplaNetlify adapter docs as a template.

And yep as @bedeoverend touched on, we'll be soon opening up the storage interface as well (#77), at which point you could make a seperate Firebase adapter for that. Haven't settled on a naming convention yet, but I'd guess something like FirebaseAuth and FirebaseStorage for them.

madeleineostoja commented 6 years ago

If I may also suggest, can we split this to different packages ? I can write the storage functionality and https(using their socket instead of the rest API) library for firebase

Missed this comment before - we did consider making all adapters separate packages, but in the end decided it was too much overhead for no real gain. Bundling adapters doesn't add any weight for the user, since they only pull in what they need, and makes maintenance much easier.

That said you're more than welcome to turn this into your own package rather than a PR against the core lib. At some point we'll probably put up a list somewhere of community adapters as well as the 'official' bundled ones.

kpsrinivas commented 6 years ago

Made this a package - https://github.com/heresy/simpla-firebase-auth . I guess we can close this PR. @seaneking

madeleineostoja commented 6 years ago

:+1: Let us know if you'd like to make it part of the core bundle, we'd be happy to help maintain it if it was.

madeleineostoja commented 6 years ago

Also feel free to make a PR against docs for your adapter (for discoverability), can make an official/community distinction there.

kpsrinivas commented 6 years ago

Its just one function and file. We can do as you please. I will write update the doc.