sapper-graphql-firebase
sapper-graphql-firebase copied to clipboard
Svelte + Sapper + GraphQL + Firebase Auth
Svelte + Sapper + Firebase + GraphQL 🔥
Svelte Starter with Sapper, GraphQL and Firebase Auth.
Features
- [x] Svelte
- [x] Sapper
- [x] RxJS
- [x] GraphQL via Hasura's graphql-engine
- [x] Authentication via Firebase Auth
- [x] Uses Service Worker to Cache GraphQL Request
Quick start
- Install dependencies: run
yarn
in project root - For dev server: run
yarn dev
ornpm run dev
, from project root. The app should be running at: http://localhost:3000. - To build frontend run:
yarn build
ornpm run build
from project root. Runyarn start
ornpm start
to start app.
Notes
- Repo was set up using my personal Hasura and Firebase configurations which is not included. So some setup is required for this repo to work for you.
- You will need to edit the
.env
file to add your credentials - Add your Firebase config to `src/firebase/config.js
- You also need to update the graphql directory with your own queries and mutations
- To run/test in docker locally run
docker run -p 3000:3000 -it <IMAGE> sh
. e.g.docker run -p 3000:3000 -it gcr.io/your_project/your_service:54bxr7g9 sh
, then from inside image runnode __sapper__/build
. Now open browser tolocalhost:3000
Deploy
- Uses Cloud Run
- To deploy on Cloud Run: run
yarn deploy
ornpm run deploy
,
TODO
- [ ] Move the
src/svql
directory into it's own repo and publish as a lightweight graphql client forsvelte
on npm - [ ] use firebase-admin
- [ ] Add TypeScript when supported