Code Monkey home page Code Monkey logo

quill's Introduction

Quill - A Modern Fullstack SaaS-Platform

Built with the Next.js 13.5 App Router, tRPC, TypeScript, Prisma & Tailwind

Project Image

Features

  • ๐Ÿ› ๏ธ Complete SaaS Built From Scratch
  • ๐Ÿ’ป Beautiful Landing Page & Pricing Page Included
  • ๐Ÿ’ณ Free & Pro Plan Using Stripe
  • ๐Ÿ“„ A Beautiful And Highly Functional PDF Viewer
  • ๐Ÿ”„ Streaming API Responses in Real-Time
  • ๐Ÿ”’ Authentication Using Kinde
  • ๐ŸŽจ Clean, Modern UI Using 'shadcn-ui'
  • ๐Ÿš€ Optimistic UI Updates for a Great UX
  • โšก Infinite Message Loading for Performance
  • ๐Ÿ“ค Intuitive Drag nโ€™ Drop Uploads
  • โœจ Instant Loading States
  • ๐Ÿ”ง Modern Data Fetching Using tRPC & Zod
  • ๐Ÿง  LangChain for Infinite AI Memory
  • ๐ŸŒฒ Pinecone as our Vector Storage
  • ๐Ÿ“Š Prisma as our ORM
  • ๐Ÿ”ค 100% written in TypeScript
  • ๐ŸŽ ...much more

Getting started

To get started with this project, run

  git clone https://github.com/joschan21/quill.git

and copy the .env.example variables into a separate .env file, fill them out & and that's all you need to get started!

Acknowledgements

License

MIT

quill's People

Contributors

biplobsd avatar joschan21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quill's Issues

Navbar issues

Hello there! Sign in, Get started, Pricing don't appear in the Navbar even though everything is correct in the code. Can anybody help? Thanks a lot.

vercel deployment issue

./src/app/api/message/route.ts:57:5

14:37:49.536 | Type error: Type 'VectorOperationsApi' is missing the following properties from type 'Index': config, target, deleteAll, _deleteAll, and 10 more.
14:37:49.536 | ย 
14:37:49.536 | 55 |
14:37:49.536 | 56 | const vectorStore = await PineconeStore.fromExistingIndex(embeddings, {
14:37:49.536 | > 57 | pineconeIndex,
14:37:49.536 | | ^
14:37:49.536 | 58 | namespace: file.id,
14:37:49.537 | 59 | });
14:37:49.537 | 60 |
14:37:49.682 | ELIFECYCLEโ€‰ Command failed with exit code 1.
14:37:49.703 | Error: Command "pnpm run build" exited with 1

planetscale mysql not updated

stripe_customer_id, stripe_subscription_id, stripe_price_id, stripe_current_period_end do not get updated in the planetscale mysql database once stripe payment is done in test mode

Property 'id' does not exist on type 'Promise<KindeUser | null>'.ts(2339) in dashboard/page.tsx

Not sure why, but the KindeUser is returning empty.

Here is from dashboard/tsx:

import { getKindeServerSession } from '@kinde-oss/kinde-auth-nextjs/server';
import { redirect } from "next/navigation";

const Page = () => {

const {getUser} = getKindeServerSession()
const user = getUser()

return (
<div>
{user.id}
</div>
)
}

export default Page;

Here is my api/auth/[kindeAuth]/route.ts:

import {handleAuth} from "@kinde-oss/kinde-auth-nextjs/server";
import { NextRequest } from "next/server";

export async function GET(request: NextRequest, 
	{params}: any
	) {
	const endpoint = params.kindeAuth;
	return handleAuth(request, endpoint);
}

Here is my .env:

KINDE_CLIENT_ID=cddf6cbfa9f24a98bea653b2bff880f1
KINDE_CLIENT_SECRET=KtpefogOVoQJXEd2WFwxOhvahxA5G6SJc20GZNZZzvUbYmdbvK
KINDE_ISSUER_URL=https://inquireai1.kinde.com
KINDE_SITE_URL=http://localhost:3000
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:3000
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:3000/dashboard

What could be the problem? I cannot use user.id because it is turning up empty. However, there is a user registered in Kinde

image

Kindle and verbal issue

I have been trying to authenticate the saas . I keep getting Invalid callback URL on kindle after following the instructions

Token issue

