A full-featured, open-source AI chat application inspired by t3.chat, built with modern technologies and packed with advanced features.
- 🤖 Chat with multiple AI models via OpenRouter
- 🔐 Authentication using Supabase (Google sign-in supported)
- 💬 Persistent chat history with syncing
- 🌱 Branching chat conversations
- 🧠 Personalized memory for user context
- 🔑 BYOK (Bring Your Own API Key) support
- Frontend: Vite + React + TailwindCSS
- Backend: Express.js + Prisma
- Database: Supabase(Auth) + Neon.tech
- Hosting: Netlify (Frontend) + AWS (API)
👉 Try it here: oaichat.netlify.app
git clone https://github.com/OM3X4/oAI.git
cd oAI-
Create a new project on Supabase
-
Enable Google Authentication under Authentication > Providers
-
Retrieve the following values:
SUPABASE_URLandSUPABASE_ANON_KEY: Found in Project Settings → APIJWT_SECRET: Found in Project Settings → API → JWT Settings
Navigate to the backend directory and create a .env file:
# .env (Backend)
DATABASE_URL=your_postgres_ipv4_connection_string
JWT_SECRET=your_supabase_jwt_secret
KEY_HASH_SECRET=your_32_byte_base64_encoded_keyGenerate a valid 32-byte Base64 key using Node.js:
console.log(require('crypto').randomBytes(32).toString('base64'));Install dependencies and initialize Prisma:
cd backend
npm install
npx prisma generate
npx prisma migrate dev --name init
npm run devNavigate to the client directory and create a .env file:
# .env (Client)
VITE_API_URL=http://localhost:PORT # Replace with your backend port
VITE_SUPABASE_PROJECT_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_hereThen start the development server:
cd client
npm install
npm run devIn backend/index.js, ensure CORS is correctly configured to allow the frontend origin:
const corsOptions = {
origin: ["http://localhost:4000", "https://oaichat.netlify.app"],
credentials: true
};Happy building! 🚀