The purpose of this repo is to combine React with Firebase and GraphQL. This is a proof of concept of using GraphQL to access Firebase's Realtime Database. This was acheived through Vite, Firebase's serverless functions, Firebase Hosting and Apollo Server.
You can visit the Firebase hosted link here: https://fern-graphql-tester.web.app/
Tech | Reference |
---|---|
Vite | docs |
Firebase Functions | docs |
Firebase Hosting | docs |
Apollo Server | docs |
Disclamer: I used Node/npm for all of this.
First, have Node installed on your computer so you can use npm
commands.
I setup React with the npm create vite@latest
command. After typing in a project name, I selected React
for my framework, and finally I chose JavaScript
(not JavaScript + SWC in my case).
talk about packages I used
Going to firebase website
after creating a firebase project, follow the instructions to add a website
show file structure.
apollo website help and youtube video.
break down Resolver class
Using @apollo/client
package for gql hooks
Setting the firebase function url to the apollo client uri