To avoid error below, does it mean we need to connect to GPT 4 instead of GPT 3.5 for some messages that require AI to do more difficult task : error: message: "This model's maximum context length is 4097 tokens. However, your messages resulted in 4589 tokens. Please reduce the length of the messages."

Link crawl features

We would love to have also a field to import link and converting it to pdf and send it to plannetscale database

is that possible ?

Pdf from scanned docs

Noticed that it does not work with pdf docs which are scanned. Anyone encoutered this issue?

width from useResizeDetector() sometimes is undefined and thus <Page/> component doesnt render

width from useResizeDetector() sometimes is undefined and thus component from react-pdf fails to render most of the time. I copy pasted the PdfRenderer.tsx from the repo and the same problem still exists.
{02B87A09-25DC-442B-9575-55E5CF975AFD}
image

//PdfRenderer.tsx

"use client";

import {
ChevronDown,
ChevronUp,
Loader2,
RotateCw,
Search,
} from "lucide-react";
import { Document, Page, pdfjs } from "react-pdf";

import "react-pdf/dist/Page/AnnotationLayer.css";
import "react-pdf/dist/Page/TextLayer.css";
import { useToast } from "./ui/use-toast";

import { useResizeDetector } from "react-resize-detector";
import { Button } from "./ui/button";
import { Input } from "./ui/input";
import { useState } from "react";

import { useForm } from "react-hook-form";
import { z } from "zod";

import { zodResolver } from "@hookform/resolvers/zod";
import { cn } from "@/lib/utils";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "./ui/dropdown-menu";

import SimpleBar from "simplebar-react";
import PdfFullscreen from "./PdfFullscreen";

pdfjs.GlobalWorkerOptions.workerSrc = //cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js;

interface PdfRendererProps {
url: string;
}

const PdfRenderer = ({ url }: PdfRendererProps) => {
const { toast } = useToast();

const [numPages, setNumPages] = useState();
const [currPage, setCurrPage] = useState(1);
const [scale, setScale] = useState(1);
const [rotation, setRotation] = useState(0);
const [renderedScale, setRenderedScale] = useState<number | null>(null);

const isLoading = renderedScale !== scale;

const CustomPageValidator = z.object({
page: z
.string()
.refine((num) => Number(num) > 0 && Number(num) <= numPages!),
});

type TCustomPageValidator = z.infer;

const {
register,
handleSubmit,
formState: { errors },
setValue,
} = useForm({
defaultValues: {
page: "1",
},
resolver: zodResolver(CustomPageValidator),
});

const { width, ref } = useResizeDetector();
console.log(width);

const handlePageSubmit = ({ page }: TCustomPageValidator) => {
setCurrPage(Number(page));
setValue("page", String(page));
};

return (




<Button
disabled={currPage <= 1}
onClick={() => {
setCurrPage((prev) => (prev - 1 > 1 ? prev - 1 : 1));
setValue("page", String(currPage - 1));
}}
variant="ghost"
aria-label="previous page"
>

      <div className="flex items-center gap-1.5">
        <Input
          {...register("page")}
          className={cn(
            "w-12 h-8",
            errors.page && "focus-visible:ring-red-500"
          )}
          onKeyDown={(e) => {
            if (e.key === "Enter") {
              handleSubmit(handlePageSubmit)();
            }
          }}
        />
        <p className="text-zinc-700 text-sm space-x-1">
          <span>/</span>
          <span>{numPages ?? "x"}</span>
        </p>
      </div>

      <Button
        disabled={numPages === undefined || currPage === numPages}
        onClick={() => {
          setCurrPage((prev) =>
            prev + 1 > numPages! ? numPages! : prev + 1
          );
          setValue("page", String(currPage + 1));
        }}
        variant="ghost"
        aria-label="next page"
      >
        <ChevronUp className="h-4 w-4" />
      </Button>
    </div>

    <div className="space-x-2">
      <DropdownMenu>
        <DropdownMenuTrigger asChild>
          <Button className="gap-1.5" aria-label="zoom" variant="ghost">
            <Search className="h-4 w-4" />
            {scale * 100}%
            <ChevronDown className="h-3 w-3 opacity-50" />
          </Button>
        </DropdownMenuTrigger>
        <DropdownMenuContent>
          <DropdownMenuItem onSelect={() => setScale(1)}>
            100%
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={() => setScale(1.5)}>
            150%
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={() => setScale(2)}>
            200%
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={() => setScale(2.5)}>
            250%
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>

      <Button
        onClick={() => setRotation((prev) => prev + 90)}
        variant="ghost"
        aria-label="rotate 90 degrees"
      >
        <RotateCw className="h-4 w-4" />
      </Button>

      <PdfFullscreen fileUrl={url} />
    </div>
  </div>

  <div className="flex-1 w-full max-h-screen">
    <SimpleBar autoHide={false} className="max-h-[calc(100vh-10rem)]">
      <div ref={ref}>
        <Document
          loading={
            <div className="flex justify-center">
              <Loader2 className="my-24 h-6 w-6 animate-spin" />
            </div>
          }
          onLoadError={() => {
            toast({
              title: "Error loading PDF",
              description: "Please try again later",
              variant: "destructive",
            });
          }}
          onLoadSuccess={({ numPages }) => setNumPages(numPages)}
          file={url}
          className="max-h-full"
        >
          {isLoading && renderedScale ? (
            <Page
              width={width ? width : 1}
              pageNumber={currPage}
              scale={scale}
              rotate={rotation}
              key={"@" + renderedScale}
            />
          ) : null}

          <Page
            className={cn(isLoading ? "hidden" : "")}
            width={width ? width : 1}
            pageNumber={currPage}
            scale={scale}
            rotate={rotation}
            key={"@" + scale}
            loading={
              <div className="flex justify-center">
                <Loader2 className="my-24 h-6 w-6 animate-spin" />
              </div>
            }
            onRenderSuccess={() => setRenderedScale(scale)}
          />
        </Document>
      </div>
    </SimpleBar>
  </div>
</div>

);
};

