This project is a web application that uses the OpenAI API to find similar sentences to the one you provide.
NextJS, Typescript, TailwindCSS, Prisma, Redis, OpenAI API, Google OAuth, Vercel
To see the project in action, visit the following link:
To get this application up and and running on your local machine follow these simple steps.
You need to have Node.js and npm installed on your machine.
-
Clone the repo
git clone https://github.com/ahmetenesdur/similarity-api
-
Install NPM packages
npm install
or
yarn install
-
Create an
.env.local
file looking like thisNEXTAUTH_SECRET= NEXTAUTH_URL= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= DATABASE_URL= OPENAI_API_KEY= REDIS_URL= REDIS_SECRET=
-
Create a Google OAuth Client and add the client id and secret to the
.env.local
file -
Create a OpenAI API Key and add the key to the
.env.local
file -
Create a Redis Cloud Account and add the url and secret to the
.env.local
file -
Prisma generate, db push and init
npx prisma generate npx prisma init npx prisma db push or yarn prisma generate yarn prisma init yarn prisma db push
-
Run the development server
npm run dev
or
yarn dev
-
Open http://localhost:3000 with your browser to see the result.
- Login with your Google Account
- Get your API Key
- Use the API Key to make requests to the API
- Similarly API is a REST API that takes a sentence and returns similar sentences to it.
Distributed under the MIT License. See LICENSE
for more information.