This commit is contained in:
Thomas G. Lopes 2025-06-18 18:59:54 +01:00
parent 8424b19b13
commit df66ccbb2a
4 changed files with 41 additions and 8 deletions

10
.env.example Normal file
View file

@ -0,0 +1,10 @@
# Deployment used by `npx convex dev`
CONVEX_DEPLOYMENT=
PUBLIC_CONVEX_URL=
CONVEX_SITE_URL="http://localhost:5173"
BETTER_AUTH_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

View file

@ -4,8 +4,15 @@ Clone of [T3 Chat](https://t3.chat/)
## 🚀 Features
- Fast chat goes brrrr
- Self-hostable
- Cached query for fast chat loading
- Openrouter provider for access to 400+ models
- File uploads
- Web search
- Full-text search over your chat history
- Cursor-like rules
- Privacy mode for streams and screen-sharing
- Markdown rendered messages with syntax highlighting
- Chat sharing
## 🛠️ Tech Stack
@ -20,10 +27,13 @@ Clone of [T3 Chat](https://t3.chat/)
- **Linting**: ESLint
- **Formatting**: Prettier
## 📦 Self-hosting
## 📦 Running locally
TODO: test self-hosting, including Convex self-hosting perhaps
TODO: add instructions
1. Clone the repo
2. Install dependencies with `pnpm install`
3. Copy `.env.example` to `.env` and fill in the values
4. Run `pnpm dev`
5. Open [http://localhost:5173](http://localhost:5173)
## TODO
@ -48,7 +58,7 @@ TODO: add instructions
### Chat
- [x] loading state
- [ ] deal with error states, both on creation attempt and message generation failure
- [x] deal with error states, both on creation attempt and message generation failure
- [x] delete conversations option
- [x] conversation title generation
- [x] kbd powered popover model picker
@ -66,3 +76,4 @@ TODO: add instructions
- [ ] 404 page/redirect
- ~[ ] Test link with free credits~
- [x] Cursor-like Rules (@ieedan's idea!)
- [x] Full-text search

View file

@ -10,6 +10,10 @@ export const auth = betterAuth({
secret: process.env.BETTER_AUTH_SECRET!,
database: convexAdapter(client),
socialProviders: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
},
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!,

View file

@ -2,15 +2,23 @@
import { Button } from '$lib/components/ui/button';
import * as Icons from '$lib/components/icons';
import { authClient } from '$lib/backend/auth/client.js';
import DeviconGoogle from '~icons/devicon/google';
async function signIn() {
async function signInGitHub() {
await authClient.signIn.social({ provider: 'github', callbackURL: '/chat' });
}
async function signInGoogle() {
await authClient.signIn.social({ provider: 'google', callbackURL: '/chat' });
}
</script>
<div class="flex h-svh flex-col place-items-center justify-center gap-4">
<h1 class="text-2xl font-bold">Sign in to thom.chat</h1>
<Button variant="outline" onClickPromise={signIn}>
<Button variant="outline" onClickPromise={signInGitHub}>
<Icons.GitHub /> Continue with GitHub
</Button>
<Button variant="outline" onClickPromise={signInGoogle}>
<DeviconGoogle /> Continue with Google
</Button>
</div>