Skip to content

Commit 01b065f

Browse files
sick hero page!
1 parent 780f3bc commit 01b065f

25 files changed

+995
-160
lines changed

app/api/mail/route.ts

+41-12
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,54 @@ import { render } from "@react-email/render"
33
import WelcomeTemplate from "../../../emails"
44

55
import { Resend } from "resend"
6-
import { NextRequest } from "next/server"
6+
import { NextRequest, NextResponse } from "next/server"
7+
import { Redis } from "@upstash/redis"
8+
import { Ratelimit } from "@upstash/ratelimit"
79

810
const resend = new Resend(process.env.RESEND_API_KEY)
911

12+
const redis = new Redis({
13+
url: process.env.UPSTASH_REDIS_REST_URL,
14+
token: process.env.UPSTASH_REDIS_REST_TOKEN,
15+
})
1016

17+
const ratelimit = new Ratelimit({
18+
redis,
19+
limiter: Ratelimit.fixedWindow(3, "1 m"),
20+
})
21+
22+
export async function POST(request: NextRequest, response: NextResponse) {
23+
const ip = request.ip ?? "127.0.0.1"
24+
25+
const result = await ratelimit.limit(ip)
26+
27+
if (!result.success) {
28+
return Response.json(
29+
{
30+
error: "Too many requests!!",
31+
},
32+
{
33+
status: 429,
34+
}
35+
)
36+
}
1137

12-
export async function POST(request: NextRequest, response: Response) {
1338
const { email, firstname } = await request.json()
1439

15-
// const { data, error } = await resend.emails.send({
16-
// from: "Lakshay <[email protected]>",
17-
// to: [email],
18-
// subject: "Thankyou for waitlisting morph2json!",
19-
// html: render(WelcomeTemplate({ userFirstname: firstname})),
20-
// })
40+
const { data, error } = await resend.emails.send({
41+
from: "Lakshay <[email protected]>",
42+
to: [email],
43+
subject: "Thankyou for waitlisting morph2json!",
44+
html: render(WelcomeTemplate({ userFirstname: firstname })),
45+
})
46+
47+
if (error) {
48+
return NextResponse.json(error)
49+
}
2150

22-
// if (error) {
23-
// return Response.json(error)
24-
// }
51+
if (!data) {
52+
return NextResponse.json({ message: "Failed to send email" })
53+
}
2554

26-
return Response.json({message: "Email sent successfully"})
55+
return NextResponse.json({ message: "Email sent successfully" })
2756
}

app/api/notion/waitlist/route.ts

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ export async function POST(request: Request) {
1919
},
2020
],
2121
},
22+
"First Name": {
23+
type: "rich_text",
24+
rich_text: [
25+
{
26+
type: "text",
27+
text: {
28+
content: body?.name,
29+
},
30+
},
31+
],
32+
},
2233
},
2334
})
2435

app/config/rateLimit.ts

-9
This file was deleted.

app/config/redisDB.ts

-9
This file was deleted.

app/favicon.ico

-15.4 KB
Binary file not shown.

app/globals.css

+78
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,81 @@
22
@tailwind components;
33
@tailwind utilities;
44

5+
@layer base {
6+
:root {
7+
--background: 0 0% 100%;
8+
--foreground: 240 10% 3.9%;
9+
10+
--card: 0 0% 100%;
11+
--card-foreground: 240 10% 3.9%;
12+
13+
--popover: 0 0% 100%;
14+
--popover-foreground: 240 10% 3.9%;
15+
16+
--primary: 240 5.9% 10%;
17+
--primary-foreground: 0 0% 98%;
18+
19+
--secondary: 240 4.8% 95.9%;
20+
--secondary-foreground: 240 5.9% 10%;
21+
22+
--muted: 240 4.8% 95.9%;
23+
--muted-foreground: 240 3.8% 46.1%;
24+
25+
--accent: 240 4.8% 95.9%;
26+
--accent-foreground: 240 5.9% 10%;
27+
28+
--destructive: 0 84.2% 60.2%;
29+
--destructive-foreground: 0 0% 98%;
30+
31+
--border: 240 5.9% 90%;
32+
--input: 240 5.9% 90%;
33+
--ring: 240 10% 3.9%;
34+
35+
--radius: 0.5rem;
36+
}
37+
38+
.dark {
39+
--background: 240 10% 3.9%;
40+
--foreground: 0 0% 98%;
41+
42+
--card: 240 10% 3.9%;
43+
--card-foreground: 0 0% 98%;
44+
45+
--popover: 240 10% 3.9%;
46+
--popover-foreground: 0 0% 98%;
47+
48+
--primary: 0 0% 98%;
49+
--primary-foreground: 240 5.9% 10%;
50+
51+
--secondary: 240 3.7% 15.9%;
52+
--secondary-foreground: 0 0% 98%;
53+
54+
--muted: 240 3.7% 15.9%;
55+
--muted-foreground: 240 5% 64.9%;
56+
57+
--accent: 240 3.7% 15.9%;
58+
--accent-foreground: 0 0% 98%;
59+
60+
--destructive: 0 62.8% 30.6%;
61+
--destructive-foreground: 0 0% 98%;
62+
63+
--border: 240 3.7% 15.9%;
64+
--input: 240 3.7% 15.9%;
65+
--ring: 240 4.9% 83.9%;
66+
}
67+
}
68+
69+
@layer base {
70+
* {
71+
@apply border-border;
72+
}
73+
body {
74+
@apply bg-background text-foreground;
75+
}
76+
}
77+
78+
body {
79+
::selection {
80+
@apply bg-accent text-yellow-200;
81+
}
82+
}

app/layout.tsx

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
import type { Metadata } from "next";
2-
import { Inter } from "next/font/google";
3-
import "./globals.css";
1+
import "./globals.css"
2+
import type { Metadata } from "next"
3+
import { Figtree } from "next/font/google"
4+
import { Toaster } from "@/components/ui/sonner"
45

5-
const inter = Inter({ subsets: ["latin"] });
6+
const FigtreeFont = Figtree({ subsets: ["latin"] })
67

78
export const metadata: Metadata = {
8-
title: "Create Next App",
9-
description: "Generated by create next app",
10-
};
9+
title:
10+
"morph2json | Effortlessly Convert your raw data into a well structured JSON",
11+
description:
12+
"Join the waitlist to get early access to morph2json and get notified when it's ready for you to use.",
13+
}
1114

1215
export default function RootLayout({
1316
children,
1417
}: Readonly<{
15-
children: React.ReactNode;
18+
children: React.ReactNode
1619
}>) {
1720
return (
18-
<html lang="en">
19-
<body className={inter.className}>{children}</body>
21+
<html lang="en" className="dark" suppressHydrationWarning>
22+
<body className={FigtreeFont.className}>
23+
{children}
24+
<Toaster richColors position="top-center" />
25+
</body>
2026
</html>
21-
);
27+
)
2228
}

0 commit comments

Comments
 (0)