diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts
new file mode 100644
index 0000000..154979f
--- /dev/null
+++ b/src/app/api/auth/[...nextauth]/route.ts
@@ -0,0 +1,4 @@
+import { handlers } from "@/auth";
+
+export const GET = handlers.GET;
+export const POST = handlers.POST;
\ No newline at end of file
diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx
new file mode 100644
index 0000000..06bd0a6
--- /dev/null
+++ b/src/app/login/page.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import { signIn } from "next-auth/react";
+import { useState } from "react";
+
+export default function LoginPage() {
+ const [email, setEmail] = useState("");
+ const [loading, setLoading] = useState(false);
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault();
+ setLoading(true);
+ await signIn("email", { email });
+ setLoading(false);
+ };
+
+ return (
+
+
+
Tia
+
Your baby tracking companion
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/auth.ts b/src/auth.ts
new file mode 100644
index 0000000..c6e53bd
--- /dev/null
+++ b/src/auth.ts
@@ -0,0 +1,21 @@
+import NextAuth from "next-auth";
+import { DrizzleAdapter } from "@auth/drizzle-adapter";
+import { db } from "@/db";
+import { accounts, sessions, users, verificationTokens } from "@/db/schema/auth";
+
+export const { handlers, auth, signIn, signOut } = NextAuth({
+ adapter: DrizzleAdapter(db, {
+ accountsTable: accounts,
+ sessionsTable: sessions,
+ usersTable: users,
+ verificationTokensTable: verificationTokens,
+ }),
+ providers: [],
+ pages: {
+ signIn: "/login",
+ },
+ session: {
+ strategy: "database",
+ maxAge: 30 * 24 * 60 * 60,
+ },
+});
\ No newline at end of file
diff --git a/src/middleware.ts b/src/middleware.ts
new file mode 100644
index 0000000..96de7bb
--- /dev/null
+++ b/src/middleware.ts
@@ -0,0 +1,11 @@
+import { NextResponse } from "next/server";
+import type { NextRequest } from "next/server";
+
+export function middleware(request: NextRequest) {
+ // For now, just log and continue - auth setup comes later
+ return NextResponse.next();
+}
+
+export const config = {
+ matcher: ["/((?!login|verify|api/auth|_next|static|favicon.ico).*)"],
+};
\ No newline at end of file