Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
46993a2
Rewire chat route to use SourceField backend
kcisna45 Jul 4, 2025
a39d39e
Replace route.ts with clean SourceField backend code
kcisna45 Jul 4, 2025
412a51d
Delete app/api/chat/openai/route.ts
kcisna45 Jul 4, 2025
d971627
Restore chat/route.ts with sourcefield backend code
kcisna45 Jul 4, 2025
3e7c28e
add chat page
kcisna45 Jul 4, 2025
b489c6f
fix: use env vars for supabase client
kcisna45 Jul 5, 2025
31b3488
Create chat.tsx
kcisna45 Jul 5, 2025
48aec1b
trigger fresh deploy: clear cache
kcisna45 Jul 5, 2025
16a459f
Trigger
kcisna45 Jul 5, 2025
8946623
trigger fresh deploy: clear cache
kcisna45 Jul 5, 2025
3996f91
Fix/add chat component with proper chat UI
kcisna45 Jul 5, 2025
9e8969b
Fic chat page.tsx to properly load chat component
kcisna45 Jul 5, 2025
6f6c996
Fix chat page.tsx to properly load chat component
kcisna45 Jul 5, 2025
0e27289
Fix chat page.tsx to properly load chat component
kcisna45 Jul 5, 2025
e6d84f0
Fix: add SourceField Backend env variables
kcisna45 Jul 5, 2025
dc147e9
Rename chat.tsx to tempchat.tsx
kcisna45 Jul 5, 2025
dc34c5c
Delete incorrectly named chat.tsx
kcisna45 Jul 5, 2025
4863e44
Fix: Update home page to include chat component
kcisna45 Jul 5, 2025
6f27172
Feat: update /api/chat route to save messages to Supabase
kcisna45 Jul 5, 2025
9f4474e
fix: correct env variable names to match vercel and code
kcisna45 Jul 5, 2025
0b5e80c
fix: connect chat API route to OpenAI properly
kcisna45 Jul 5, 2025
03d6d20
fix: point frontend Chat.tsx to correct /api/chat endpoint
kcisna45 Jul 5, 2025
fbe3ff0
Create vercel.json for vercel configuration
kcisna45 Jul 5, 2025
ca02f60
debug: log OPENAI_API_KEY in route.ts
kcisna45 Jul 5, 2025
0a2aae2
fix: move auth callback route to api/auth/callback
kcisna45 Jul 6, 2025
fde37f0
chore: remove old auth callback route from app/auth/callback
kcisna45 Jul 6, 2025
e0b6392
fix(auth): persist Supabase session in browser local storage
kcisna45 Jul 7, 2025
8146be2
Fix(auth): set session from URL tokens after login redirect
kcisna45 Jul 7, 2025
ca3e68a
feat(auth): add OAuth login button and clean up login page
kcisna45 Jul 7, 2025
ffe0baf
Fix: create home workspace fallback on login
kcisna45 Jul 7, 2025
69c621e
fix: clean login page with fallback workspace creation and OAuth
kcisna45 Jul 7, 2025
a97e587
fix: add auth check and redirect to chat page
kcisna45 Jul 7, 2025
7311a91
feat: add console log to debug Supabase signIn result
kcisna45 Jul 7, 2025
bcae999
feat: add /api/session endpoint to inspect session cookies
kcisna45 Jul 7, 2025
bb5cb6b
Fix: /api/session endpoint to fetch Supabase session
kcisna45 Jul 7, 2025
fab29b4
Fix profile.ts to prevent JSON object error and add debug logging
kcisna45 Jul 9, 2025
c86e373
Fix: use maybeSingle to handle single profiles row gracefully
kcisna45 Jul 10, 2025
42748cc
Add missing db/profiles.ts with maybeSingle fix
kcisna45 Jul 10, 2025
9cc1d8a
merge branch "main' of https://github.com/kcisna45/chatbot-ui
kcisna45 Jul 10, 2025
dad0758
fix: use maybeSingle in assistants.ts to handle multiple/no rows
kcisna45 Jul 10, 2025
3bd03e6
Fix db/profile.ts with correct maybeSingle logic, remove db/profiles.ts
kcisna45 Jul 10, 2025
5bd8bb5
fix (profile): use maybeSingle() for safe single-row access in db/pro…
kcisna45 Jul 10, 2025
70a90fb
chore: remove unnused db - Copy folder
kcisna45 Jul 10, 2025
b91e77f
Merge branch 'main' of https://github.com/kcisna45/chatbot-ui
kcisna45 Jul 10, 2025
ae75be4
fix(assistants): use correct assistant_workspaces join in getAssistan…
kcisna45 Jul 11, 2025
36b94ca
fix(assistants): correct db/assistants.ts and db/profile.ts for prope…
kcisna45 Jul 11, 2025
4710d66
fix(assistants): correct joins to use assistant_workspaces and avoid …
kcisna45 Jul 17, 2025
d3cdc01
Fix(assistants): properly join assistant_workspaces to workspaces
kcisna45 Jul 17, 2025
41bcf08
Fix (layout): use correct assistant_workspaces property
kcisna45 Jul 22, 2025
df620a5
Fix (ui): resolve nested <button> hydration warning by adding asChild…
kcisna45 Jul 31, 2025
da8466a
refactor (ui): rewrite with-tooltip component using fowardRef for Rad…
kcisna45 Aug 1, 2025
dc57449
fix (ui): remove nested button elements in ChatSettings and related c…
kcisna45 Aug 1, 2025
b7543f5
fix: correct TooltipProvider import path in providers component to re…
kcisna45 Aug 1, 2025
7e0226c
fix: add TooltiProvider export and clean tooltip.tsx
kcisna45 Aug 1, 2025
4c002c4
refactor: clean up with-tooltip.tsx and forwardRef handling
kcisna45 Aug 1, 2025
36034fe
Fix: add TooltipProvider export and clean tooltip.tsx
kcisna45 Aug 1, 2025
6f7947e
refactor: clean up with-tooltip.tsx and forwardRef handling
kcisna45 Aug 1, 2025
6cea821
Fix: ensure tooltip exports are explicit
kcisna45 Aug 1, 2025
e4eee5f
fix (tooltip): remove duplicate exports and clean up Tooltip componen…
kcisna45 Aug 1, 2025
7c1ecad
fix (tooltip): reesolve duplicate export issue causing ModuuleParseError
kcisna45 Aug 1, 2025
4c95fc6
Fix: correct TooltipProvider import and clean Providers component
kcisna45 Aug 2, 2025
e026156
refactor(db): clean and streamline chats.ts
kcisna45 Aug 3, 2025
6f9fe42
refactor(db): clean and streamline messages.ts
kcisna45 Aug 3, 2025
2327220
Fix(db): update Supabase import path in chats.ts to match correct fil…
kcisna45 Aug 4, 2025
98bc5ef
fix(db): correct Supabase import path in messages.ts for proper modul…
kcisna45 Aug 4, 2025
6742d46
fix(lib/supabase): export supabase client instance
kcisna45 Aug 4, 2025
3f9273b
chore: add debug logs to check if SUPABASE env vars are loading
kcisna45 Aug 4, 2025
149204a
fix: explicitly log and validate Supabase enc vars in client.ts
kcisna45 Aug 4, 2025
5692b25
Fix: expose Supabase URL and key to frontend via NEXT_PUBLIC_ env vars
kcisna45 Aug 4, 2025
d244663
fix: add getChatsByWorkspaceId to db/chats.ts to resolve client error
kcisna45 Aug 4, 2025
be93817
chore: add console logs to useChatHandler for debugging message flow
kcisna45 Aug 5, 2025
f83aebe
Feat: add chat-store provider for selectedChatId state management
kcisna45 Aug 5, 2025
6c04c23
chore: remove invalid chat-store from public directory
kcisna45 Aug 5, 2025
7593c8e
feat: add useMessageHandler hook, new AI icons, and chat store; updat…
kcisna45 Aug 5, 2025
c98a60e
feat: add useChat hook
kcisna45 Aug 5, 2025
a1a9dcd
Add useMessages hook for messages state handling
kcisna45 Aug 5, 2025
010ab96
feat: add new chat session management with handleCreateChat and handl…
kcisna45 Aug 5, 2025
80f25c6
Fix missing handleCreateChat function by defining it inside Chat com…
kcisna45 Aug 5, 2025
b82eebc
Fix: chat button functionally now working
kcisna45 Aug 6, 2025
61ae58f
Fix: Added handleFocusChatInput to useChatHandler and expose to ChatI…
kcisna45 Aug 6, 2025
c7befa4
Feat: add internal handleCreateChat to useChatHandler and remove brok…
kcisna45 Aug 6, 2025
7dbcd11
fix: add missing setChats function to Zustand chat-store
kcisna45 Aug 6, 2025
d87122f
fix: add setChatMessages function to useMessageHandler hook
kcisna45 Aug 6, 2025
f2f2ada
fix: add 'setChatMessages' function to useMessageHandler hook
kcisna45 Aug 6, 2025
0ce705f
fix: clean up and correct useMessageHandler hook implementation
kcisna45 Aug 6, 2025
7228b08
fix: resolve syntax errors in useMessageHandler and properly export h…
kcisna45 Aug 6, 2025
07f3502
fix: resolve syntax errors in useMessageHandler and properly export h…
kcisna45 Aug 6, 2025
d59514b
Add message store using Zustang
kcisna45 Aug 6, 2025
bf4a283
Fix: corrected useChatHandler to use updated message handlers
kcisna45 Aug 6, 2025
90b0f83
Fix: Adjust useChatHandler and useMessages logic
kcisna45 Aug 6, 2025
b8a842f
feat: add backend API route for generating AI responses from OpenAI
kcisna45 Aug 6, 2025
47d4919
feat: connect chat handler to AI API endpoint for live responses
kcisna45 Aug 6, 2025
7bd0916
fix(chat): remove duplicate handleCreateChat definition to resolve bu…
kcisna45 Aug 6, 2025
809c52c
Refactor chat.tsx to remove duplicate handleCreateChat function and f…
kcisna45 Aug 6, 2025
cab9598
Add Modules 1-3: Supabase Client, Resonance Engine, Memory core
kcisna45 Aug 8, 2025
ea02f1d
Integrated Living Equations Engine, Resonance Pattern Trackerr, and c…
kcisna45 Aug 8, 2025
13edc7b
Update middleware for static asset access and i18n routing; sync all …
kcisna45 Aug 9, 2025
8c4eff1
Move loading.tsx into /app/[locale]/loading.tsx to fix module resolution
kcisna45 Aug 10, 2025
bc1f9e5
fix: move loading.tsx into workspaceid folder to resolve import path
kcisna45 Aug 10, 2025
35f7bd1
Add missing local folder and loading.tsx file
kcisna45 Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
triggering fresh deploy
3 changes: 2 additions & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ EMAIL_DOMAIN_WHITELIST=
EMAIL_WHITELIST=

