db and auth packages setup

This commit is contained in:
Om Lanke
2025-06-23 16:27:07 +05:30
parent c29f1c26aa
commit bc7ea74d1a
48 changed files with 4410 additions and 56 deletions

View File

@@ -0,0 +1,2 @@
import { handlers } from "@workspace/auth";
export const { GET, POST } = handlers;

BIN
apps/admin/app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

30
apps/admin/app/layout.tsx Normal file
View File

@@ -0,0 +1,30 @@
import { Geist, Geist_Mono } from "next/font/google"
import "@workspace/ui/globals.css"
import { Providers } from "@/components/providers"
const fontSans = Geist({
subsets: ["latin"],
variable: "--font-sans",
})
const fontMono = Geist_Mono({
subsets: ["latin"],
variable: "--font-mono",
})
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${fontSans.variable} ${fontMono.variable} font-sans antialiased `}
>
<Providers>{children}</Providers>
</body>
</html>
)
}

32
apps/admin/app/page.tsx Normal file
View File

@@ -0,0 +1,32 @@
import Login from "@/components/login";
import Studs from "@/components/studs";
import { db, students } from "@workspace/db";
import { signIn, signOut } from "@workspace/auth";
async function getStudents() {
"use server";
const s = await db.select().from(students);
console.log(s);
}
async function logIn() {
"use server";
await signIn("google");
}
async function logOut() {
"use server";
await signOut();
}
export default async function Page() {
return (
<div className="flex items-center justify-center min-h-svh">
<div className="flex flex-col items-center justify-center gap-4">
<h1 className="text-2xl font-bold">Hello admins</h1>
<Login logIn={logIn} />
<Studs action={getStudents} logOut={logOut} />
</div>
</div>
);
}