diff --git a/apps/webapp/Dockerfile.pnpm-installer b/apps/webapp/Dockerfile.pnpm-installer new file mode 100644 index 000000000..ec3204029 --- /dev/null +++ b/apps/webapp/Dockerfile.pnpm-installer @@ -0,0 +1,29 @@ +################################################ +# 1/ move to the repo root directory +# 2/ build the image : docker build -t front_package_installer -f ./packages/api/Dockerfile.pnpm-installer . +# 3/ run with: docker run -v $(pwd):/app/ -e PACKAGE_NAME=PACKAGE_NAME package_installer +# example: docker run -v $(pwd):/app/ -e PACKAGE_NAME=@stripe/stripe-js front_package_installer +################################################ + +FROM node:20-alpine3.21 AS base +# ======================================================================= +FROM base AS builder +RUN apk add --no-cache libc6-compat netcat-openbsd curl openssl +RUN apk update + +# Set pnpm +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable + +WORKDIR /app +RUN pnpm add -g turbo@1.13.4 + +# Start Script + +# Set environment variable +ENV PACKAGE="$PACKAGE" + +WORKDIR /app/apps/webapp + +CMD pnpm add "${PACKAGE_NAME}" \ No newline at end of file diff --git a/apps/webapp/package.json b/apps/webapp/package.json index d53fcd968..dcaea5115 100644 --- a/apps/webapp/package.json +++ b/apps/webapp/package.json @@ -11,6 +11,7 @@ "dependencies": { "@faker-js/faker": "^8.3.1", "@hookform/resolvers": "^3.3.4", + "@intercom/messenger-js-sdk": "^0.0.14", "@panora/shared": "workspace:*", "@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-checkbox": "^1.0.4", diff --git a/apps/webapp/public/providers/ecommerce/amazon.jpg b/apps/webapp/public/providers/ecommerce/amazon.jpg new file mode 100644 index 000000000..8a6c92725 Binary files /dev/null and b/apps/webapp/public/providers/ecommerce/amazon.jpg differ diff --git a/apps/webapp/public/providers/ecommerce/shopify.png b/apps/webapp/public/providers/ecommerce/shopify.png new file mode 100644 index 000000000..243a408e2 Binary files /dev/null and b/apps/webapp/public/providers/ecommerce/shopify.png differ diff --git a/apps/webapp/public/providers/ecommerce/squarespace.png b/apps/webapp/public/providers/ecommerce/squarespace.png new file mode 100644 index 000000000..d8b51e5f6 Binary files /dev/null and b/apps/webapp/public/providers/ecommerce/squarespace.png differ diff --git a/apps/webapp/public/providers/ecommerce/webflow.png b/apps/webapp/public/providers/ecommerce/webflow.png new file mode 100644 index 000000000..ca8441f34 Binary files /dev/null and b/apps/webapp/public/providers/ecommerce/webflow.png differ diff --git a/apps/webapp/public/providers/ecommerce/woocommerce.png b/apps/webapp/public/providers/ecommerce/woocommerce.png new file mode 100644 index 000000000..92fdd2dfd Binary files /dev/null and b/apps/webapp/public/providers/ecommerce/woocommerce.png differ diff --git a/apps/webapp/public/providers/filestorage/box.png b/apps/webapp/public/providers/filestorage/box.png new file mode 100644 index 000000000..624628b04 Binary files /dev/null and b/apps/webapp/public/providers/filestorage/box.png differ diff --git a/apps/webapp/public/providers/filestorage/dropbox.png b/apps/webapp/public/providers/filestorage/dropbox.png new file mode 100644 index 000000000..b8cd531e9 Binary files /dev/null and b/apps/webapp/public/providers/filestorage/dropbox.png differ diff --git a/apps/webapp/public/providers/filestorage/googledrive.png b/apps/webapp/public/providers/filestorage/googledrive.png new file mode 100644 index 000000000..9ef262076 Binary files /dev/null and b/apps/webapp/public/providers/filestorage/googledrive.png differ diff --git a/apps/webapp/public/providers/filestorage/onedrive.jpg b/apps/webapp/public/providers/filestorage/onedrive.jpg new file mode 100644 index 000000000..6b3cec2db Binary files /dev/null and b/apps/webapp/public/providers/filestorage/onedrive.jpg differ diff --git a/apps/webapp/public/providers/filestorage/sharepoint.png b/apps/webapp/public/providers/filestorage/sharepoint.png new file mode 100644 index 000000000..8bc974d19 Binary files /dev/null and b/apps/webapp/public/providers/filestorage/sharepoint.png differ diff --git a/apps/webapp/src/app/(Dashboard)/layout.tsx b/apps/webapp/src/app/(Dashboard)/layout.tsx index 7b765b8cf..ac272c248 100644 --- a/apps/webapp/src/app/(Dashboard)/layout.tsx +++ b/apps/webapp/src/app/(Dashboard)/layout.tsx @@ -1,48 +1,55 @@ 'use client' import "../globals.css"; import { RootLayout } from "@/components/RootLayout"; +import useProfileStore from "@/state/profileStore"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import Cookies from 'js-cookie'; import useUser from "@/hooks/get/useUser"; +import Intercom from '@intercom/messenger-js-sdk'; export default function Layout({ children, }: Readonly<{ children: React.ReactNode; }>) { - - const [userInitialized,setUserInitialized] = useState(false) + const [userInitialized, setUserInitialized] = useState(false) const router = useRouter() const { mutate } = useUser() + const { profile } = useProfileStore() + // Handle authentication useEffect(() => { if(!Cookies.get('access_token')) { router.replace("/b2c/login") - }else { + } else { mutate( Cookies.get('access_token'), { - onError: () => router.replace("/b2c/login"), - onSuccess: () => setUserInitialized(true) + onError: () => router.replace("/b2c/login"), + onSuccess: () => setUserInitialized(true) } ) } - },[]) - + }, []) + + // Initialize Intercom separately when profile is available + useEffect(() => { + if (profile && userInitialized) { + Intercom({ + app_id: 'kjwzw97u', + user_id: profile.id_user, + name: `${profile.first_name} ${profile.last_name}`, + email: profile.email, + }); + } + }, [profile, userInitialized]) + return ( - <> {userInitialized ? ( - <> - - {children} - - - ) : ( - <> - - - )} - - + userInitialized ? ( + + {children} + + ) : null ); } diff --git a/apps/webapp/src/app/b2c/login/page.tsx b/apps/webapp/src/app/b2c/login/page.tsx index b11ee66bd..137c81d12 100644 --- a/apps/webapp/src/app/b2c/login/page.tsx +++ b/apps/webapp/src/app/b2c/login/page.tsx @@ -103,6 +103,10 @@ export default function Page() { />
+ +

