This is a fork of https://github.com/vercel/next.js/tree/canary/examples/with-supabase with added:
- Sign-in with Google capability (turn on in Supabase, sign-up in Google Cloud console)
- Tailwind v4
- Basic AI Chat capabilities using Vercel's AI package
- Setup a Supabase project by going to: database.new
- Copy the environment variables template:
cp .env.example .env.local
- Update the environment variables in
.env.local
with your values - Run
npm i
- Run
npm run dev
- Remove the GitHub remote so you can use your own repository:
git remote remove origin
npx create-next-app -e with-supabase --tailwind --eslint --app --use-npm --ts
Then I updated some outdated packages (minus Tailwind):
npm outdated && npm update
Then I upgraded Tailwind to v4:
npx @tailwindcss/upgrade@next
Finally, I added the following mods:
- Simplified the UI and made the navigation easier
- Added some code for signing in with Google authentication. You can easily add other providers
- Added AI chat so you can see an example of API routes and streaming chat
- Added a cursor rules file that explains the tech stack
The starter includes a basic AI chat implementation using Vercel's AI package using OpenAI ChatGPT (you can change):
- Server-side API route for handling chat requests
- Basic chat interface
The .env.local
file should contain the following variables:
-
Both
NEXT_PUBLIC_SUPABASE_URL
andNEXT_PUBLIC_SUPABASE_ANON_KEY
can be found in your Supabase project's API settings -
You'll need an OpenAI API key to use the AI chat functionality. Get one at platform.openai.com.