# File size limit for uploads in bytes
NEXT_PUBLIC_USER_FILE_SIZE_LIMIT=10485760
NEXT_PUBLIC_USER_FILE_SIZE_LIMIT=10485760

3 changes: 3 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs post-checkout "$@"
3 changes: 3 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs post-commit "$@"
3 changes: 3 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs post-merge "$@"
3 changes: 3 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs pre-push "$@"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The open-source AI chat app for everyone.

<img src="./public/readme/screenshot.png" alt="Chatbot UI" width="600">

## Demo
## demo

View the latest demo [here](https://x.com/mckaywrigley/status/1738273242283151777?s=20).

Expand Down Expand Up @@ -290,3 +290,5 @@ We are working on a guide for contributing.
## Contact

Message Mckay on [Twitter/X](https://twitter.com/mckaywrigley)

## Updated
Empty file added RunPython SF.py
Empty file.
28 changes: 0 additions & 28 deletions app/[locale]/page.tsx

This file was deleted.

13 changes: 12 additions & 1 deletion app/auth/callback/route.ts → app/api/auth/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ export async function GET(request: Request) {
if (code) {
const cookieStore = cookies()
const supabase = createClient(cookieStore)
await supabase.auth.exchangeCodeForSession(code)
const { data, error } = await supabase.auth.exchangeCodeForSession(code)

if (error) {
console.error("Error exchanging code:", error)
}

if (data?.session) {
// Redirect back to home page with tokens in query params
return NextResponse.redirect(
`${requestUrl.origin}/?access_token=${data.session.access_token}&refresh_token=${data.session.refresh_token}`
)
}
}

if (next) {
Expand Down
1 change: 0 additions & 1 deletion app/api/chat/google/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export async function POST(request: Request) {
return new Response(readableStream, {
headers: { "Content-Type": "text/plain" }
})

} catch (error: any) {
let errorMessage = error.message || "An unexpected error occurred"
const errorCode = error.status || 500
Expand Down
58 changes: 0 additions & 58 deletions app/api/chat/openai/route.ts

This file was deleted.

29 changes: 29 additions & 0 deletions app/api/chat/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { NextResponse } from "next/server"

export async function POST(req: Request) {
console.log("OPENAI_API_KEY:", process.env.OPENAI_API_KEY)

const body = await req.json()
const { messages } = body

const response = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.OPENAI_API_KEY}`
},
body: JSON.stringify({
model: "gpt-3.5-turbo", // or gpt-4 if your key supports it
messages,
temperature: 0.7
})
})

if (!response.ok) {
const errorText = await response.text()
return NextResponse.json({ error: errorText }, { status: response.status })
}

const data = await response.json()
return NextResponse.json({ result: data.choices[0].message.content })
}
35 changes: 35 additions & 0 deletions app/api/session/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { cookies } from "next/headers"
import { NextResponse } from "next/server"
import { createServerClient } from "@supabase/ssr"
import { Database } from "@/supabase/types"

export async function GET() {
const cookieStore = cookies()

const supabase = createServerClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
get(name) {
return cookieStore.get(name)?.value
}
}
}
)

const {
data: { session },
error
} = await supabase.auth.getSession()

if (error) {
console.error("Error getting session:", error)
return NextResponse.json(
{ session: null, error: error.message },
{ status: 500 }
)
}

return NextResponse.json({ session })
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export default function WorkspaceLayout({ children }: WorkspaceLayoutProps) {
setSelectedWorkspace(workspace)

const assistantData = await getAssistantWorkspacesByWorkspaceId(workspaceId)
setAssistants(assistantData.assistants)
setAssistants(assistantData.assistant_workspaces)

for (const assistant of assistantData.assistants) {
for (const assistant of assistantData.assistant_workspaces) {
let url = ""

if (assistant.image_path) {
Expand Down
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions app/en/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Chat from "@/components/Chat"
import { cookies } from "next/headers"
import { createServerClient } from "@supabase/ssr"
import { Database } from "@/supabase/types"
import { redirect } from "next/navigation"

export default async function ChatPage() {
const cookieStore = cookies()

const supabase = createServerClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
get(name: string) {
return cookieStore.get(name)?.value
}
}
}
)

const {
data: { session }
} = await supabase.auth.getSession()

if (!session) {
// Not logged in — redirect to login page
return redirect("/login")
}

return (
<main className="flex h-screen flex-col">
<header className="bg-white p-4 shadow">
<h1 className="text-xl font-semibold">SourceField Chat</h1>
</header>
<div className="flex-1 overflow-hidden">
<Chat />
</div>
</main>
)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading