From 999f9fffdcbd1de8dc7d39472bd1ad61e26f49e4 Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Wed, 6 Aug 2025 16:54:43 +0530 Subject: [PATCH 1/6] Updated .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2b3e5c52..eb5d5c5a 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ next-env.d.ts # git repositories /git/ -dump.rdb \ No newline at end of file +dump.rdb +.env From f4a09e6f7743a73f82aed574481073ce648d6983 Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Wed, 6 Aug 2025 17:12:30 +0530 Subject: [PATCH 2/6] Updated package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 668f6868..0b5ac66c 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev --turbopack", - "build": "next build", - "start": "next start", + "dev": "npx next dev --turbopack", + "build": "npx next build", + "start": "npx next start", "lint": "next lint" }, "dependencies": { From 8a2436977c60aaa8dac73cdf72e233dc9ab5439a Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Thu, 7 Aug 2025 16:59:16 +0530 Subject: [PATCH 3/6] Updated page.tsx --- src/app/app/new/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/app/new/page.tsx b/src/app/app/new/page.tsx index fd24d282..62343bd4 100644 --- a/src/app/app/new/page.tsx +++ b/src/app/app/new/page.tsx @@ -2,6 +2,8 @@ import { createApp } from "@/actions/create-app"; import { redirect } from "next/navigation"; import { getUser } from "@/auth/stack-auth"; +export const dynamic = 'force-dynamic'; + // This page is never rendered. It is used to: // - Force user login without losing the user's initial message and template selection. // - Force a loading page to be rendered (loading.tsx) while the app is being created. From 1cc4c725991cbd3b9af2848f757416c5d2883188 Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Fri, 8 Aug 2025 16:24:14 +0530 Subject: [PATCH 4/6] Updated page.tsx --- src/app/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index b24f0c04..de522171 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,9 +9,13 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; import { ExampleButton } from "@/components/ExampleButton"; import { UserButton } from "@stackframe/stack"; -import { UserApps } from "@/components/user-apps"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { PromptInputTextareaWithTypingAnimation } from "@/components/prompt-input"; +import dynamic from "next/dynamic"; + +const UserApps = dynamic(() => import("@/components/user-apps").then(mod => ({ default: mod.UserApps })), { + ssr: false +}); const queryClient = new QueryClient(); From 3faf0a85b458e03760e58278c9b53f8f5a004025 Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Fri, 8 Aug 2025 16:26:10 +0530 Subject: [PATCH 5/6] Updated user-apps.tsx --- src/app/api/user-apps/route.ts | 12 ++++++++++++ src/components/user-apps.tsx | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/app/api/user-apps/route.ts diff --git a/src/app/api/user-apps/route.ts b/src/app/api/user-apps/route.ts new file mode 100644 index 00000000..d8472046 --- /dev/null +++ b/src/app/api/user-apps/route.ts @@ -0,0 +1,12 @@ +import { NextResponse } from "next/server"; +import { getUserApps } from "@/actions/user-apps"; + +export async function GET() { + try { + const userApps = await getUserApps(); + return NextResponse.json(userApps); + } catch (error) { + console.error("Error fetching user apps:", error); + return NextResponse.json({ error: "Failed to fetch user apps" }, { status: 500 }); + } +} \ No newline at end of file diff --git a/src/components/user-apps.tsx b/src/components/user-apps.tsx index 23bd597f..88534527 100644 --- a/src/components/user-apps.tsx +++ b/src/components/user-apps.tsx @@ -1,12 +1,22 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { getUserApps } from "@/actions/user-apps"; import { AppCard } from "./app-card"; export function UserApps() { const queryClient = useQueryClient(); const { data } = useQuery({ queryKey: ["userApps"], - queryFn: getUserApps, + queryFn: async () => { + const response = await fetch("/api/user-apps"); + if (!response.ok) { + throw new Error("Failed to fetch user apps"); + } + const apps = await response.json(); + // Convert createdAt string to Date object + return apps.map((app: any) => ({ + ...app, + createdAt: new Date(app.createdAt), + })); + }, initialData: [], }); From 8015bb084f66b00fc0eeacef6d510e0cddb5c9d8 Mon Sep 17 00:00:00 2001 From: wwwa1enterprise Date: Mon, 11 Aug 2025 12:57:05 +0530 Subject: [PATCH 6/6] Create webpack.yml --- .github/workflows/webpack.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/webpack.yml diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml new file mode 100644 index 00000000..9626ff6d --- /dev/null +++ b/.github/workflows/webpack.yml @@ -0,0 +1,28 @@ +name: NodeJS with Webpack + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + npx webpack