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.
- π€ 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
- Node.js 18+ installed
- An Appwrite account (free)
- An OpenRouter
- An OpenAI api key for image generation
git clone https://github.com/ebenezerdon/e7.chat.git
cd e7.chat
npm install
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
npm run dev
Visit http://localhost:3000 to see your application running!
-
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-
)
-
Add to Environment
OPENROUTER_API_KEY=sk-or-v1-your-key-here
- Go to Appwrite Console
- Create a new project
- Copy your Project ID
- Go to Auth β Settings
- Add your domain to Domains:
http://localhost:3000
,https://yourdomain.com
- Enable Email/Password authentication
For Google and GitHub sign-in, follow this OAuth Setup Guide.
- Database:
ai-chat-db
- Collections:
chats
- Stores chat conversationsshared-chats
- Stores shared chat linksuser-chat-metadata
- Optimized chat metadatauser-profiles
- User preferences and API keys
For each collection, set these permissions:
- Create:
users
- Read:
users
- Update:
users
- Delete:
users
- Go to Overview β Integrate with your server
- Create an API Key with these scopes:
databases.read
databases.write
- Copy the key to
APPWRITE_API_KEY
- Framework: Next.js 15 with App Router
- Styling: Tailwind CSS 4
- Authentication: Appwrite
- Database: Appwrite Database
- AI Models: OpenRouter (100+ models)
- Image Generation: OpenAI DALL-E
- Icons: Lucide React
- Markdown: React Markdown
- Code Highlighting: React Syntax Highlighter
e7.chat/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API Routes
β β β βββ chat/ # Chat completions
β β β βββ generate-image/ # AI image generation
β β β βββ generate-title/ # Auto-generate chat titles
β β β βββ user/ # User management
β β βββ auth/ # Authentication pages
β β βββ share/ # Shared chat pages
β βββ components/ # React Components
β β βββ AuthModal.jsx # Authentication modal
β β βββ ChatThread.jsx # Chat message display
β β βββ Sidebar.jsx # Chat history sidebar
β β βββ ... # Other components
β βββ lib/ # Utility libraries
β β βββ appwrite.js # Appwrite client config
β β βββ auth.js # Authentication logic
β β βββ db.js # Database operations
β βββ styles/ # CSS styles
βββ public/ # Static assets
βββ .env.local # Environment variables
βββ package.json # Dependencies
Through OpenRouter, you have access to:
- OpenAI: GPT-4o, GPT-4o-mini, o1, o1-mini, o3-mini
- Anthropic: Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus
- Google: Gemini 2.0 Flash, Gemini 1.5 Pro, Gemini 1.5 Flash
- Meta: Llama 3.1 405B, Llama 3.1 70B, Llama 3.1 8B
- DeepSeek: DeepSeek V3, DeepSeek R1
- Qwen: Qwen 2.5 series
- Mistral: Mistral 7B, 8x7B, 8x22B
- Cohere: Command R+
- And 90+ more models
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes
- Run linting:
npm run lint
- Commit:
git commit -m "Add feature"
- Push:
git push origin feature-name
- Create a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- OpenRouter: OpenRouter Documentation
- Appwrite: Appwrite Documentation
- Appwrite for backend services
- OpenRouter for unified AI model access
- Next.js
- Tailwind CSS
- Lucide for icons
Built by Ebenezer Don