Quickstart

Quickstart

First we need to clone the git repository

git clone https://github.com/fristicool/nextai-nextjs-starterkit.git [YOUR_APP_NAME]
cd [YOUR_APP_NAME]
pnpm install
git remote remove origin
pnpm dev

Once cloned and ran, you will encounter some errors because we need to set some enviroment variables. We copy the .env.example :

.env
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=****
CLERK_SECRET_KEY=****
 
POSTGRES_URL="****"
POSTGRES_DIRECT_URL="****"
 
GROQ_API_KEY=****
FAL_API_KEY=****
 
N8N_WEBHOOK_URL="https://your-n8n-instance.app.n8n.cloud/webhook/path" # The webhook url of your n8n instance
 
NEXT_PUBLIC_POSTHOG_KEY=****
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
 
NEXT_PUBLIC_APP_URL=http://localhost:3000
 
IMGUR_CLIENT_ID=****
IMGUR_CLIENT_SECRET=****

After we copied this .env.example to the .env, we just need to set the above enviroment variables to get the demo working.

Auth

The api routes and /chat pages are protected by clerk, so you will be redirected to login. Once logged in you still can't do any api calls because the api calls are protected by auth and payments. To make it easy to begin working locally, you can just go the /api/init route when logged in. This will setup everything to get started. That means the right subscription status and the user in the database.

Now everything should be ready to go, and you should be able to send your first message to your AI chatbot