first commit

This commit is contained in:
Artur AGH
2023-09-20 10:29:26 +02:00
commit 658dfde935
31 changed files with 4305 additions and 0 deletions

20
src/pages/_app.tsx Normal file
View File

@@ -0,0 +1,20 @@
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { api } from "@/utils/api";
import "@/styles/globals.css";
const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<Component {...pageProps} />
</SessionProvider>
);
};
export default api.withTRPC(MyApp);

View File

@@ -0,0 +1,5 @@
import NextAuth from "next-auth";
import { authOptions } from "@/server/auth";
export default NextAuth(authOptions);

View File

@@ -0,0 +1,19 @@
import { createNextApiHandler } from "@trpc/server/adapters/next";
import { env } from "@/env.mjs";
import { appRouter } from "@/server/api/root";
import { createTRPCContext } from "@/server/api/trpc";
// export API handler
export default createNextApiHandler({
router: appRouter,
createContext: createTRPCContext,
onError:
env.NODE_ENV === "development"
? ({ path, error }) => {
console.error(
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`
);
}
: undefined,
});

7
src/pages/index.tsx Normal file
View File

@@ -0,0 +1,7 @@
import dynamic from "next/dynamic";
const Canvas = dynamic(() => import("../components/canvas"), { ssr: false });
export default function Home() {
return <Canvas />;
}