npm package: @juicyllama/common
Description: Juicyllama NestJS Common
Author: JuicyLlama Studio
Latest version: 0.0.94
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<h1 align="center"></h1>

<div align="center">
  <a href="https://juicyllama.com/" target="_blank">
    <img src="https://juicyllama.com/assets/images/icon.png" width="100" alt="JuicyLlama Logo" />
  </a>
</div>

<h1 align="center">JuicyLlama NestJS Common</h1>

<h3 align="center"></h3>

![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![NestJS](https://img.shields.io/badge/nestjs-%23E0234E.svg?style=for-the-badge&logo=nestjs&logoColor=white)
![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)
![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
![Jira](https://img.shields.io/badge/jira-%230A0FFF.svg?style=for-the-badge&logo=jira&logoColor=white)
![Prettier](https://img.shields.io/badge/Prettier-F7B93E?logo=prettier&logoColor=fff&style=for-the-badge)
![ESLint](https://img.shields.io/badge/ESLint-4B32C3?logo=eslint&logoColor=fff&style=for-the-badge)

## Install

```bash
$ npm install
```

## Env

```dotenv
#NEST_DEBUG=true
API_BASE_URL=http://localhost:3001
NODE_ENV=development
PORT=3001
TEST_LOGGING=1

MYSQL_HOSTNAME=127.0.0.1
MYSQL_PORT=3307
MYSQL_USERNAME=root
MYSQL_PASSWORD=localhost
MYSQL_DB_NAME=juicyllama
MYSQL_DB_TEST_NAME=juicyllama_test

REDIS_HOST=127.0.0.1
REDIS_PORT=6379

JWT_KEY=REQUIRED_IN_MAIN_APP
CRON_API_KEY=REQUIRED_IN_MAIN_APP
APILAYER_API_KEY=REQUIRED_IN_MAIN_APP

SYSTEM_EMAIL_ADDRESS=REQUIRED@MAIN.APP
SYSTEM_EMAIL_NAME=REQUIRED_IN_MAIN_APP

GOOGLE_CLIENT_ID=REQUIRED_IN_MAIN_APP
GOOGLE_CLIENT_SECRET=REQUIRED_IN_MAIN_APP

APP_BASE_URL=REQUIRED_IN_MAIN_APP

SENDGRID_API_KEY=REQUIRED_IN_MAIN_APP
SENDGRID_TEMPLATE_ID=REQUIRED_IN_MAIN_APP

BILLING_DEFAULT_PLAN=1
MOLLIE_API_KEY=REQUIRED_IN_MAIN_APP

XERO_CC_CLIENT_ID=REQUIRED_IN_MAIN_APP
XERO_CC_CLIENT_SECRET=REQUIRED_IN_MAIN_APP
XERO_CC_DEFAULT_BANK_ACCOUNT_ID=REQUIRED_IN_MAIN_APP
XERO_CC_WEBHOOK_SIGNING_KEY=REQUIRED_IN_MAIN_APP

PUSHER_APP_ID=REQUIRED_IN_MAIN_APP
PUSHER_APP_KEY=REQUIRED_IN_MAIN_APP
PUSHER_APP_SECRET=REQUIRED_IN_MAIN_APP
PUSHER_APP_CLUSTER=REQUIRED_IN_MAIN_APP
PUSHER_CHANNEL=REQUIRED_IN_MAIN_APP
```


## Crons

You should add the following crons to your cron manager (e.g. easycron.com)
- `/crons/beacon/send/email`

## Todo Accounts

- [ ] []() - Cron to clean-up users with no accounts/deleted after 3 months


## Todo Beacon

- [ ] []() - User Mobile (Recovery & Beacon) -> use mobile utils to store in correct format
- [ ] []()  Push (Pusher, Quasar)
- [ ] []()  IM (SMS/Whatsapp/Slack)
- [ ] []()  Webhook

## Todo Billing
- [ ] []() Send beacon about failed payment
- [ ] []() Handle 5 declined payments -> block features?
- [ ] []() Handle Tax
- [ ] []() Document User Journeys
- [ ] []() Support Stripe

## Todo Users
- [ ] []() Multiple users, multiple accounts, adding, deleting, etc
- [ ] []() Testing for update role
- [ ] []() Testing for upload Avatar endpoint

## Todo Tags

- [ ] Create cron to clean out unused tags, we will need to maintain a list of "function>ifInstalled" for entities containing tags


## Change Log

See [Changelog](CHANGELOG.md) for more information.

## Contributing

See [Contributing](CONTRIBUTING.md).