💿 1.1. Install all the dependencies:
npm install
Read the full tutorial here.
Requirements:
| function onSelected(extractEntity: ExtractCustomEntitiesDto) { | |
| const mapping: { [key: string]: string } = { | |
| target_market: "targetMarket", | |
| pain_points: "problemStatement", | |
| capability: "capability", | |
| alternative: "alternative", | |
| feature: "feature", | |
| benefit: "benefit", | |
| use_case: "useCase", | |
| strategic_narrative: "strategicNarrative", |
| import { ActionArgs, json } from "@remix-run/node"; | |
| import { useTypedActionData, useTypedLoaderData } from "remix-typedjson"; | |
| import { i18nHelper } from "~/locale/i18n.utils"; | |
| import EditPageLayout from "~/components/ui/layouts/EditPageLayout"; | |
| import { EntityWithDetails, getAllEntities } from "~/utils/db/entities/entities.db.server"; | |
| import { TenantWithDetails, adminGetAllTenants, getTenant } from "~/utils/db/tenants.db.server"; | |
| import TableSimple from "~/components/ui/tables/TableSimple"; | |
| import { useEffect } from "react"; | |
| import { useTranslation } from "react-i18next"; | |
| import NumberUtils from "~/utils/shared/NumberUtils"; |
| import CryptoJS from "crypto-js"; | |
| function encrypt(text: string) { | |
| const secret = process.env.CRYPTO_SECRET?.toString(); | |
| if (!secret) { | |
| throw Error("CRYPTO_SECRET not set"); | |
| } | |
| const ciphertext = CryptoJS.AES.encrypt(text, secret).toString(); | |
| return ciphertext; | |
| } |
| export type PerformanceServerTimings = Record<string, Array<PerformanceServerTiming>>; | |
| /** | |
| * Run this on the server to get a `time` function that can be used to time | |
| * server-side operations and add them to the `Server-Timing` header. | |
| */ | |
| export type TimeFunction = <T>( | |
| serverTiming: | |
| | string | |
| | { |
| import { HeadersFunction } from "@remix-run/node" | |
| export const serverTimingHeaders: HeadersFunction = ({ | |
| loaderHeaders, | |
| parentHeaders, | |
| }) => { | |
| return setServerTimingHeaders(new Headers(), { | |
| loaderHeaders, | |
| parentHeaders, | |
| }) |
| import { json, LoaderFunction, V2_MetaFunction } from "@remix-run/node"; | |
| import { useLoaderData, useSearchParams } from "@remix-run/react"; | |
| import { useAppData } from "~/utils/data/useAppData"; | |
| import { DashboardLoaderData, loadDashboardData } from "~/utils/data/useDashboardData"; | |
| import { i18nHelper } from "~/locale/i18n.utils"; | |
| import { getAppDashboardStats } from "~/utils/services/appDashboardService"; | |
| import ProfileBanner from "~/components/app/ProfileBanner"; | |
| import { DashboardStats } from "~/components/ui/stats/DashboardStats"; | |
| import { getTenantIdFromUrl } from "~/utils/services/urlService"; | |
| import { Stat } from "~/application/dtos/stats/Stat"; |
| prisma:client Prisma Client call: +3m | |
| prisma:client prisma.user.findUnique({ | |
| where: { | |
| id: 'clgvf8sqn003igogrsxorlde7' | |
| }, | |
| include: { | |
| admin: true | |
| } | |
| }) +0ms | |
| prisma:client Generated request: +0ms |
| generator client { | |
| provider = "prisma-client-js" | |
| previewFeatures = ["jsonProtocol"] | |
| } | |
| datasource db { | |
| provider = "postgresql" | |
| url = env("DATABASE_URL") | |
| } |