README.md

# How to run this project

The following command will setup project prerequisites.

```
nvm use 10
npm run fresh-install
```

Once this is done, start the following parallely:

## Start google cloud function locally:

```
cd functions
npm run dev
```

## Start client:

- start webpack dev server to host client files
- serve the public folder which is referencing files hosted by webpack dev server

```
cd client
npm run dev
```

## Populate data in database from youtube api

Get data for comedians and their videos stored into database collections

```
cd scripts/generate
npm install (only first time)
npm start
```

## Debugging Tools

### GraphQL

More on README.md of functions directory.

#### Online

On https://lucasconstantino.github.io/graphiql-online/ run the following:

#### Local

Endpoint: http://localhost:5000/comedy-collection/us-central1/api/graphql

```
query {
  videos {
    id
  }
}
```

## Rebuild Database

```
cd scripts/generate/
npm start
```

## NOTE

### ppp

ppp - pre production platform (PPE)

### Dev Mode

We have to run client with:

> firebase serve --only hosting:dev,functions --port 7575

This is to allow the client hosting to start, where the redirect config should use the function.

Also, running:

> firebase serve --only functions --port=8585

This is where the hot reloading functions is hosted and pointed to withing the app in dev mode.

## References

- https://undraw.co/ - free svg illustrations

## Issues

### renew firebase token

firebase logout
firebase login --reauth

### update firebase tools

Not able to install npm package or update firebase-tools:

npm cache clean --force

npm install -g firebase-tools