https://github.com/johnexzy/nextjs-pgvector-starter-with-google-genai
A nextjs starter kit for postgres+pgvector with google gen ai
https://github.com/johnexzy/nextjs-pgvector-starter-with-google-genai
Last synced: 7 months ago
JSON representation
A nextjs starter kit for postgres+pgvector with google gen ai
- Host: GitHub
- URL: https://github.com/johnexzy/nextjs-pgvector-starter-with-google-genai
- Owner: johnexzy
- Created: 2024-10-21T17:18:44.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-11-12T21:32:50.000Z (11 months ago)
- Last Synced: 2025-01-23T04:17:01.436Z (9 months ago)
- Language: TypeScript
- Homepage: https://nextjs-pgvector-starter-with-google-genai.vercel.app
- Size: 1.44 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
name: Vercel Postgres + Drizzle ORM + pgvector Next.js Starter
slug: postgres-pgvector
description: A Next.js template that uses Vercel Postgres as the database, Drizzle ORM as the ORM with pgvector to enable vector similarity search, and Google GenAI's text-embedding-004 model for embeddings.
framework: Next.js
useCase: Starter
css: Tailwind
database: Vercel Postgres
demoUrl: https://postgres-pgvector.vercel.app/
relatedTemplates:
- postgres-starter
- postgres-kysely
- postgres-drizzle
---# Vercel Postgres + Drizzle ORM + pgvector + Google GenAI Next.js Starter
A Next.js template that uses [Vercel Postgres](https://vercel.com/postgres) as the database, [Drizzle ORM](https://orm.drizzle.team/) as the ORM with [pgvector](https://github.com/pgvector/pgvector-node#drizzle-orm) to enable vector similarity search, and Google GenAI's [`text-embedding-004`](https://cloud.google.com/vertex-ai/generative-ai/docs/text-embedding/text-embedding-004) model for embeddings.
## Demo
https://postgres-pgvector.vercel.app/
### Clone and Deploy
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [pnpm](https://pnpm.io/installation) to bootstrap the example:
```bash
pnpm create next-app --example https://github.com/vercel/examples/tree/main/storage/postgres-pgvector
```Once that's done, copy the .env.example file in this directory to .env.local (which will be ignored by Git):
```bash
cp .env.example .env.local
```Then open `.env.local` and set the environment variables to match the ones in your Vercel Storage Dashboard.
Next, run Next.js in development mode:
```bash
pnpm dev
```Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples) ([Documentation](https://nextjs.org/docs/deployment)).