export default PdfRenderer;

PageProps - typeof file

Hi, if i want to create a FileCard component to remove the code from the .map() function in the Dashboard to create a separate component, how I can set the PageProps to automatically get the type of "file" passed as props?

PineconeIndex namespace Error

While testing Pinecone within api/uploadthing/core.ts i get the error:

 TypeError: this.pineconeIndex.namespace is not a function
    at PineconeStore.addVectors (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/langchain/dist/vectorstores/pinecone.js:113:46)
    at PineconeStore.addDocuments (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/langchain/dist/vectorstores/pinecone.js:69:21)

core.ts :

import { db } from "@/db";
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
import { createUploadthing, type FileRouter } from "uploadthing/next";

import { PDFLoader } from "langchain/document_loaders/fs/pdf";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { PineconeStore } from "langchain/vectorstores/pinecone";
import { getPineconeClient } from "@/lib/pinecone";

const f = createUploadthing();

const middleware = async () => {
  const { getUser } = getKindeServerSession();
  const user = getUser();

  if (!user || !user.id) throw new Error("Unauthorized");

  return { userId: user.id };
};

const onUploadComplete = async ({
  metadata,
  file,
}: {
  metadata: Awaited<ReturnType<typeof middleware>>;
  file: {
    key: string;
    name: string;
    url: string;
  };
}) => {
  const isFileExist = await db.file.findFirst({
    where: {
      key: file.key,
    },
  });

  if (isFileExist) return;

  const createdFile = await db.file.create({
    data: {
      key: file.key,
      name: file.name,
      userId: metadata.userId,
      url: `https://uploadthing-prod.s3.us-west-2.amazonaws.com/${file.key}`,
      uploadStatus: "PROCESSING",
    },
  });

  try {
    const response = await fetch(
      `https://uploadthing-prod.s3.us-west-2.amazonaws.com/${file.key}`
    );

    const blob = await response.blob();

    const loader = new PDFLoader(blob);

    const pageLevelDocs = await loader.load();

    const pagesAmt = pageLevelDocs.length;

    // vectorize and index entire document
    const pinecone = await getPineconeClient();
    const pineconeIndex = pinecone.Index("chatty-pdf");

    const embeddings = new OpenAIEmbeddings({
      openAIApiKey: process.env.OPENAI_API_KEY,
    });

    await PineconeStore.fromDocuments(pageLevelDocs, embeddings, {
      // @ts-ignore
      pineconeIndex,
      namespace: createdFile.id,
    });

    await db.file.update({
      data: {
        uploadStatus: "SUCCESS",
      },
      where: {
        id: createdFile.id,
      },
    });
  } catch (error) {
    console.log("Processing Err: ", error);
    await db.file.update({
      data: {
        uploadStatus: "FAILED",
      },
      where: {
        id: createdFile.id,
      },
    });
  }
};

