https://github.com/7-docs/template-next-supabase
Starterkit for Next.js, Supabase and @7-docs/edge
https://github.com/7-docs/template-next-supabase
Last synced: about 1 year ago
JSON representation
Starterkit for Next.js, Supabase and @7-docs/edge
- Host: GitHub
- URL: https://github.com/7-docs/template-next-supabase
- Owner: 7-docs
- Created: 2023-04-28T17:18:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-30T07:53:04.000Z (about 3 years ago)
- Last Synced: 2025-04-05T12:04:32.506Z (about 1 year ago)
- Language: TypeScript
- Size: 71.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# template-next-supabase
Starterkit for OpenAI chat client based on your own content. Main ingredients:
- [Next.js](https://nextjs.org)
- [Supabase](https://supabase.com) + [pgvector](https://supabase.com/docs/guides/database/extensions/pgvector)
- [@7-docs/edge](https://www.npmjs.com/package/@7-docs/edge)
- TypeScript
- Tailwind
## Install
- [Use this template](https://github.com/7-docs/template-next-supabase/generate)
- Clone your new repo
- `npm install`
- [Prepare vector database](#prepare-db)
- [Ingest content](#ingest)
- `cp .env.example .env.local` and paste your tokens: `OPENAI_API_KEY`, `SUPABASE_URL`, `SUPABASE_API_KEY`
The following commands are using `my-namespace` as set in [config.ts](./config.ts) and ingest content from the
`reactjs/react.dev` repository. By all means, you're encouraged to change them to something more original.
## Prepare db
Create a Supabase account if you don't have one already.
The following command does not actually do anything. Instead, it gives you an all-batteries-included SQL query to run in
your [Supabase project area](https://app.supabase.com/projects)'s SQL Editor:
```shell
npx 7d supabase-create-table --namespace my-namespace
```
## Ingest
```shell
npx 7d ingest \
--source github \
--repo reactjs/react.dev \
--files 'src/content/reference/react/*.md' \
--files 'src/content/reference/react-dom/*.md' \
--files 'src/content/learn/*.md' \
--namespace my-namespace
```
## Run
```shell
npm run dev
```
## Deploy
This application can be deployed on platforms with support for Next.js + edge functions. Examples:
- [Vercel](https://vercel.com)
- [Fly.io](https://fly.io)
Make sure to add the environment variables to the platform first.