diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
| commit | 083ea5bd19172381bb53e95aaf98eaabef839c54 (patch) | |
| tree | 4d1c041aab7cd8d15382330db08caeb9c5a12c63 /app | |
| parent | b792121977ade8bdd3fb62704b65a9fcbd1436b9 (diff) | |
| download | karakeep-083ea5bd19172381bb53e95aaf98eaabef839c54.tar.zst | |
Move the web app into a subdir
Diffstat (limited to 'app')
| -rw-r--r-- | app/api/auth/[...nextauth]/route.tsx | 3 | ||||
| -rw-r--r-- | app/api/v1/links/route.ts | 60 | ||||
| -rw-r--r-- | app/favicon.ico | bin | 25931 -> 0 bytes | |||
| -rw-r--r-- | app/globals.css | 76 | ||||
| -rw-r--r-- | app/layout.tsx | 22 | ||||
| -rw-r--r-- | app/page.tsx | 15 |
6 files changed, 0 insertions, 176 deletions
diff --git a/app/api/auth/[...nextauth]/route.tsx b/app/api/auth/[...nextauth]/route.tsx deleted file mode 100644 index bfcda516..00000000 --- a/app/api/auth/[...nextauth]/route.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import { authHandler } from "@/lib/auth"; - -export { authHandler as GET, authHandler as POST } diff --git a/app/api/v1/links/route.ts b/app/api/v1/links/route.ts deleted file mode 100644 index 5be1018e..00000000 --- a/app/api/v1/links/route.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { authOptions } from "@/lib/auth"; -import prisma from "@/lib/prisma"; -import { ZNewBookmarkedLinkRequest, ZGetLinksResponse, ZBookmarkedLink } from "@/lib/types/api/links"; -import { getServerSession } from "next-auth"; -import { NextRequest, NextResponse } from "next/server"; - -export async function POST(request: NextRequest) { - // TODO: We probably should be using an API key here instead of the session; - const session = await getServerSession(authOptions); - if (!session) { - return new Response(null, { status: 401 }); - } - - const linkRequest = ZNewBookmarkedLinkRequest.safeParse(await request.json()); - - if (!linkRequest.success) { - return NextResponse.json({ - error: linkRequest.error.toString(), - }, { status: 400 }); - } - - const link = await prisma.bookmarkedLink.create({ - data: { - url: linkRequest.data.url, - userId: session.user.id, - } - }); - - let response: ZBookmarkedLink = { ...link }; - - return NextResponse.json(response, { status: 201 }); -} - -export async function GET() { - // TODO: We probably should be using an API key here instead of the session; - const session = await getServerSession(authOptions); - if (!session) { - return new Response(null, { status: 401 }); - } - const links = await prisma.bookmarkedLink.findMany({ - where: { - userId: session.user.id, - }, - select: { - id: true, - url: true, - createdAt: true, - details: { - select: { - title: true, - description: true, - imageUrl: true, - } - }, - } - }); - - let response: ZGetLinksResponse = { links }; - return NextResponse.json(response); -} diff --git a/app/favicon.ico b/app/favicon.ico Binary files differdeleted file mode 100644 index 718d6fea..00000000 --- a/app/favicon.ico +++ /dev/null diff --git a/app/globals.css b/app/globals.css deleted file mode 100644 index 6a757250..00000000 --- a/app/globals.css +++ /dev/null @@ -1,76 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer base { - :root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; - - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; - - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; - - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; - - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 210 40% 98%; - - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --ring: 222.2 84% 4.9%; - - --radius: 0.5rem; - } - - .dark { - --background: 222.2 84% 4.9%; - --foreground: 210 40% 98%; - - --card: 222.2 84% 4.9%; - --card-foreground: 210 40% 98%; - - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; - - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 11.2%; - - --secondary: 217.2 32.6% 17.5%; - --secondary-foreground: 210 40% 98%; - - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; - - --accent: 217.2 32.6% 17.5%; - --accent-foreground: 210 40% 98%; - - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 210 40% 98%; - - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - --ring: 212.7 26.8% 83.9%; - } -} - -@layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } -}
\ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx deleted file mode 100644 index 3314e478..00000000 --- a/app/layout.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import type { Metadata } from "next"; -import { Inter } from "next/font/google"; -import "./globals.css"; - -const inter = Inter({ subsets: ["latin"] }); - -export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", -}; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - <html lang="en"> - <body className={inter.className}>{children}</body> - </html> - ); -} diff --git a/app/page.tsx b/app/page.tsx deleted file mode 100644 index 2df40508..00000000 --- a/app/page.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { LoginButton } from "../components/auth/login"; -import { LogoutButton } from "../components/auth/logout"; - -export default function Home() { - return ( - <main className="flex min-h-screen flex-col items-center justify-between p-24"> - <div> - <LoginButton /> - <br /> - <br /> - <LogoutButton /> - </div> - </main> - ); -} |