export const ourFileRouter = {
  pdfUploader: f({ pdf: { maxFileSize: "4MB" } })
    .middleware(middleware)
    .onUploadComplete(onUploadComplete),
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;

I can verify that the content of lib/pinecone.ts is correct (apikey and environment).
How can i resolve this and continue learning?

Error [InsufficientQuotaError]: You exceeded your current quota, please check your plan and billing details.

Hello folks,

After the update of pinecone has anyone face issue of Error [InsufficientQuotaError]: You exceeded your current quota, please check your plan and billing details. at Object.defaultFailedAttemptHandler [as onFailedAttempt] (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/langchain/dist/util/async_caller.js:37:21) at RetryOperation.eval [as _fn] (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/p-retry/index.js:55:39)

I had seen a lot of deployed app are also throwing error on uploading pdf.

Examle: https://pdfninja.vercel.app/
This app is also showing FAILED comp on ChatWrapper. @joschan21 @biplobsd

image

Namespaces are not available in Pinecone Free Plan

As per the Pinecone docs:
Projects in the gcp-starter environment do not currently support namespaces.

If one uses the Index without namespaces, there is a high probability of data leaks between different users' PDFs.

A workaround is using other Vector DBs to create a separate vector store for each PDF file.

Encounter Hydration error due to extra <textarea> rendered outside the main div

Did anyone encounter this error?

Error: Hydration failed because the initial UI does not match what was rendered on the server.
Warning: Expected server HTML to contain a matching <textarea> in <div>.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
image

When rendering, another <Textarea/> component seems to be rendered outside the main div. It happens only when I pass autoFocus into the <Textarea/>

This is my ChatInput.tsx

import { Send } from "lucide-react";
import { Button } from "../ui/button";
import { Textarea } from "../ui/textarea";
interface ChatInputProps {
  isDisabled?: boolean;
}

const ChatInput = ({ isDisabled }: ChatInputProps) => {
  return (
    <div className="absolute bottom-0 left-0 w-full">
      <form className="mx-2 flex flex-row gap-3 md:mx-4 md:last:mb-6 lg:mx-auto lg:max-w-2xl xl:max-w-3xl">
        <div className="relative flex h-full flex-1 items-stretch md:flex-col">
          <div className="relative flex w-full flex-grow flex-col p-4">
            <div className="relative">
              <Textarea
                rows={1}
                autoFocus
                maxRows={4}
                placeholder="Enter your question..."
                className="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch resize-none py-3 pr-12 text-base"
              />
              <Button aria-label="send">
                <Send className="h-4 w-4" />
              </Button>
            </div>
          </div>
        </div>
      </form>
    </div>
  );
};

export default ChatInput;

authentication issues

Hello guys. I have a few issues: I tried to sign in but got this message: This page isnโ€™t working localhost is currently unable to handle this request.
HTTP ERROR 500
In the terminal I get: TypeError: Invalid URL code: 'ERR_INVALID_URL input: '/oauth2/auth
Your help is appreciated.
route.ts:
import {handleAuth} from "@kinde-oss/kinde-auth-nextjs/server";
import { NextRequest } from "next/server";

export async function GET(request: NextRequest, {params}: any) {
const endpoint = params.kindeAuth;
return handleAuth(request, endpoint);
}

.env:
ID=4901adb23e5043ecbb43b6dd4f6e012f
KINDE_CLIENT_SECRET=5CVuqFl9mCg2LUgmVxwuvJnYK3j65mZ2eg3czt57NXQJykK7QC
KINDE_ISSUER_URL=https://doklaw2.kinde.com
KINDE_SITE_URL=http://localhost:3000
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:3000
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:3000/dashboard

2nd ISSUE: the "Get started" buttons are blue, I don't know why. Also the
Chat with your documents in seconds.
DokLaw allows you to have conversations with your PDF document. Simply upload your file and start asking questions right away.

Get started is not centered. Again any help would be appreciated.

import MaxWidthWrapper from "@/components/MaxWidthWrapper";
import Link from "next/link";
import { ArrowRight } from "lucide-react";
import { buttonVariants } from "@/components/ui/button";
import Image from 'next/image'

export default function Home() {
return (
<>



DokLaw is live!




Chat with your documents in seconds.



DokLaw allows you to have conversations with your PDF document. Simply upload your file and start asking questions right away.

  <Link className={buttonVariants({
    size: 'lg',
    className: "mt-5",
  })} href='/dashboard'
   target='_blank'>
    Get started {''}
     <ArrowRight className="ml-2 h-5 w-5" />
  </Link>
</MaxWidthWrapper>
<div>
    <div className='relative isolate'>
      <div
        aria-hidden='true'
        className='pointer-events-none absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80'>
        <div
          style={{
            clipPath:
              'polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)',
          }}
          className='relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]'
        />
      </div>
      <div>
        <div className='mx-auto max-w-6xl px-6 lg:px-8'>
          <div className='mt-16 flow-root sm:mt-24'>
            <div className='-m-2 rounded-xl bg-gray-900/5 p-2 ring-1 ring-inset ring-gray-900/10 lg:-m-4 lg:rounded-2xl lg:p-4'>
            <Image
            src='/dashboard-preview.jpg'
            alt='product preview'
            width={1364}
            height={866}
            quality={100}
            className='rounded-md bg-white p-2 sm:p-8 md:p-20 shadow-2xl ring-1 ring-gray-900/10'
            /> 
            </div>
          </div>
        </div>
      </div>

      <div
        aria-hidden='true'
        className='pointer-events-none absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80'>
        <div
          style={{
            clipPath:
              'polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)',
          }}
          className='relative left-[calc(50%-13rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%-36rem)] sm:w-[72.1875rem]'
        />
      </div>
    </div>
  </div>
  {/* Feature section */}
  <div className='mx-auto mb-32 mt-32 max-w-5xl sm:mt-56'>
    <div className='mb-12 px-6 lg:px-8'>
      <div className='mx-auto max-w-2xl sm:text-center'>
        <h2 className='mt-2 font-bold text-4xl text-gray-900 sm:text-5xl'>
          Start chatting in minutes
        </h2>
        <p className='mt-4 text-lg text-gray-600'>
          Chatting to your PDF files has never been
          easier than with DokLaw.
        </p>
      </div>
    </div>
    {/* steps */}
    <ol className='my-8 space-y-4 pt-8 md:flex md:space-x-12 md:space-y-0'>
      <li className='md:flex-1'>
        <div className='flex flex-col space-y-2 border-l-4 border-zinc-300 py-2 pl-4 md:border-l-0 md:border-t-2 md:pb-0 md:pl-0 md:pt-4'>
          <span className='text-sm font-medium text-blue-600'>
            Step 1
          </span>
          <span className='text-xl font-semibold'>
            Sign up for an account
          </span>
          <span className='mt-2 text-zinc-700'>
            Either starting out with a free plan or
            choose our{' '}
            <Link
              href='/pricing'
              className='text-blue-700 underline underline-offset-2'>
              pro plan
            </Link>
            .
          </span>
        </div>
      </li>
      <li className='md:flex-1'>
        <div className='flex flex-col space-y-2 border-l-4 border-zinc-300 py-2 pl-4 md:border-l-0 md:border-t-2 md:pb-0 md:pl-0 md:pt-4'>
          <span className='text-sm font-medium text-blue-600'>
            Step 2
          </span>
          <span className='text-xl font-semibold'>
            Upload your PDF file
          </span>
          <span className='mt-2 text-zinc-700'>
            We&apos;ll process your file and make it
            ready for you to chat with.
          </span>
        </div>
      </li>
      <li className='md:flex-1'>
        <div className='flex flex-col space-y-2 border-l-4 border-zinc-300 py-2 pl-4 md:border-l-0 md:border-t-2 md:pb-0 md:pl-0 md:pt-4'>
          <span className='text-sm font-medium text-blue-600'>
            Step 3
          </span>
          <span className='text-xl font-semibold'>
            Start asking questions
          </span>
          <span className='mt-2 text-zinc-700'>
            It&apos;s that simple. Try out DokLaw today -
            it really takes less than a minute.
          </span>
        </div>
      </li>
    </ol>

    <div className='mx-auto max-w-6xl px-6 lg:px-8'>
      <div className='mt-16 flow-root sm:mt-24'>
        <div className='-m-2 rounded-xl bg-gray-900/5 p-2 ring-1 ring-inset ring-gray-900/10 lg:-m-4 lg:rounded-2xl lg:p-4'>
          <Image
            src='/file-upload-preview.jpg'
            alt='uploading preview'
            width={1419}
            height={732}
            quality={100}
            className='rounded-md bg-white p-2 sm:p-8 md:p-20 shadow-2xl ring-1 ring-gray-900/10'
          />
        </div>
      </div>
    </div>
  </div>
</>

)
}

Too many pages in PDF

I checked everything, but it still keeps showing "Too many pages in PDF"

I also cloned it and put my .env file but still same issues.
Also tried all the possible solutions in #2 but it's stiil the same error.

Any fix @joschan21 ?
Is it because pinecone got updated ?

[404] getFile?batch=1 404

Hi, I tried running it on my localhost and encountered an error after uploading a PDF:
POST http://localhost:3000/api/trpc/getFile?batch=1 404 (Not Found) httpUtils-0cb58db4.mjs:104

Screen.Recording.2023-09-30.404.mp4

TRPC install issue

Hi guys! I can't install trpc with npm. Any suggestions? Thanks.
npm ERR! code ERESOLVE
ERESOLVE unable to resolve depency tree.

Missing tailwind option

At the start of your video, you modified the tailwind.config.ts and added:
maxWidth: { "8xl": "1408px", },

But later you installed a shadcn component via the cli.
What shadcn does when doing init, is replacing the whole theme config object, same for the globals.css.
Thats also why the blue color was gone that we pasted at the beginning (before doing the init) into our css and had to re-do it later in the video again.

So the max-w we are using the /dashboard/[fileid] is not doing anything.

How to fix profile picture images? Seems broken, Also have a problem with uploading documents

First Problem: How to fix broken image?
image

Second problem: When I click to upload a document it makes 2 file explorer open on top of each other and would have to move one to see the other one behind it, How can I fix this so only 1 pops up when clicking upload document?

ALSO, when I upload a 1 page document I get "Too many pages" and it thinks I've uploaded max pages. So need a fix for that too

Log in Callback Error

I added all the links to the callback in Kinde, does it take time to update? I added all necessary links and still get this callback error...
image

Still get this error when trying to log in:
image

Kinde Authentication Error

I was following along Josh's tutorial video when I noticed that when I tried to open the dashboard page when not authenticated, it redirected to a page that does not exist ("/sign-in") in the onError function. I edited the url to /api/auth/login and the redirect works fine, but somehow Kinde gives an error everytime I try to log in through redirection. When I try logging in via the front end ( LoginLink Component ) or if I typed the url in the browser, it works just fine.

onError: (err) => {
            if(err.data?.code === "UNAUTHORIZED") {
                router.push("/api/auth/login")  
                
            }
            // router.push("/sign-in")  
            
        },  

kinde_error

Is there anything I missed? could it be a problem in the Kinde side or the browser? Thanks

Pinecone namespace not supported for starter plan

I guess they recently updated the starter plan so we can't use namespace anymore, any alternative?

PineconeBadRequestError: The requested feature 'Namespaces' is not supported by the current index type 'Starter'. at mapHttpStatusError (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/http.js:179:20) at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:170:55) at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:107:23) at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:48:20) at fulfilled (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:11:32) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: undefined }

