A ChatGPT clone built with Next.js and Vercel AI SDK.
This project depends on some software and third-party services.
-
Make sure you already have Node.js and PostgreSQL installed on your machine.
-
Under the hood, this app will make requests to the Chat Completions API, so you need to get your OpenAI API key.
-
The app is using Github and Google for authentication using OAuth2. You need to to get the OAuth2 client ID and secret for Github and Google.
-
An email server for sending emails e.g: SendGrid.
After cloning this repo, follow these steps:
-
Connect to your PostgreSQL server and create new database and user:
CREATE DATABASE chatgpt_clone; CREATE USER chatgpt_clone WITH PASSWORD '<your password>'; GRANT ALL PRIVILEGES ON chatgpt_clone TO chatgptp_clone;
-
Copy the
.env.local_sample
to.env.local
and fill in all of the values. -
Install the dependencies:
npm install
-
Run the database migrations:
npx prisma migrate dev
The command will create the tables in your PostgreSQL database. Note that the command being used is
npx
instead ofnpm
. -
Run the development server:
npm run dev
You can open the app on http://localhost:8000
using your browser.
MIT