Open Source, Self-Hosted Chat GPT APP with Nextjs

Open Source, Self-Hosted Chat GPT APP

Stack

  • Prisma,
  • tRPC
  • NextJS
  • TypeScript
  • Sqlite
  • Mantine (React comoponent library)

How to run

First create a .env file

If you want a multi-user setup follow .env.multi-user.example.

If you don’t want to support multiple users, follow: .env.single-user.example.

Docker Hub (Simplest)

  1. docker pull docker.io/bitswired/ai-chat-app
  2. docker run -p 3000:3000 docker.io/bitswired/ai-chat-app

In order to persist data, you can use a volume to store the Sqlite database like this:

docker run -p 3000:3000 -v sqldata:/app/prisma/data ai-chat-app docker.io/bitswired/ai-chat-app

Docker Local

  1. Clone the repository
  2. docker build -t ai-chat-app .
  3. docker run -p 3000:3000 ai-chat-app

In order to persist data, you can use a volume to store the Sqlite database like this:

docker run -p 3000:3000 -v sqldata:/app/prisma/data ai-chat-app

Local

  1. Clone the repository
  2. Create a .env file containing 2 entries:
DATABASE_URL="file:./db.sqlite"
  1. Run yarn
  2. Run yarn prisma migrate deploy
  3. Run yarn build
  4. Run yarn start
  5. Visit localhost:3000/settings
  6. Add your OpenAI API Key
  7. Enjoy your self-hosted ChatGPT

Roadmap 🚀

Contribution welcomed!

  1. Dockerize the app
  2. Add ChatGPT prompt templates to speed up reusable worflows
  3. Integrate vocal chat with the Whisper API
  4. Make it more mobile friendly
  5. Overall imporovement of the design

GitHub

View Github