uploading on vercel

I encountered the problem of "ERR_PNPM_OUTDATED_LOCKFILEโ€‰ Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json"

Trouble logging into dashboard on deployed version: Failed to load resource: the server responded with a status of 404

Hi everyone, very frustrated that I can't get this to work. Anytime I log in to the Kinde Auth on the deployed version I get this error:
image. I am not redirected to my dashboard but to the home page.

Failed to load resource: the server responded with a status of 404 ()

Some things I've tried and helpful information:

  • Local Host works.
  • The new user exists in the Kinde database after sign up.
  • Planetscale doesn't seem to be getting an API response. I have made a new database and new key and tested that, plugging it into Vercel and re-deploying. The error is still there.
  • Deleting the middleware file doesn't help.

There is a related issue on this Github thread (at the very end): #17
but the issue was never closed. Has anyone had the same issue and found a solution? Thanks.

Build failed because of webpack errors

By following the video, I have successfully deployed the "inital commit" version of the app, then Josh has made some changes inside the code and I have followed, but as you can see while deploying the"stripe stuff" version, I get the error " Build failed because of webpack errors", I leave the screenshot that I get in VSCode. I have checked the spelling errors and all other possible mistakes that I could have made.

image

dialog.tsx erro (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)

how fix this erro on dialog.tsx : Type '{ children?: ReactNode; container?: HTMLElement | null | undefined; forceMount?: true | undefined; className: string; }' is not assignable to type 'IntrinsicAttributes & DialogPortalProps'.
Property 'className' does not exist on type 'IntrinsicAttributes & DialogPortalProps'.
const DialogPortal = ({ className, ...props }: DialogPrimitive.DialogPortalProps) => ( <DialogPrimitive.Portal className ={cn(className)}{...props} /> )

