Z3C is a modern AI chat application that provides a unified interface for multiple AI models. Built with Next.js and TypeScript, it offers a seamless chat experience with various AI providers while maintaining user privacy and providing advanced features.
- Multi-Model Support: Integrate with multiple AI providers (OpenAI, Anthropic, Groq, Replicate, OpenRouter, and more)
- Real-time Chat: Interactive chat interface with real-time message streaming
- User Authentication: Secure user registration and login system
- Conversation Management: Create, edit, share, and fork conversations
- Message History: Persistent chat history with full conversation tracking
- File Attachments: Upload and share files in conversations
- Model Switching: Switch between different AI models mid-conversation
- Z3Cs Library: Create and manage reusable AI components
- API Key Management: Bring your own API keys for different AI providers
- Usage Tracking: Monitor your API usage and costs
- Internationalization: Multi-language support (English, Turkish)
- Theme Support: Light, dark, and pixel themes
- Conversation Sharing: Share conversations publicly with voting system
- Prompt Enhancement: AI-powered prompt optimization
- Rate Limiting: Built-in rate limiting for API protection
- Framework: Next.js 15 (with App Router)
- UI Framework: React 19
- Styling: Tailwind CSS 4
- State Management: Zustand
- Data Fetching: SWR
- Animation: Framer Motion
- Icons: Radix UI, Remix Icons, HugeIcons
- Runtime: Edge & Node.js
- Database: MongoDB with Mongoose
- Authentication: Better Auth
- AI Integration: Vercel AI SDK
- File Storage: Vercel Blob
- Caching: Upstash Redis & KV
- Rate Limiting: Upstash Rate Limit
- OpenAI (GPT models)
- Anthropic (Claude models)
- Google (Gemini models)
- Groq (Fast inference)
- Replicate (Image generation)
- OpenRouter (Multi-provider access)
- DeepSeek, Mistral, xAI, and more
Before you begin, ensure you have the following installed:
- Node.js 18+ or Bun
- MongoDB database
- Git
-
Clone the repository
git clone https://github.com/z3cdotdev/chat.git cd z3c -
Install dependencies
# Using bun (recommended) bun install # Or using npm npm install
-
Environment Configuration
Create a
.env.localfile in the root directory and add the following variables:# Authentication BETTER_AUTH_SECRET=your_better_auth_secret_key BETTER_AUTH_URL=http://localhost:3000 # API Configuration NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1 # Database DATABASE_URL=your_mongodb_connection_string # Vercel Blob Storage BLOB_READ_WRITE_TOKEN=your_vercel_blob_token MASK_VERCEL_BLOB_STORAGE_URL=0 VERCEL_BLOB_STORAGE_URL=your_vercel_blob_storage_url # AI Provider API Keys Z3_OPENROUTER_API_KEY=your_openrouter_api_key Z3_EXASEARCH_API_KEY=your_exa_search_api_key Z3_REPLICATE_API_KEY=your_replicate_api_key # Upstash KV & Redis KV_URL=your_upstash_kv_url KV_REST_API_URL=your_upstash_rest_api_url KV_REST_API_TOKEN=your_upstash_rest_api_token KV_REST_API_READ_ONLY_TOKEN=your_upstash_readonly_token REDIS_URL=your_redis_connection_url
-
Database Setup
Import the AI models configuration to your MongoDB:
# Make sure your MongoDB is running and accessible # Import the z3-chat.agentmodels.json to your 'agentmodels' collection mongoimport --db your_database_name --collection agentmodels --file z3-chat.agentmodels.json
-
Seed the database (optional)
bun run seed
-
Start the development server
bun run dev
The application will be available at
http://localhost:3000
z3-chat/
βββ src/
β βββ app/ # Next.js App Router pages
β β βββ (pages)/ # Page routes
β β βββ api/ # API routes
β β βββ globals.css # Global styles
β βββ components/ # Reusable React components
β β βββ chat-ui/ # Chat interface components
β β βββ forms/ # Form components
β β βββ layout/ # Layout components
β β βββ ui/ # UI components
β βββ contexts/ # React contexts
β βββ database/ # Database models and connection
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
β βββ stores/ # Zustand stores
β βββ middleware/ # Next.js middleware
βββ public/ # Static assets
βββ z3-chat.agentmodels.json # AI models configuration
βββ z3c.config.json # Application configuration
The application uses a MongoDB collection to store AI model configurations. Each model entry includes:
- Model ID and name
- Provider information
- Capabilities (text, image, code)
- Pricing information
- Rate limits
Users can add their own API keys for different providers through the settings panel, allowing them to:
- Use their own quotas
- Access premium models
- Avoid rate limits
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy
# Build the Docker image
docker build -t z3-chat .
# Run the container
docker run -p 3000:3000 --env-file .env.local z3-chatThe application provides RESTful APIs for:
GET /api/v1/conversations- Get user conversationsPOST /api/v1/create-conversation- Create new conversationGET /api/v1/conversation/[id]- Get conversation detailsDELETE /api/v1/conversation/[id]/delete- Delete conversation
GET /api/v1/models- Get available AI modelsGET /api/v1/models/all- Get all models with details
GET /api/v1/user/details- Get user profilePOST /api/v1/user/api-keys- Manage user API keys
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use Tailwind CSS for styling
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License. See the LICENSE file for details.
- Live Demo: https://chat.z3c.dev
- Documentation: Coming soon
- GitHub: Repository Link
- Issues: Report Issues
For support and questions:
- Create an issue on GitHub
- Join our Discord community
- Email: [email protected]
- Vercel AI SDK for AI integration
- Next.js for the amazing framework
- Tailwind CSS for styling
- All the AI providers for their APIs
- The open-source community for amazing packages
Z3C - Bringing multiple AI models together in one beautiful interface.