Skip to content

Commit 12446fd

Browse files
nextjs.yml fixed
1 parent 3b3e8bd commit 12446fd

20 files changed

+159
-125
lines changed

.github/workflows/nextjs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ jobs:
6060
with:
6161
path: |
6262
.next/cache
63-
# Generate a new cache whenever packages or source files change.
6463
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
65-
# If source files changed but packages didn't, rebuild from a prior cache.
6664
restore-keys: |
6765
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
6866
- name: Install dependencies
6967
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7068
- name: Build with Next.js
71-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
69+
run: ${{ steps.detect-package-manager.outputs.runner }} next build && ${{ steps.detect-package-manager.outputs.runner }} next export
70+
- name: Remove API routes from out directory
71+
run: rm -rf ./out/api || true
7272
- name: Upload artifact
7373
uses: actions/upload-pages-artifact@v3
7474
with:

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Improve the user experience:
8484

8585
1. **Fork and clone the repository**
8686
```bash
87-
git clone https://github.com/yourusername/codinit.git
87+
git clone https://github./Gerome-Elassaad/codinit.git
8888
cd codinit
8989
```
9090

@@ -538,8 +538,8 @@ We believe in recognizing our contributors:
538538

539539
### Where to Get Help
540540

541-
- **🐛 Bugs**: [GitHub Issues](https://github.com/yourusername/codinit/issues)
542-
- **💬 Discussions**: [GitHub Discussions](https://github.com/yourusername/codinit/discussions)
541+
- **🐛 Bugs**: [GitHub Issues](https://github./Gerome-Elassaad/codinit/codinit/issues)
542+
- **💬 Discussions**: [GitHub Discussions](https://github./Gerome-Elassaad/codinit/codinit/discussions)
543543
- **📧 Email**: [[email protected]](mailto:[email protected])
544544
- **💭 Discord**: [Join our community](https://discord.gg/codinit)
545545
- **📖 Documentation**: [docs.codinit.dev](https://docs.codinit.dev)

app/api/debug/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { RequestTracker } from "@/lib/debug"
22

3+
export const dynamic = 'force-dynamic';
4+
35
export async function GET() {
46
const tracker = RequestTracker.getInstance()
57
const stats = tracker.getStats()
6-
const recentRequests = tracker.getAllRequests().slice(0, 20) // Last 20 requests
8+
const recentRequests = tracker.getAllRequests().slice(0, 20)
79

810
return Response.json({
911
stats,

app/favicon.ico

15 KB
Binary file not shown.

app/layout.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ import { Inter } from 'next/font/google'
88
const inter = Inter({ subsets: ['latin'] })
99

1010
export const metadata: Metadata = {
11-
title: 'Your AI Application',
12-
description: 'A Next.js AI application template.',
11+
title: 'CodinIT - #1 Open Source AI App Builder',
12+
description: 'Open-source alternative to lovable.dev, bolt.new & v0.dev. AI software engineer — live code execution, file uploads, & real-time chat blazing-fast.',
13+
icons: [
14+
{ rel: "apple-touch-icon", sizes: "180x180", url: "/apple-touch-icon.png" },
15+
{ rel: "icon", type: "image/png", sizes: "32x32", url: "/icons/favicon-32x32.png" },
16+
{ rel: "icon", type: "image/png", sizes: "16x16", url: "/icons/favicon-16x16.png" },
17+
{ rel: "icon", type: "image/png", sizes: "192x192", url: "/android-chrome-192x192.png" },
18+
{ rel: "icon", type: "image/png", sizes: "512x512", url: "/android-chrome-512x512.png" }
19+
],
20+
manifest: "/site.webmanifest"
1321
}
1422

1523
export default function RootLayout({

app/page.tsx

Lines changed: 68 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { experimental_useObject as useObject } from "ai/react"
2121
import { usePostHog } from "posthog-js/react"
2222
import { type SetStateAction, useCallback, useEffect, useState } from "react"
2323
import { useLocalStorage } from "usehooks-ts"
24-
import { SidebarProvider, Sidebar } from "@/components/ui/sidebar"
2524

2625
export default function Home() {
2726
const [chatInput, setChatInput] = useLocalStorage("chat", "")
@@ -548,85 +547,80 @@ export default function Home() {
548547

549548
return (
550549
<div className="flex h-screen max-h-screen">
551-
{/* Sidebar and main content area */}
552-
<SidebarProvider>
553-
<Sidebar>
554-
{/* Sidebar content */}
555-
</Sidebar>
550+
{/* Main content area - removed sidebar */}
556551
<div className="flex flex-1 min-h-0">
557552
{/* Main chat area */}
558553
<div className={`flex-1 grid w-full min-h-0 ${fragment ? "md:grid-cols-2" : "md:grid-cols-1"}`}>
559-
{/* AuthDialog */}
560-
{supabase && (
561-
<AuthDialog open={isAuthDialogOpen} setOpen={setAuthDialog} view={authView} supabase={supabase} />
562-
)}
563-
564-
{/* Chat Area */}
565-
<div className="flex flex-col w-full max-w-4xl max-h-full mx-auto px-4 overflow-y-auto">
566-
<NavBar
567-
session={session}
568-
showLogin={() => setAuthDialog(true)}
569-
signOut={logout}
570-
onSocialClick={handleSocialClick}
571-
onClear={handleClearChat}
572-
canClear={messages.length > 0}
573-
canUndo={messages.length > 1 && !isSubmitting}
574-
onUndo={handleUndo}
575-
authError={authError}
576-
onRetryAuth={handleRetryAuth}
577-
/>
578-
<Chat messages={messages} isLoading={isSubmitting} setCurrentPreview={setCurrentPreview} />
579-
<div className="mt-auto">
580-
<VercelV0Chat
581-
input={chatInput}
582-
handleInputChange={handleSaveInputChange}
583-
handleSubmit={handleSubmitAuth}
584-
isLoading={isSubmitting}
585-
isErrored={error !== undefined}
586-
errorMessage={errorMessage}
587-
isRateLimited={isRateLimited}
588-
retry={retry}
589-
stop={stop}
590-
isMultiModal={currentModel?.multiModal || false}
591-
files={files}
592-
handleFileChange={handleFileChange}
593-
// ChatPicker props
594-
templates={templates}
595-
selectedTemplate={selectedTemplate}
596-
onSelectedTemplateChange={setSelectedTemplate}
597-
models={filteredModels}
598-
languageModel={languageModel}
599-
onLanguageModelChange={handleLanguageModelChange}
600-
// ChatSettings props
601-
apiKeyConfigurable={!process.env.NEXT_PUBLIC_NO_API_KEY_INPUT}
602-
baseURLConfigurable={!process.env.NEXT_PUBLIC_NO_BASE_URL_INPUT}
603-
/>
554+
{/* AuthDialog */}
555+
{supabase && (
556+
<AuthDialog open={isAuthDialogOpen} setOpen={setAuthDialog} view={authView} supabase={supabase} />
557+
)}
558+
559+
{/* Chat Area */}
560+
<div className="flex flex-col w-full max-w-4xl max-h-full mx-auto px-4 overflow-y-auto">
561+
<NavBar
562+
session={session}
563+
showLogin={() => setAuthDialog(true)}
564+
signOut={logout}
565+
onSocialClick={handleSocialClick}
566+
onClear={handleClearChat}
567+
canClear={messages.length > 0}
568+
canUndo={messages.length > 1 && !isSubmitting}
569+
onUndo={handleUndo}
570+
authError={authError}
571+
onRetryAuth={handleRetryAuth}
572+
/>
573+
<Chat messages={messages} isLoading={isSubmitting} setCurrentPreview={setCurrentPreview} />
574+
<div className="mt-auto">
575+
<VercelV0Chat
576+
input={chatInput}
577+
handleInputChange={handleSaveInputChange}
578+
handleSubmit={handleSubmitAuth}
579+
isLoading={isSubmitting}
580+
isErrored={error !== undefined}
581+
errorMessage={errorMessage}
582+
isRateLimited={isRateLimited}
583+
retry={retry}
584+
stop={stop}
585+
isMultiModal={currentModel?.multiModal || false}
586+
files={files}
587+
handleFileChange={handleFileChange}
588+
// ChatPicker props
589+
templates={templates}
590+
selectedTemplate={selectedTemplate}
591+
onSelectedTemplateChange={setSelectedTemplate}
592+
models={filteredModels}
593+
languageModel={languageModel}
594+
onLanguageModelChange={handleLanguageModelChange}
595+
// ChatSettings props
596+
apiKeyConfigurable={!process.env.NEXT_PUBLIC_NO_API_KEY_INPUT}
597+
baseURLConfigurable={!process.env.NEXT_PUBLIC_NO_BASE_URL_INPUT}
598+
/>
599+
</div>
604600
</div>
605-
</div>
606601

607-
{/* Preview Area: only shown if fragment exists */}
608-
{fragment && (
609-
<div className="hidden md:flex md:flex-col max-h-full overflow-y-auto">
610-
<Preview
611-
teamID={userTeam?.id}
612-
accessToken={session?.access_token}
613-
selectedTab={currentTab}
614-
onSelectedTabChange={setCurrentTab}
615-
isChatLoading={isSubmitting}
616-
isPreviewLoading={isPreviewLoading}
617-
fragment={fragment}
618-
result={result as ExecutionResult}
619-
onClose={() => {
620-
setFragment(undefined)
621-
setResult(undefined)
622-
setCurrentTab("code")
623-
}}
624-
/>
625-
</div>
626-
)}
602+
{/* Preview Area: only shown if fragment exists */}
603+
{fragment && (
604+
<div className="hidden md:flex md:flex-col max-h-full overflow-y-auto">
605+
<Preview
606+
teamID={userTeam?.id}
607+
accessToken={session?.access_token}
608+
selectedTab={currentTab}
609+
onSelectedTabChange={setCurrentTab}
610+
isChatLoading={isSubmitting}
611+
isPreviewLoading={isPreviewLoading}
612+
fragment={fragment}
613+
result={result as ExecutionResult}
614+
onClose={() => {
615+
setFragment(undefined)
616+
setResult(undefined)
617+
setCurrentTab("code")
618+
}}
619+
/>
620+
</div>
621+
)}
627622
</div>
628623
</div>
629-
</SidebarProvider>
630624
</div>
631625
)
632-
}
626+
}

components/chat-sidebar/chat-sidebar.tsx

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
5858
// projects, // Removed unused variable
5959
isLoading,
6060
error,
61-
setIsOpen,
61+
// setIsOpen, // Commented out as we will force sidebar to be closed
6262
setActiveTab,
6363
setSearchQuery,
6464
getFilteredChats,
@@ -69,43 +69,49 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
6969
} = useChatSidebarStore()
7070

7171
const [showSaveDialog, setShowSaveDialog] = useState(false)
72-
const [showSettingsDialog, setShowSettingsDialog] = useState(false)
73-
const [selectedChatForProject, setSelectedChatForProject] = useState<string | null>(null)
72+
// const [showSaveDialog, setShowSaveDialog] = useState(false) // Not needed if sidebar is hidden
73+
// const [showSettingsDialog, setShowSettingsDialog] = useState(false) // Not needed if sidebar is hidden
74+
// const [selectedChatForProject, setSelectedChatForProject] = useState<string | null>(null) // Not needed if sidebar is hidden
7475

75-
const filteredChats = getFilteredChats()
76-
const filteredProjects = getFilteredProjects()
76+
// const filteredChats = getFilteredChats() // Not needed if sidebar is hidden
77+
// const filteredProjects = getFilteredProjects() // Not needed if sidebar is hidden
7778

78-
const handleSaveAsProject = (chatId: string) => {
79-
setSelectedChatForProject(chatId)
80-
setShowSaveDialog(true)
81-
}
79+
// const handleSaveAsProject = (chatId: string) => { // Not needed if sidebar is hidden
80+
// setSelectedChatForProject(chatId)
81+
// setShowSaveDialog(true)
82+
// }
8283

83-
const handleExport = () => {
84-
const data = exportData()
85-
const blob = new Blob([data], { type: "application/json" })
86-
const url = URL.createObjectURL(blob)
87-
const a = document.createElement("a")
88-
a.href = url
89-
a.download = `chat-history-${new Date().toISOString().split("T")[0]}.json`
90-
document.body.appendChild(a)
91-
a.click()
92-
document.body.removeChild(a)
93-
URL.revokeObjectURL(url)
94-
}
84+
// const handleExport = () => { // Not needed if sidebar is hidden
85+
// const data = exportData()
86+
// const blob = new Blob([data], { type: "application/json" })
87+
// const url = URL.createObjectURL(blob)
88+
// const a = document.createElement("a")
89+
// a.href = url
90+
// a.download = `chat-history-${new Date().toISOString().split("T")[0]}.json`
91+
// document.body.appendChild(a)
92+
// a.click()
93+
// document.body.removeChild(a)
94+
// URL.revokeObjectURL(url)
95+
// }
9596

96-
const handleImport = (event: React.ChangeEvent<HTMLInputElement>) => {
97-
const file = event.target.files?.[0]
98-
if (!file) return
97+
// const handleImport = (event: React.ChangeEvent<HTMLInputElement>) => { // Not needed if sidebar is hidden
98+
// const file = event.target.files?.[0]
99+
// if (!file) return
99100

100-
const reader = new FileReader()
101-
reader.onload = (e) => {
102-
const content = e.target?.result as string
103-
importData(content)
104-
}
105-
reader.readAsText(file)
106-
event.target.value = "" // Reset input
107-
}
101+
// const reader = new FileReader()
102+
// reader.onload = (e) => {
103+
// const content = e.target?.result as string
104+
// importData(content)
105+
// }
106+
// reader.readAsText(file)
107+
// event.target.value = "" // Reset input
108+
// }
109+
110+
// Sidebar is always hidden
111+
return null
108112

113+
// Original code for reference if we need to restore:
114+
/*
109115
if (!isOpen) {
110116
return (
111117
<div className={cn("flex flex-col h-full w-10 border-r bg-background", className)}>
@@ -120,7 +126,7 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
120126
121127
return (
122128
<div className={cn("flex flex-col h-full w-80 border-r bg-background", className)}>
123-
{/* Header */}
129+
// Header
124130
<div className="flex items-center justify-between p-4 border-b">
125131
<div className="flex items-center space-x-2">
126132
<h2 className="font-semibold text-lg">Chat History</h2>
@@ -167,7 +173,7 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
167173
</div>
168174
</div>
169175
170-
{/* Search */}
176+
// Search
171177
<div className="p-4 border-b">
172178
<div className="relative">
173179
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
@@ -180,7 +186,7 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
180186
</div>
181187
</div>
182188
183-
{/* Tabs */}
189+
// Tabs
184190
<div className="flex border-b">
185191
<Button
186192
variant={activeTab === "chats" ? "default" : "ghost"}
@@ -200,7 +206,7 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
200206
</Button>
201207
</div>
202208
203-
{/* Content */}
209+
// Content
204210
<ScrollArea className="flex-1">
205211
<div className="p-4">
206212
{error && <div className="p-3 mb-2 text-sm text-destructive bg-destructive/10 rounded-md">{error}</div>}
@@ -254,10 +260,11 @@ export function ChatSidebar({ className, onChatSelect, onNewChat }: ChatSidebarP
254260
</div>
255261
</ScrollArea>
256262
257-
{/* Dialogs */}
263+
// Dialogs
258264
<SaveProjectDialog open={showSaveDialog} onOpenChange={setShowSaveDialog} chatId={selectedChatForProject} />
259265
260266
<SettingsDialog open={showSettingsDialog} onOpenChange={setShowSettingsDialog} />
261267
</div>
262268
)
269+
*/
263270
}

lib/stores/chat-sidebar-stores.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const useChatSidebarStore = create<ChatSidebarStore>()(
4141
persist(
4242
(set, get) => ({
4343
// Initial state
44-
isOpen: true,
44+
isOpen: false, // Sidebar is now always hidden
4545
activeTab: "chats",
4646
searchQuery: "",
4747
selectedChatId: null,
@@ -51,7 +51,7 @@ export const useChatSidebarStore = create<ChatSidebarStore>()(
5151
projects: [],
5252

5353
// Basic actions
54-
setIsOpen: (isOpen) => set({ isOpen }),
54+
setIsOpen: () => {}, // No-op as sidebar is always hidden
5555
setActiveTab: (activeTab) => set({ activeTab }),
5656
setSearchQuery: (searchQuery) => set({ searchQuery }),
5757
setSelectedChatId: (selectedChatId) => set({ selectedChatId }),
@@ -189,7 +189,7 @@ export const useChatSidebarStore = create<ChatSidebarStore>()(
189189
{
190190
name: "chat-sidebar-storage",
191191
partialize: (state) => ({
192-
isOpen: state.isOpen,
192+
// isOpen: state.isOpen, // No longer persisted as it's always effectively false
193193
activeTab: state.activeTab,
194194
chatSessions: state.chatSessions,
195195
projects: state.projects,

0 commit comments

Comments
 (0)