This talk will include some best practices of developing fast with firebase and how to get the most out of the platform during development and deployment.
as JSON data in Firestore. • Whatever you need in your current screen or widget, make a document containing it and see how that works out – try first, fix later • Loop back and adjust data if you need. • Start breaking out data when you find yourself trying to combine screens in documents Data modeling - Top down
const uid = context.auth?.uid; // Check authorization // Generate report... can take some time. const reportData = await generateReport (); // After some time, return to client return reportData; });
to be triggered after delay • Limit the amount of executions in parallel • Declare the number of retries • Calling external API with rate limit to avoid DDOS • Unifying workflow of processing requests
• SSR public website • Server to server • Lightweight and easy to maintain API endpoints • Process of data where you do not need to retain the triggering data • Simple invocations to process something • Safe access from your app since it use SDK to verify app credentials • No offline Firestore • Instant write completion, data sync in background • Offline data • Smart cache and partial updates • Internal message bus - writes are locally propagated on app while writing to cloud Callables HTTPS API
versions to development • Use hosting preview channels and name them according to the PR/branch name • Let’s your PR reviewer test your changes instead of checking out, build and deploy by themselves • Can also be used to avoid having public website permanent on dev/staging environments Integrate the code review process
'pull_request' # Deploying to preview channel using the branch name as channel name # String split '/' and use the last part of the branch name run: | echo "CHANNEL_NAME=$(echo ${{ github.head_ref }} | grep -o '[^/]*$')" >> $GITHUB_ENV echo "CHANNEL_LIFESPAN=3d" >> $GITHUB_ENV - name: Deploy preview channel to Firebase if: github.event_name == 'pull_request' run: >- firebase hosting:channel:deploy ${{ env.CHANNEL_NAME }} --expires ${{ env.CHANNEL_LIFESPAN }}