diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ee81ea5 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/wedding_planner +NEXTAUTH_SECRET=your-secret +NEXTAUTH_URL=http://localhost:3000 \ No newline at end of file diff --git a/README.md b/README.md index 461dddf..2937010 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ My goal for this project is to be an all-in-one self hosted event planner for ma - [ ] Gift Registries - [ ] Ability for guests to mark an item as purchased - [ ] Task Management +- [ ] Custom Theming ### Possible Features - Budget Tracking diff --git a/app/(auth)/dashboard/page.tsx b/app/(auth)/dashboard/page.tsx index b8e1a83..0696fb4 100644 --- a/app/(auth)/dashboard/page.tsx +++ b/app/(auth)/dashboard/page.tsx @@ -1,7 +1,34 @@ +import { queries } from '@/lib/queries' +import Link from 'next/link' import React from 'react' -export default function DashboardPage() { +export default async function DashboardPage() { + const events = await queries.fetchEvents() + console.log(events) + return ( -
DashboardPage
+
+

Dashboard

+
+

Your Events

+ {events.map((item) => ( +
+

ID: {item.id}

+

Name: {item.name}

+

Date: {item.date ? item.date.toISOString() : 'null'}

+

Location: {item.location ? item.location : 'null'}

+

Creator ID:{item.creatorId}

+

Created At:{item.createdAt.toISOString()}

+ +
+ ))} + + See all events + +
+
) } diff --git a/app/(auth)/events/[eventId]/page.tsx b/app/(auth)/events/[eventId]/page.tsx new file mode 100644 index 0000000..725d6e1 --- /dev/null +++ b/app/(auth)/events/[eventId]/page.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function SingleEventPage() { + return ( +
+ SINGLE EVENT PAGE +
+ ) +} diff --git a/app/(auth)/events/page.tsx b/app/(auth)/events/page.tsx new file mode 100644 index 0000000..1f97056 --- /dev/null +++ b/app/(auth)/events/page.tsx @@ -0,0 +1,21 @@ +import { queries } from '@/lib/queries' +import Link from 'next/link' +import React from 'react' + +export default async function EventsPage() { + const allEvents = await queries.fetchEvents() + console.log(allEvents) + + return ( +
+ Events +
+ {allEvents.length == 0 && ( + <> + You don't have any events yet. Create One! + + )} +
+
+ ) +} diff --git a/app/(public)/layout.tsx b/app/(public)/layout.tsx index a4a066a..4444a89 100644 --- a/app/(public)/layout.tsx +++ b/app/(public)/layout.tsx @@ -1,10 +1,18 @@ +'use client' +import Navbar from '@/components/Navbar' +import { SessionProvider } from 'next-auth/react' import { ReactNode } from 'react' export default function PublicLayout({ children }: { children: ReactNode }) { return ( -
- {/* Public site header if any */} - {children} -
+ <> + + +
+ {/* Public site header if any */} + {children} +
+
+ ) } \ No newline at end of file diff --git a/app/(public)/page.tsx b/app/(public)/page.tsx index 4f6c7e0..fe43c76 100644 --- a/app/(public)/page.tsx +++ b/app/(public)/page.tsx @@ -11,102 +11,9 @@ export default async function Home() { } return ( -
- Next.js logo -
    -
  1. - Get started by editing{" "} - - app/page.tsx - - . -
  2. -
  3. - Save and see your changes instantly. -
  4. -
- -
- - Vercel logomark - Deploy now - - - Read our docs - -
+ HOMEPAGE
- -
+ ); } diff --git a/app/api/events/route.ts b/app/api/events/route.ts index 07e407c..c25ca9d 100644 --- a/app/api/events/route.ts +++ b/app/api/events/route.ts @@ -1,9 +1,10 @@ -import { auth } from '@/lib/auth'; +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/api/auth/[...nextauth]/route' import { mutations } from '@/lib/mutations'; import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { - const session = await auth(); + const session = await getServerSession(authOptions) if (!session?.user) return new NextResponse('Unauthorized', { status: 401 }); const body = await req.json(); diff --git a/app/globals.css b/app/globals.css index a041a74..7f532d6 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,3 +1,16 @@ @import "tailwindcss"; +@theme { + --color-background: #fff5eb; + --color-text: #141d31; +} +/* @theme light { + --color-background: #fff5eb; + --color-text: #141d31; +} + +@theme dark { + --color-background: #141d31; + --color-text: #fff5eb; +} */ \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 2f85159..eaeefaa 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,7 +2,7 @@ import type { Metadata } from "next"; import "./globals.css"; export const metadata: Metadata = { - title: "Create Next App", + title: "Wedding Planner", description: "Generated by create next app", }; @@ -15,8 +15,8 @@ export default async function RootLayout({ return ( -

Welcome to Wedding Planner

{children} diff --git a/bun.lockb b/bun.lockb index 50bf268..15d4977 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 27a5add..d2f344f 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,6 +1,8 @@ 'use client' import { useSession, signOut } from "next-auth/react"; +import { UserIcon } from "./icons/UserIcon"; +import Link from "next/link"; export default function Navbar() { const { data: session, status } = useSession(); @@ -9,9 +11,20 @@ export default function Navbar() { if (!session?.user) return null return ( -