# FAC-Tube πΊ
---
## Demo
π https://fac-tube-n1iron2xb-fac-tube.vercel.app/
---
## π§© Process
---
### Last Sprint

---
### πΊοΈ Kanban board

---
### :spiral_note_pad: This Sprint...
1. Installations
1. Tech Spikes
1. Get more familiar with YouTube API
---
### :spiral_note_pad: ... This Sprint
| Video Feed | Material UI |
| -------- | -------- |
| a. Search<br>b. Sort<br>c. Filter<br>d. Like | a. Decide Colours, Fonts<br>b. Material UI<br>c. Navbar<br>d. Layout<br>e. Video Card |
---
### How we worked
- Set Daily Goals
- Underplan: allow time for bugs
- Switch between Group, Pair, Individual work
---
## Difficulties :dizzy_face:
<iframe src="https://giphy.com/embed/hqb6fTvZv0LCheZt1I" width="424" height="480" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
---
### Material
- [ ] Material UI :penguin:
1. new way of styling in css
2. Time consuming
3. CAUSING BUGS :bug:
---
### API
- [ ] API
1. Having limited fetching for their API key
2. they are not generous
3. it depends what you call, depending on the weight/credit.(Token)
1. data getting fetched by the search

---
### SWC
- [ ] SWC can be used for both compilation and bundling. For compilation, it takes JavaScript / TypeScript files using modern JavaScript features and outputs valid code that is supported by all major browsers.
SWC is 20x faster than Babel on a single thread and 70x faster on four cores.
---

<iframe src="https://giphy.com/embed/yCkpLXGiSP6KY" width="480" height="180" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
Terminal: Disabled SWC as replacement for Babel because of custom Babel configuration .babelrc
---
### Ad Blocker
<iframe src="https://giphy.com/embed/d2YZzTQvyoNYf9YI" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>

---
### Hide your API key :rolling_on_the_floor_laughing:
- [ ] Github Message API :+1:
- [ ] .env.local contains our API Key
```
//.env.local
NEXT_PUBLIC_YOUTUBE_API_KEY=...
// in our files
const apiKey = process.env.NEXT_PUBLIC_YOUTUBE_API_KEY;
```
---
## What worked well

---
### Deployment on Vercel

---
### Libraries
- React Player πΊ
- Lodash π
- Material UI π¨
- React Components π§©
---
#### React Player πΊ
```jsx=
import ReactPlayer from 'react-player/youtube';
<ReactPlayer
controls="true"
url={`https://www.youtube.com/embed/${video.id.videoId}`}
/>
```
---
#### Lodash π

---
```jsx=
import { orderBy } from 'lodash';
e.target.value === 'newest' ? (order = 'desc') : (order = 'asc');
const orderedVideos = orderBy(
copyVideoData,
['snippet.publishTime'],
[order]
);
setVideos(orderedVideos);
};
```
---
## What we learnt π‘
- [x] How to set up a Supabase database and access it using Next.js functions - getServerSideProps
- [x] How to query the YouTube API with user generated search term (added to state) and output the data onto the page
- [x] How to find and install relevant components from NPM e.g. ReactPlayer
---
- [x] How to use Lodash library function to sort videos by publish date
- [x] How to bring in pre-made styled components from Material UI
- [x] How to set our environment variables for development and production
---
## Next week...
To add to the project β
user authentification π
likes counter on videos π
user video libraries πΊ π
user profiles π©π»βπ»
add testing with Cypress π²
database layer with Supabase β‘οΈ
get more familiar with Material UI π
---
Any questions? π
---
---
{"metaMigratedAt":"2023-06-16T14:52:08.964Z","metaMigratedFrom":"YAML","title":"FACTube Build1 by Anna, Mohamed,Danilo and Barbara","breaks":true,"slideOptions":"{\"transition\":\"fade\"}","contributors":"[{\"id\":\"0a3ab15b-3310-4524-96d0-8240b9d0005e\",\"add\":1738,\"del\":278},{\"id\":\"6cc335f8-1f36-47ab-89ea-21858127bf52\",\"add\":1272,\"del\":78},{\"id\":\"f7800be7-93b6-4348-a3ac-879d43ddafa4\",\"add\":984,\"del\":234},{\"id\":\"173c5ca6-dd9a-4147-90c5-ad6929e6d625\",\"add\":714,\"del\":15}]"}