A simple chat application powered by Mistral AI that allows users to interact with different Mistral language models.
- 🔄 Easy switching between Mistral AI models
- 🔐 Simple authentication via Google OAuth
- 💾 Chat history persistence
- 🚀 Blazing fast speed
- 🔍 Real time token counting
- 🔒 Whitelisting for private use
- Next.js - React framework for building the UI
- Tanstack Query - Client-side data fetching and caching
- Tailwind CSS - Utility-first CSS framework
- Zustand - State management
- Shadcn UI - Component library
- Next.js Route Handlers & Server Functions - Serverless API endpoints
- Better Auth - Authentication and session management
- Neon - Serverless Postgres database
- Drizzle ORM - Type-safe SQL toolkit
- Mistral AI API - Access to various Mistral language models
- Vercel - Project is designed to be hosted on Vercel (could work with other hosting platforms but would require some tweaks)
To run this project, you'll need to set up the following environment variables. A template file .env.example
is provided in the repository.
-
Copy the
.env.example
file to a new file named.env
:cp .env.example .env
-
Fill in your own values in the
.env
file or/and your hosting platform's environment variables:MISTRAL_API_KEY
: Your Mistral AI API keyGOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
: For Google OAuth authenticationDATABASE_URL
: Your Neon database connection stringBETTER_AUTH_SECRET
: A secret key for authenticationBETTER_AUTH_URL
: The URL of the BetterAuth serverWHITELISTED_EMAILS
: Comma-separated list of whitelisted email addresses
-
In Vercel, ensure to extend the maximum duration of your functions to ensure long conversations can be streamed
- Ensure navbar is correctly updated on conversation creation
- Add infinite scroll to conversations sidebar (using useInfiniteQuery?)
- Clicking on a model should close the dropdown
- Add a message for non-whitelisted users when they get redirected to login page
- Use the serverless neon database driver to stream chat message