An Open-Source Version of t3.chat.
T3 Chat is a fast and sleek AI chat application.
it's "best AI chat app ever made" ~ Theo
It supports different LLM, respond very fast, user friendly, have customization, cheap.
- ✅ Open-Source – No hidden agendas, fully transparent.
- 🚀 Developer-Friendly – Built with extensibility and integrations in mind.
T3 is built with modern and reliable technologies:
- Frontend: Next.js, TypeScript, TailwindCSS, Shadcn UI
- Backend: tRPC, Prisma ORM
- Database: PostgreSQL
- Authentication: Google OAuth
- Overall: We're using t3 stack 💙
Required Versions:
- Node.js >= 18.0.0
- pnpm >= 8.0.0
- Docker >= 20.10.0
Before running the application, you'll need to set up several services and environment variables:
For more in-depth information on environment variables, please refer to the Environment Variables section.
-
Setup Local
-
Open codebase as a container in VSCode or your favorite VSCode fork.
-
Run the following commands in order to populate your dependencies and setup docker
bun install -
Run the following commands if you are unable to start any of the services
rm -rf node_modules
-
Next Auth Setup
-
Open the
.envfile and change the AUTH_SECRET to string given below.AUTH_SECRET= 'authjs.session-token'
-
-
Google OAuth Setup
-
Go to Google Cloud Console
-
Create a new project
-
Create OAuth 2.0 credentials (Web application type)
-
Add authorized redirect URIs:
- Development:
http://localhost:3000http://localhost:3000/api/auth/google/callback
- Production:
https://your-production-urlhttps://your-production-url/api/auth/google/callback
- Development:
-
Add to
.env:GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret
-
Copy .env.example located in .env in the configure the following variables:
# Auth
AUTH_TRUST_HOST=
AUTH_SECRET= # Required: Secret key for authentication
# Google OAuth ( Required )
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Turnstile ( Required )
NEXT_PUBLIC_TURNSTILE_SITE_KEY=
TURNSTILE_SITE_KEY=
TURNSTILE_SITE_SECRET=
# Stripe ( Required )
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# Upstash ( Required )
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN =
# Mail ( Optional )
MAIL_APP_USER =
MAIL_APP_PASSWORD =
# TypeGPT ( Required )
NEXT_PUBLIC_TYPEGPT_API_KEY=
TYPEGPT_API_KEY=
TYPEGPT_API_URL=
# Discord webhook ( Optinal )
WEBHOOK_URL
# Database ( Required )
DATABASE_URL= Migration the database by running bunx prisma migrate dev and generate prisma client bunx prisma generate.
Run the development server:
bun devOpen http://localhost:3000 with your browser to see the result.
Contributions are welcome ❤️.