Skip to content

flowfree/chatgpt-clone

Repository files navigation

ChatGPT Clone

A ChatGPT clone built with Next.js and Vercel AI SDK.

Prerequisites

This project depends on some software and third-party services.

  1. Make sure you already have Node.js and PostgreSQL installed on your machine.

  2. Under the hood, this app will make requests to the Chat Completions API, so you need to get your OpenAI API key.

  3. 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.

  4. An email server for sending emails e.g: SendGrid.

Running on development machine

After cloning this repo, follow these steps:

  1. 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;
    
  2. Copy the .env.local_sample to .env.local and fill in all of the values.

  3. Install the dependencies:

    npm install
    
  4. 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 of npm.

  5. Run the development server:

    npm run dev
    

You can open the app on http://localhost:8000 using your browser.

License

MIT

About

ChatGPT clone with Next.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages