## 🔥Firebase hackday🔥

---
## Who are we?
|Tony Lomax|Jack Brider|
| -------- | -------- |
|| |
---
## What are we doing?

---
## What is Firebase?
- Backend As A Service (BaaS)
- Owned and operated by Google
- An integrated platform that provides everything you need for a modern web or native app
---
## Traditional stack
|Server Framework|Authentication|Database|Hosting|
| ------- | ---- | -------- | -------- |
|||||
---

---
Pros:
- Easy integration of required services
- Works across web and native applications
- Quick and (relatively) easy to set up
- Automatically scales
- Always adding new features
- Excellent built in analytics
---
Cons:
- Locked into the platform
- No relational/SQL database + denormalized data
- Potentially high cost at high usage levels
- Learning curve
- Small(ish) community
- Potentially less configurable
---
## What does it look like?

---
## Why do we like it?
- At FAC you learn the fundamentals of how things like authentication, routing, API's, databases etc work.
- It's unlikely you'll need to handle your own JWTs or write your styling from scratch.
- In the real world you're more likely to use libraries for these things.
- Firebase combines these requirements into a single platform that is wrapped in a neat and shiny package.
---
## Key features
- Authentication (incl. super advanced things like magic links)
- Database with GUI (NoSQL)
- PubSub - Keeping your front end up to date with your database
- Firebase functions (similar to lambda functions)
- Managing offline access
- Other cool stuff (read the docs)
---
## Gotcha 1 - Cost

---
## Gotcha 2 - NoSQL vs SQL

---
## Gotcha 3a - Naming conventions can be confusing
* Cloud Functions is a specific thing
* Real Time Database is a specific thing
* Cloud Firestore is another specific thing (not the same as Real Time Database) - use This one for your data on this project!
---

---
## Gotcha 3a - Make sure you're looking at the right docs
* If you're on Stack Overflow, or the docs, make sure your guide is using Cloud Firestore as there are a few different versions.
* If you're using the docs, there are docs for many languages, make sure you go to the JavaScript docs.
---

---
## Is Firebase worth learning (after today)?
* If you have a project that needs a quick prototype yes.
* For jobs, totally fine to keep focusing on building experience with Node/Express
* Although, understanding serverless architecture could be a big thing.
---
## Is Firebase better than using Express etc.?
* It depends on the project! If it didn't depend, no one would ever use Express/Node again.
* For our use case, it's faster to put out there. This is the main criteria so for us it's better (maybe).
* Firebase is less configurable, likely to be more expensive at scale.
* Maybe harder to find developers to take over the project?
---
## A ridiculously unachievable goal
#### Recreate the logical functionality of your Tech For Better project using Firebase.
* No styling (you can do this afterwards!)
* Focus on one or two small user journeys first and then expand outwards
* Think of this as a taste of our job
---
#### Examples of an 'achievable' user story:
* As a user I can login and be redirected to my home page
* As a user I can see a list of To Dos
---
#### Example of a 'too difficult' first user story
As a user I can sign up, select my reading interests and then be redirected to view book recommendations tailored to my interests
---
##### If/when you complete your first user story, work on another achievable user story.
---
### FAQS
#### Group size?
Groups of 2 (preferably different from T4B)
#### How should we make the front end?
React. Use create-react-app and run it locally. There may be templates that can speed this up but we haven't tested them
---
#### Can I message you for help?
Yes but we may be slow. In meantime the Firebase docs are really good. So when in doubt double check them and also Stack Overflow.
If you do have questions, post them in FAC19 Slack so everyone can see the answers.
#### Do I need to make a signup flow for users to login?
Nope, create users in console
---
## At 5pm we'll reconvene and see what you've produced
### Good luck and happy hacking!

{"metaMigratedAt":"2023-06-15T09:47:20.039Z","metaMigratedFrom":"Content","title":"Untitled","breaks":true,"contributors":"[{\"id\":\"3667905a-664f-4fda-9608-89b2fce01619\",\"add\":3052,\"del\":372},{\"id\":\"35c65fec-4158-4be5-a487-26c912fc099c\",\"add\":5883,\"del\":3609}]"}