Let it rip

This commit is contained in:
Henry
2023-10-27 22:01:59 +01:00
parent d142286c67
commit 621b462698
29 changed files with 837 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import NextAuth from "next-auth";
import { authOptions } from "~/server/auth";
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
export const runtime = "edge";
export const preferredRegion = 'lhr1';
export const dynamic = 'force-dynamic'

View File

@@ -0,0 +1,28 @@
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import { type NextRequest } from "next/server";
import { env } from "~/env.mjs";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/trpc";
const handler = (req: NextRequest) =>
fetchRequestHandler({
endpoint: "/api/trpc",
req,
router: appRouter,
createContext: () => createTRPCContext({ req }),
onError:
env.NODE_ENV === "development"
? ({ path, error }) => {
console.error(
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`
);
}
: undefined,
});
export { handler as GET, handler as POST };
export const runtime = "edge";
export const preferredRegion = 'lhr1';
export const dynamic = 'force-dynamic'

31
src/app/layout.tsx Normal file
View File

@@ -0,0 +1,31 @@
import "~/styles/globals.css";
import { Plus_Jakarta_Sans } from "next/font/google";
import { headers } from "next/headers";
import { TRPCReactProvider } from "~/trpc/react";
const jakarta = Plus_Jakarta_Sans({
subsets: ["latin"],
variable: "--font-sans",
});
export const metadata = {
title: "Kan",
description: "The open source Trello alternative",
icons: [{ rel: "icon", url: "/favicon.ico" }],
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={`font-sans ${jakarta.className}}`}>
<TRPCReactProvider headers={headers()}>{children}</TRPCReactProvider>
</body>
</html>
);
}

7
src/app/page.tsx Normal file
View File

@@ -0,0 +1,7 @@
export default function Home() {
return (
<main>
<h1>Kan</h1>
</main>
);
}