Vercel issues

I got this error codes while trying to deploy.

17:6 Warning: React Hook useEffect has a missing dependency: 'isOpen'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

09:39:21.041 | ย 
09:39:21.041 | info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
09:39:26.750 | Failed to compile.
09:39:26.750 | ย 
09:39:26.750 | ./src/components/ui/dialog.tsx:14:3
09:39:26.750 | Type error: Property 'className' does not exist on type 'DialogPortalProps'.
09:39:26.750 | ย 
09:39:26.751 | 12 |
09:39:26.751 | 13 | const DialogPortal = ({
09:39:26.751 | > 14 | className,
09:39:26.751 | | ^
09:39:26.751 | 15 | ...props
09:39:26.751 | 16 | }: DialogPrimitive.DialogPortalProps) => (
09:39:26.751 | 17 | <DialogPrimitive.Portal className={cn(className)} {...props} />
09:39:26.913 | Error: Command "npm run build" exited with 1

Kinde upgrade to V2

Is it possible to upgrade Kinde Auth to V2? I've tried to do it myself but I've been having problems with /dashboard not loading which I can't seem to pinpoint the reason for.

first file uploadstatus changed to 'FAILED' as required but then changes to 'SUCCESS' even the file is not eligible for 'SUCCESS'

path: https://github.com/joschan21/quill/blob/master/src/app/api/uploadthing/core.ts

file: core.ts

there is a potential flaw in the approach where the upload status is updated to "SUCCESS" without considering any condition. This means that regardless of whether the upload exceeded the allowed limit or not, the upload status will always be set to "SUCCESS" at the end of the function.

To address this flaw, it would be better to update the upload status to "SUCCESS" only if the upload did not exceed the allowed limit. Currently, the code only updates the upload status to "FAILED" if the limit is exceeded, but it does not provide a corresponding update to set the status to "SUCCESS" if the limit is not exceeded. This inconsistency could lead to incorrect status reporting in the database.

You can add an additional check before the last db.file.update() call to update the upload status to "SUCCESS" only when the limit is not exceeded. This can be done by negating the condition used to update the status to "FAILED". For example:

if (!(isSubscribed && isProExceeded) && !(isFreeExceeded)) { await db.file.update({ data: { uploadStatus: 'SUCCESS', }, where: { id: createdFile.id, }, }); }

kindeAuth/route.ts Error when deploying to Vercel

I am getting an error in kindeAuth/route.ts when I deploy to Vercel.

image Failed to compile. -- 13:43:41.548 | ย  13:43:41.549 | src/app/api/auth/[kindeAuth]/route.ts 13:43:41.549 | Type error: Route "src/app/api/auth/[kindeAuth]/route.ts" has an invalid export: 13:43:41.549 | "Promise<(req: any, res: any) => any>" is not a valid GET return type: 13:43:41.549 | Expected "void \| Response \| Promise", got "Promise<(req: any, res: any) => any>". 13:43:41.550 | Expected "Promise", got "Promise<(req: any, res: any) => any>". 13:43:41.550 | Expected "void \| Response", got "(req: any, res: any) => any". 13:43:41.550 | ย  13:43:41.702 | Error: Command "npm run build" exited with 1

It works fine in the local environment. Here is my repository: https://github.com/ck18sss/InquireAI_v2

This is the code in kindeAuth:

import { handleAuth } from '@kinde-oss/kinde-auth-nextjs/server'
import { NextRequest } from 'next/server'

export async function GET(
  request: NextRequest,
  { params }: any
) {
  const endpoint = params.kindeAuth
  return handleAuth(request, endpoint)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.