Skip to content
ebenezerdonPublic

About

The open-source alternative to ChatGPT | Built with NextJS and Appwrite

Topics

Resources

Stars

21 stars

Watchers

0 watching

Forks

Repository files navigation

e7.chat

The open-source alternative to ChatGPT

Live url: https://e7.chat

A modern, full-featured AI chat application built with Next.js, featuring multi-provider AI model access, image generation, user authentication, chat sharing, branching conversations, file attachments, and cloud synchronization.

✨ Features

  • 🤖 Multi-AI Model Support - Access 100+ AI models via OpenRouter integration
  • 🔐 Multiple Authentication Methods - Email/password and OAuth (Google, GitHub)
  • 📱 Responsive Design - Works seamlessly on desktop and mobile
  • 💾 Cloud Sync - Chat history synchronized across devices
  • 🔗 Chat Sharing - Share conversations with public links
  • 🎨 AI Image Generation - Create images with AI models
  • 🌙 Dark Theme - Beautiful, modern dark interface
  • 📂 File Uploads - Support for images and PDFs
  • 🔍 Search Functionality - Find chats quickly
  • 🎯 Chat Management - Rename, delete, and organize conversations

🚀 Quick Start

Prerequisites

1. Clone the Repository

git clone https://github.com/ebenezerdon/e7.chat.git
cd e7.chat

2. Install Dependencies

npm install

3. Environment Setup

Create a .env.local file in the project root:

# OpenRouter API Configuration
OPENROUTER_API_KEY=your_openrouter_api_key_here

# Site Information (Optional)
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_SITE_NAME=e7.chat

# Appwrite Configuration
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT_ID=your_appwrite_project_id
APPWRITE_API_KEY=your_appwrite_server_api_key

# Database Configuration (Optional - will use defaults)
NEXT_PUBLIC_APPWRITE_DATABASE_ID=ai-chat-db
NEXT_PUBLIC_APPWRITE_CHATS_COLLECTION_ID=chats

# Optional: OpenAI API Key for image generation
OPENAI_API_KEY=your_openai_api_key_for_images

4. Start Development Server

npm run dev

Visit http://localhost:3000 to see your application running!

🔧 Setup Guides

OpenRouter Setup

  1. Get API Key

    • Visit OpenRouter
    • Sign up for a free account
    • Navigate to API Keys
    • Create a new API key
    • Copy the key (starts with sk-or-)
  2. Add to Environment

    OPENROUTER_API_KEY=sk-or-v1-your-key-here

Appwrite Setup

1. Create Project

  1. Go to Appwrite Console
  2. Create a new project
  3. Copy your Project ID

2. Configure Authentication

  1. Go to Auth → Settings
  2. Add your domain to Domains: http://localhost:3000, https://yourdomain.com
  3. Enable Email/Password authentication

3. Set Up OAuth (Optional)

For Google and GitHub sign-in, follow this OAuth Setup Guide.

4. Create Database

  1. Database: ai-chat-db
  2. Collections:
    • chats - Stores chat conversations
    • shared-chats - Stores shared chat links
    • user-chat-metadata - Optimized chat metadata
    • user-profiles - User preferences and API keys

5. Set Permissions

For each collection, set these permissions:

  • Create: users
  • Read: users
  • Update: users
  • Delete: users

6. Get Server API Key

  1. Go to Overview → Integrate with your server
  2. Create an API Key with these scopes:
    • databases.read
    • databases.write
  3. Copy the key to APPWRITE_API_KEY

🏗️ Tech Stack