Skip to content

Commit a8e03d3

Browse files
committed
updated faq for lazyAndSuspense
1 parent 20cdd97 commit a8e03d3

File tree

21 files changed

+2652
-2331
lines changed

21 files changed

+2652
-2331
lines changed

apps/api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"@types/express": "^4.17.21",
2020
"@types/jsonwebtoken": "^9.0.7",
2121
"@types/node": "^24.5.1",
22-
"prisma": "^5.22.0",
22+
"prisma": "^6.17.1",
2323
"tsx": "^4.20.3",
2424
"typescript": "^5.9.2"
2525
},
2626
"dependencies": {
2727
"@octokit/graphql": "^9.0.1",
2828
"@opensox/shared": "workspace:*",
29-
"@prisma/client": "^5.22.0",
29+
"@prisma/client": "^6.17.1",
3030
"@trpc/server": "^11.5.1",
3131
"cors": "^2.8.5",
3232
"dotenv": "^16.5.0",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- CreateTable
2+
CREATE TABLE "QueryCount" (
3+
"id" INTEGER NOT NULL DEFAULT 1,
4+
"total_queries" BIGINT NOT NULL,
5+
6+
CONSTRAINT "QueryCount_pkey" PRIMARY KEY ("id")
7+
);
8+
9+
-- CreateTable
10+
CREATE TABLE "User" (
11+
"id" TEXT NOT NULL,
12+
"email" TEXT NOT NULL,
13+
"firstName" TEXT NOT NULL,
14+
"authMethod" TEXT NOT NULL,
15+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
16+
"lastLogin" TIMESTAMP(3) NOT NULL,
17+
18+
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
19+
);
20+
21+
-- CreateTable
22+
CREATE TABLE "Account" (
23+
"id" TEXT NOT NULL,
24+
"userId" TEXT NOT NULL,
25+
"type" TEXT NOT NULL,
26+
"provider" TEXT NOT NULL,
27+
"providerAccountId" TEXT NOT NULL,
28+
"refresh_token" TEXT,
29+
"access_token" TEXT,
30+
"expires_at" INTEGER,
31+
"token_type" TEXT,
32+
"scope" TEXT,
33+
"id_token" TEXT,
34+
"session_state" TEXT,
35+
36+
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
37+
);
38+
39+
-- CreateIndex
40+
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
41+
42+
-- CreateIndex
43+
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
44+
45+
-- AddForeignKey
46+
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Please do not edit this file manually
2+
# It should be added in your version-control system (e.g., Git)
3+
provider = "postgresql"
Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
import Navbar from '@/components/landing-sections/navbar'
2-
import React from 'react'
1+
"use client";
2+
3+
import React, { Suspense, lazy } from "react";
4+
5+
import { Skeleton } from "@/components/ui/skeleton";
6+
7+
const Navbar = lazy(() => import("@/components/landing-sections/navbar"));
38

49
const Layout = ({ children }: { children: React.ReactNode }) => {
5-
return (
6-
<section>
7-
<Navbar />
8-
{children}
9-
</section>
10-
)
11-
}
12-
13-
export default Layout
10+
return (
11+
<section>
12+
<Suspense
13+
fallback={
14+
<div className="py-20 text-center text-lg text-neutral-400">
15+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
16+
<Skeleton className="h-6 w-40" />
17+
<Skeleton className="h-4 w-72" />
18+
<Skeleton className="h-4 w-64" />
19+
<Skeleton className="h-4 w-56" />
20+
</div>
21+
</div>
22+
}
23+
>
24+
<Navbar />
25+
</Suspense>
26+
{children}
27+
</section>
28+
);
29+
};
30+
31+
export default Layout;

apps/web/src/app/(main)/(landing)/page.tsx

Lines changed: 155 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,166 @@
11
'use client'
2-
import Bento from '@/components/landing-sections/Bento'
3-
import Brands from '@/components/landing-sections/Brands'
4-
import CTA from '@/components/landing-sections/CTA'
5-
import Footer from '@/components/landing-sections/footer'
6-
import Hero from '@/components/landing-sections/Hero'
7-
import HowItWorks from '@/components/landing-sections/how-it-works'
8-
import Navbar from '@/components/landing-sections/navbar'
9-
import Testimonials from '@/components/landing-sections/testimonials'
10-
import Video from '@/components/landing-sections/video'
11-
import React from 'react'
12-
import { FaqSection } from '@/components/faq/FaqSection'
2+
import React, { Suspense, lazy } from 'react'
3+
4+
import { Skeleton } from "@/components/ui/skeleton";
5+
6+
const Navbar = lazy(() => import('@/components/landing-sections/navbar'))
7+
const Hero = lazy(() => import('@/components/landing-sections/Hero'))
8+
const Bento = lazy(() => import('@/components/landing-sections/Bento'))
9+
const Video = lazy(() => import('@/components/landing-sections/video'))
10+
const HowItWorks = lazy(() => import('@/components/landing-sections/how-it-works'))
11+
const Brands = lazy(() => import('@/components/landing-sections/Brands'))
12+
const Testimonials = lazy(() => import('@/components/landing-sections/testimonials'))
13+
const FaqSection = lazy(() => import('@/components/faq/FaqSection'))
14+
const CTA = lazy(() => import('@/components/landing-sections/CTA'))
15+
const Footer = lazy(() => import('@/components/landing-sections/footer'))
1316

