g auth
This commit is contained in:
parent
8424b19b13
commit
df66ccbb2a
4 changed files with 41 additions and 8 deletions
10
.env.example
Normal file
10
.env.example
Normal 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=
|
||||||
23
README.md
23
README.md
|
|
@ -4,8 +4,15 @@ Clone of [T3 Chat](https://t3.chat/)
|
||||||
|
|
||||||
## 🚀 Features
|
## 🚀 Features
|
||||||
|
|
||||||
- Fast chat goes brrrr
|
- Cached query for fast chat loading
|
||||||
- Self-hostable
|
- 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
|
## 🛠️ Tech Stack
|
||||||
|
|
||||||
|
|
@ -20,10 +27,13 @@ Clone of [T3 Chat](https://t3.chat/)
|
||||||
- **Linting**: ESLint
|
- **Linting**: ESLint
|
||||||
- **Formatting**: Prettier
|
- **Formatting**: Prettier
|
||||||
|
|
||||||
## 📦 Self-hosting
|
## 📦 Running locally
|
||||||
|
|
||||||
TODO: test self-hosting, including Convex self-hosting perhaps
|
1. Clone the repo
|
||||||
TODO: add instructions
|
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
|
## TODO
|
||||||
|
|
||||||
|
|
@ -48,7 +58,7 @@ TODO: add instructions
|
||||||
### Chat
|
### Chat
|
||||||
|
|
||||||
- [x] loading state
|
- [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] delete conversations option
|
||||||
- [x] conversation title generation
|
- [x] conversation title generation
|
||||||
- [x] kbd powered popover model picker
|
- [x] kbd powered popover model picker
|
||||||
|
|
@ -66,3 +76,4 @@ TODO: add instructions
|
||||||
- [ ] 404 page/redirect
|
- [ ] 404 page/redirect
|
||||||
- ~[ ] Test link with free credits~
|
- ~[ ] Test link with free credits~
|
||||||
- [x] Cursor-like Rules (@ieedan's idea!)
|
- [x] Cursor-like Rules (@ieedan's idea!)
|
||||||
|
- [x] Full-text search
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ export const auth = betterAuth({
|
||||||
secret: process.env.BETTER_AUTH_SECRET!,
|
secret: process.env.BETTER_AUTH_SECRET!,
|
||||||
database: convexAdapter(client),
|
database: convexAdapter(client),
|
||||||
socialProviders: {
|
socialProviders: {
|
||||||
|
google: {
|
||||||
|
clientId: process.env.GOOGLE_CLIENT_ID!,
|
||||||
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
||||||
|
},
|
||||||
github: {
|
github: {
|
||||||
clientId: process.env.GITHUB_CLIENT_ID!,
|
clientId: process.env.GITHUB_CLIENT_ID!,
|
||||||
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
|
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,23 @@
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import * as Icons from '$lib/components/icons';
|
import * as Icons from '$lib/components/icons';
|
||||||
import { authClient } from '$lib/backend/auth/client.js';
|
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' });
|
await authClient.signIn.social({ provider: 'github', callbackURL: '/chat' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function signInGoogle() {
|
||||||
|
await authClient.signIn.social({ provider: 'google', callbackURL: '/chat' });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex h-svh flex-col place-items-center justify-center gap-4">
|
<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>
|
<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
|
<Icons.GitHub /> Continue with GitHub
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button variant="outline" onClickPromise={signInGoogle}>
|
||||||
|
<DeviconGoogle /> Continue with Google
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue