npm package: @smartgift/frontend-toolkit
Description: <p align="center">   <img src="https://cdn.heroengage.com/merchants/flowers/images/smartgift-logo-web.svg" width="450"> </p>
Author: Smartgift
Latest version: 1.44.3

<p align="center">
  <img src="https://cdn.heroengage.com/merchants/flowers/images/smartgift-logo-web.svg" width="450">
</p>

<br />

<div style="display: flex; flex-direction: row; justify-content: center; gap: 20px;">

[![portfolio](https://img.shields.io/badge/website-0153bf?style=for-the-badge&logo=skypack&logoColor=white)](https://www.linkedin.com/company/smartgift)

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/smartgift)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/sendsmartgift)

[![instagram](https://img.shields.io/badge/instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white)](https://www.instagram.com/sendwithsmartgift)

</div>

<br />

<h1 align="center">Smartgift Frontend Workspace</h1>

**SmartCheckout** contains two apps as Dashboard and Recipient and a common frontend UI Kit for SmartGift. The project allows merchants to sent their products with email, sms or link.

- [_Dashboard_](https://github.com/SmartGiftEngineering/smartgift-frontend-workspace/tree/master/apps/smart-checkout-dashboard) is a app that allows brands to create the campaigns and sent them to the customers and it shows selling analytics.

- [_Recipient_](https://github.com/SmartGiftEngineering/smartgift-frontend-workspace/tree/master/apps/smart-checkout-recipient) is a app that transforms users to product buying links.

- [ui](https://github.com/SmartGiftEngineering/smartgift-frontend-workspace/tree/master/libs/ui) is a common frontend UI Kit for SmartGift.

<br />
<hr />
<br />

## # Workspace Applications

- smart-checkout-recipient
- smart-checkout-dashboard

<br />

## # Installation

Clone the project

```bash
  git clone https://github.com/SmartGiftEngineering/smartgift-frontend-workspace.git
```

Go to the project directory

```bash
  cd smartgift-frontend-workspace
```

Install dependencies

```bash
  yarn
```

Start the recipient server

```bash
  yarn scr:dev
```

Start the dashboard server

```bash
  yarn scd:dev
```

Open the address on your browser for the recipient app

```bash
  http:/localhost:4200/YOUR_GIFT_LINK
  Real => http:/localhost:4200/campaign?recipientCode=Q9WCQWC5V0M1&campaignCode=FKMCRLPNFFB8&selectedSku=97564G
  Demo => http:/localhost:4200/campaign?campaignCode=FKMCRLPNFFB8&selectedSku=97564G
```

Open the address on your browser for the dashboard app

```bash
  http://localhost:4200/auth/login
```

<br />

## # Tech Stacks

- [react](https://github.com/facebook/react)
- [nextjs](https://github.com/vercel/next.js)
- [nx](https://github.com/nrwl/nx)
- [storybook](https://github.com/storybookjs/storybook/)
- [zustand](https://github.com/pmndrs/zustand)
- [smartgift-ui-library](https://github.com/SmartGiftEngineering/smartgift-frontend-workspace)
- [svg-icons](https://github.com/svg-icons/svg-icons)
- [react-select](https://github.com/jedwatson/react-select)
- [react-tooltip](https://github.com/wwayne/react-tooltip)
- [formik](https://github.com/jaredpalmer/formik)

<br />

## # Abbreviations
- sc === SmartCheckout
- scr === smart-checkout-recipient
- scd === smart-checkout-dashboard
- ui === smartgift-ui-library

<br />

## # Scripts

Based on the application shortcuts, you can use these scripts

- yarn appName:dev =>
  You can develop your development with this script
- yarn appName:build =>
  You can get build of appName lib
- yarn appName:lint =>
  You can lint your code
- yarn ui:lint:fix =>
  You can fix lint errors
- yarn appName:test =>
  You can test your code

Example: `yarn scr:dev`

<br />

## # Environment Variables

You can look at the file which name is '.env.example' on root

<br />

## # How to create a merchant

- go to `apps/smart-checkout-recipient/public/merchants`, then copy and paste a merchant folder and rename it with your merchant name (after your merge this merchant data will be in the S3 bucket as json)
- add your merchant domain to the 'MERCHANT_LIST' variable in the '.env' file. by this convention: `'DOMAIN_NAME:MERCHANT_NAME' (ex: '1800flowers.smart-checkout.co:1800flowers')`

<br />

## # Contributing

Contributions are always welcome!

See `contributing.md` for ways to get started.

Please adhere to this project's `code of conduct`.

<br />

## # Applications / Environments

### ## 1800flowers
- uat => https://1800flowers.uat.smart-checkout.co
- prod => https://1800flowers.smart-checkout.co

### ## Smartwool
- uat => https://smartwool.uat.smart-checkout.co
- prod => https://smartwool.smart-checkout.co

<br />

## # Deployment

To deploy this project on UAT, follow these instructions and [AWS UI](https://us-east-1.console.aws.amazon.com/amplify/home?region=us-east-1#/dwly2tt30e3oq).

```bash
  git checkout uat
  git pull origin uat
  git pull YOUR_BRANCH
  git push origin uat
```

To deploy this project on Production, you need to merge all of your branched to `master` branch. It will be an automatic deployment. Also, you can check the [AWS UI](https://us-east-1.console.aws.amazon.com/amplify/home?region=us-east-1#/dwly2tt30e3oq).

<br />

## # Documentation

[Documentation](https://sgift.atlassian.net/wiki/spaces/SMARTGIFT/pages/9338895/smartgift-frontend-workspace)

<br />

## # Features

- Multiple Theme
- Live previews
- CDN configs, theme, language

<br />

## # Feedback & Support

If you have any feedback, please reach out to us at info@smartgift.it

<br />

## # License

[MIT](https://choosealicense.com/licenses/mit/)