+ Welcome to Panora +

Connect your warehouse to any e-commerce platform and let AI automate data entry into your WMS & ERPs. Add revenue, not complexity to your operations.

diff --git a/apps/webapp/src/types/intercom.d.ts b/apps/webapp/src/types/intercom.d.ts new file mode 100644 index 000000000..b0d30efb4 --- /dev/null +++ b/apps/webapp/src/types/intercom.d.ts @@ -0,0 +1,4 @@ +interface Window { + Intercom?: any; + intercomSettings?: any; +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86b8f7f5a..c05fe4e25 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -246,6 +246,9 @@ importers: '@hookform/resolvers': specifier: ^3.3.4 version: 3.3.4(react-hook-form@7.51.2) + '@intercom/messenger-js-sdk': + specifier: ^0.0.14 + version: 0.0.14 '@panora/shared': specifier: workspace:* version: link:../../packages/shared @@ -3960,6 +3963,10 @@ packages: engines: {node: '>=18'} dev: false + /@intercom/messenger-js-sdk@0.0.14: + resolution: {integrity: sha512-2dH4BDAh9EI90K7hUkAdZ76W79LM45Sd1OBX7t6Vzy8twpNiQ5X+7sH9G5hlJlkSGnf+vFWlFcy9TOYAyEs1hA==} + dev: false + /@ioredis/commands@1.2.0: resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} dev: false