drejohnson / sapper-graphql-firebase Goto Github PK
View Code? Open in Web Editor NEWSvelte + Sapper + GraphQL + Firebase Auth
Svelte + Sapper + GraphQL + Firebase Auth
Hi, and thanks for the template, very useful and well crafted!
A doubt about one thing though: I get
Circular dependency: src/firebase/auth.js -> src/firebase/init.js -> src/firebase/auth.js
Would it be possible to move the authListener
maybe in the init.js
file so that it would not need circular imports?
Also, a nice to have, some comments/readme about the operations going on with the auth + forkJoin + tap + etc. for a non RxJs developer
The machinery to import and use firebase is different from standard templates that one finds around, so a copy paste would not work here.
As of now, to use firestore I am obliged to instantiate a db
variable, and assign to it the firestore instantiation with a subscription.
Here's the code:
import { collectionData } from 'rxfire/firestore';
import { firebaseApp$ } from '../firebase';
let db;
firebaseApp$.subscribe(firebaseApp => (db = firebaseApp.firestore()))
This works.
However, instead of passing through firebaseApp$
, I would prefer to have db
instantiated inside firebase/index.js
and to just import it with
import { db } from '../firebase'
.
How could it be done?
Hey, thanks again for this template. I am a bit of a noob, and I am looking into setting up graphql in my sapper app using hasura. Would you still recommend this setup for graphql? I was looking at the svelte-apollo package but I like your approach better, I just don't know enough yet to know if there are any things to be aware of with this approach.
Thanks again for your time!
Can I see the src/firebase/config.js example with empty data?
Or where can I see the example config.js?
'config' is not exported by src/firebase/config.js, imported by src/firebase/init.js
2: import { map, tap } from 'rxjs/operators'
3: import { authListener } from './auth'
4: import { config } from './config'
my config.js
var firebaseConfig = {
apiKey: "*******************************************",
authDomain: "sapper-jwt.firebaseapp.com",
databaseURL: "https://sapper-jwt.firebaseio.com",
projectId: "sapper-jwt",
storageBucket: "sapper-jwt.appspot.com",
messagingSenderId: "**********************",
appId: "1:****************:web:*******************"
};
Thanks so much for making this available, I have been struggling for days to figure out how to get firebase auth working with sapper.
Hi Dre,
I've been fascinated by your setup here for the past few days, learned about some new platforms like Hasura.
But I've been stuck on trying to get this to run on Now 2.
I think I've done everything needed.
My .env file contains hasura credentials etc.
I added a config.js file to the src/firebase/ folder
Successfully deployed the function to add the hasura tokens from firebase auth
And locally it works like a charm to log in and log out.
So my next step was to try and deploy it to now, and that's where I'm stuck.
I keep getting a 500 server error message, and it is complaining about modules in server.js not being found.
Do you have any pointers on how you've gotten this to work for you?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.