1417

1518
const Landing = () => {
1619
return (
1720
<main className='min-h-screen w-full bg-[#101010] text-white font-sans overflow-hidden relative'>
18-
<Navbar />
19-
<div className="min-h-screen w-full max-w-[2000px] mx-auto border-x border-[#252525] overflow-hidden">
20-
<Hero />
21-
<Bento />
22-
<Video />
23-
<HowItWorks />
24-
<FaqSection />
25-
<Brands />
26-
<Testimonials />
21+
<Suspense
22+
fallback={
23+
<div className="py-20 text-center text-lg text-neutral-400">
24+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
25+
<Skeleton className="h-6 w-40" />
26+
<Skeleton className="h-4 w-72" />
27+
<Skeleton className="h-4 w-64" />
28+
<Skeleton className="h-4 w-56" />
29+
</div>
30+
</div>
31+
}
32+
>
33+
<Navbar />
34+
</Suspense>
35+
<div className="min-h-screen w-full max-w-[2000px] mx-auto border-x border-[#252525] overflow-hidden">
36+
<Suspense
37+
fallback={
38+
<div className="py-20 text-center text-lg text-neutral-400">
39+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
40+
<Skeleton className="h-6 w-40" />
41+
<Skeleton className="h-4 w-72" />
42+
<Skeleton className="h-4 w-64" />
43+
<Skeleton className="h-4 w-56" />
44+
</div>
45+
</div>
46+
}
47+
>
48+
<Hero />
49+
</Suspense>
50+
<Suspense
51+
fallback={
52+
<div className="py-20 text-center text-lg text-neutral-400">
53+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
54+
<Skeleton className="h-6 w-40" />
55+
<Skeleton className="h-4 w-72" />
56+
<Skeleton className="h-4 w-64" />
57+
<Skeleton className="h-4 w-56" />
58+
</div>
59+
</div>
60+
}
61+
>
62+
<Bento />
63+
</Suspense>
64+
<Suspense
65+
fallback={
66+
<div className="py-20 text-center text-lg text-neutral-400">
67+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
68+
<Skeleton className="h-6 w-40" />
69+
<Skeleton className="h-4 w-72" />
70+
<Skeleton className="h-4 w-64" />
71+
<Skeleton className="h-4 w-56" />
72+
</div>
73+
</div>
74+
}
75+
>
76+
<Video />
77+
</Suspense>
78+
<Suspense
79+
fallback={
80+
<div className="py-20 text-center text-lg text-neutral-400">
81+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
82+
<Skeleton className="h-6 w-40" />
83+
<Skeleton className="h-4 w-72" />
84+
<Skeleton className="h-4 w-64" />
85+
<Skeleton className="h-4 w-56" />
86+
</div>
87+
</div>
88+
}
89+
>
90+
<HowItWorks />
91+
</Suspense>
92+
<Suspense
93+
fallback={
94+
<div className="py-20 text-center text-lg text-neutral-400">
95+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
96+
<Skeleton className="h-6 w-40" />
97+
<Skeleton className="h-4 w-72" />
98+
<Skeleton className="h-4 w-64" />
99+
<Skeleton className="h-4 w-56" />
100+
</div>
101+
</div>
102+
}
103+
>
104+
<Brands />
105+
</Suspense>
106+
<Suspense
107+
fallback={
108+
<div className="py-20 text-center text-lg text-neutral-400">
109+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
110+
<Skeleton className="h-6 w-40" />
111+
<Skeleton className="h-4 w-72" />
112+
<Skeleton className="h-4 w-64" />
113+
<Skeleton className="h-4 w-56" />
114+
</div>
115+
</div>
116+
}
117+
>
118+
<Testimonials />
119+
</Suspense>
120+
<Suspense
121+
fallback={
122+
<div className="py-20 text-center text-lg text-neutral-400">
123+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
124+
<Skeleton className="h-6 w-40" />
125+
<Skeleton className="h-4 w-72" />
126+
<Skeleton className="h-4 w-64" />
127+
<Skeleton className="h-4 w-56" />
128+
</div>
129+
</div>
130+
}
131+
>
132+
<FaqSection />
133+
</Suspense>
27134
</div>
28135
<div className="max-w-[2000px] w-full mx-auto">
29-
<CTA />
30-
<Footer />
136+
<Suspense
137+
fallback={
138+
<div className="py-20 text-center text-lg text-neutral-400">
139+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
140+
<Skeleton className="h-6 w-40" />
141+
<Skeleton className="h-4 w-72" />
142+
<Skeleton className="h-4 w-64" />
143+
<Skeleton className="h-4 w-56" />
144+
</div>
145+
</div>
146+
}
147+
>
148+
<CTA />
149+
</Suspense>
150+
<Suspense
151+
fallback={
152+
<div className="py-20 text-center text-lg text-neutral-400">
153+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-4 px-6">
154+
<Skeleton className="h-6 w-40" />
155+
<Skeleton className="h-4 w-72" />
156+
<Skeleton className="h-4 w-64" />
157+
<Skeleton className="h-4 w-56" />
158+
</div>
159+
</div>
160+
}
161+
>
162+
<Footer />
163+
</Suspense>
31164
</div>
32165
</main >
33166
)

0 commit comments

Comments
 (0)