This is the repository for Phlama App.
-
Recommended Machine OS: Linux or MacOS. For Windows users use
wsl. -
First we need to install
Node.JSin the machine. Use thenvmpackage manager to installNode.JS. -
Install
nvmin the machine locally: Install NVM -
After installing
nvmrun this command to install and use the proper version ofNode.JSfor Phlama App.nvm install
-
After installing
Node.JSinstallpnpmby running:npm install --global corepack@latest corepack enable pnpm -
To run the application in development mode we need to install
turboglobally in the machine.pnpm add turbo --global
-
Install all the dependencies:
pnpm install
-
Create environment variables file
.env.localforapps/webapp with these values:NEXT_PUBLIC_CONVEX_URL=<NEXT_PUBLIC_CONVEX_URL> NEXT_PUBLIC_CLERK_FRONTEND_URL=<NEXT_PUBLIC_CLERK_FRONTEND_URL> NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY> CLERK_SECRET_KEY=<CLERK_SECRET_KEY> NEXT_PUBLIC_CLERK_SIGN_IN_URL=<NEXT_PUBLIC_CLERK_SIGN_IN_URL> NEXT_PUBLIC_CLERK_SIGN_UP_URL=<NEXT_PUBLIC_CLERK_SIGN_UP_URL> NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=<NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL> NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=<NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL> SENTRY_AUTH_TOKEN=<SENTRY_AUTH_TOKEN>
-
Create environment variables file
.env.localforapps/widgetapp with these values:NEXT_PUBLIC_CONVEX_URL=<NEXT_PUBLIC_CONVEX_URL>
-
Create environment variables file
.env.localforpackages/backendpackage with these values:CONVEX_DEPLOYMENT=<CONVEX_DEPLOYMENT> CONVEX_URL=<CONVEX_URL> CONVEX_SITE_URL=<CONVEX_SITE_URL> CLERK_FRONTEND_API_URL=<CLERK_FRONTEND_API_URL> CLERK_JWT_ISSUER_DOMAIN=<CLERK_JWT_ISSUER_DOMAIN> CLERK_SECRET_KEY=<CLERK_SECRET_KEY> CLERK_WEBHOOK_SECRET=<CLERK_WEBHOOK_SECRET> OPENAI_API_KEY=<OPENAI_API_KEY> AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> AWS_REGION=<AWS_REGION>
-
After all the steps run the Phlama App locally:
turbo dev
-
Build all the applications locally:
turbo build
-
In the
apps/embedapp if we are updating the embed script then we need to run this command to generate the JavaScript code to serve from the CDN:VITE_WIDGET_URL=https://phlama-app-widget.vercel.app/ pnpm build
-
Then we need to rename the generated
widget.iife.jstowidget.js. -
After that place the
widget.jsin theapps/widget/publicfolder.