@proofkit/cli 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +120 -0
- package/LICENSE.md +21 -0
- package/README.md +19 -0
- package/dist/acorn-AKFTBDM6.js +15 -0
- package/dist/angular-BOQ6FHSU.js +2 -0
- package/dist/babel-ZTOORN7K.js +15 -0
- package/dist/chunk-4LISTI44.js +1 -0
- package/dist/estree-KOJPX4S6.js +36 -0
- package/dist/flow-RCI44GYZ.js +19 -0
- package/dist/glimmer-GV5EF5E4.js +30 -0
- package/dist/graphql-YXQNPQWM.js +29 -0
- package/dist/html-ZAJTRROK.js +22 -0
- package/dist/index.js +300 -0
- package/dist/markdown-Q75DTQI7.js +63 -0
- package/dist/meriyah-32K7GBV5.js +4 -0
- package/dist/postcss-WWYO4PGL.js +54 -0
- package/dist/typescript-M6N7JDNQ.js +20 -0
- package/dist/yaml-LY7PNAYV.js +161 -0
- package/index.d.ts +19 -0
- package/package.json +122 -0
- package/template/extras/_cursor/conditional-rules/nextjs-framework.mdc +51 -0
- package/template/extras/_cursor/conditional-rules/npm.mdc +60 -0
- package/template/extras/_cursor/conditional-rules/pnpm.mdc +65 -0
- package/template/extras/_cursor/conditional-rules/yarn.mdc +60 -0
- package/template/extras/_cursor/rules/cursor-rules.mdc +88 -0
- package/template/extras/_cursor/rules/filemaker-api.mdc +176 -0
- package/template/extras/_cursor/rules/troubleshooting-patterns.mdc +240 -0
- package/template/extras/_cursor/rules/ui-components.mdc +57 -0
- package/template/extras/config/_eslint.js +27 -0
- package/template/extras/config/_prettier.config.js +6 -0
- package/template/extras/config/drizzle-config-mysql.ts +12 -0
- package/template/extras/config/drizzle-config-postgres.ts +12 -0
- package/template/extras/config/drizzle-config-sqlite.ts +12 -0
- package/template/extras/config/fmschema.config.mjs +9 -0
- package/template/extras/config/get-query-client.ts +6 -0
- package/template/extras/config/postcss.config.cjs +7 -0
- package/template/extras/config/query-provider-vite.tsx +19 -0
- package/template/extras/config/query-provider.tsx +21 -0
- package/template/extras/emailProviders/none/email.tsx +24 -0
- package/template/extras/emailProviders/plunk/email.tsx +26 -0
- package/template/extras/emailProviders/plunk/service.ts +4 -0
- package/template/extras/emailProviders/resend/email.tsx +23 -0
- package/template/extras/emailProviders/resend/service.ts +4 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/actions.ts +93 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/page.tsx +27 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/profile-form.tsx +56 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx +110 -0
- package/template/extras/fmaddon-auth/app/(main)/auth/profile/schema.ts +19 -0
- package/template/extras/fmaddon-auth/app/auth/forgot-password/actions.ts +37 -0
- package/template/extras/fmaddon-auth/app/auth/forgot-password/forgot-form.tsx +41 -0
- package/template/extras/fmaddon-auth/app/auth/forgot-password/page.tsx +21 -0
- package/template/extras/fmaddon-auth/app/auth/forgot-password/schema.ts +5 -0
- package/template/extras/fmaddon-auth/app/auth/login/actions.ts +34 -0
- package/template/extras/fmaddon-auth/app/auth/login/login-form.tsx +64 -0
- package/template/extras/fmaddon-auth/app/auth/login/page.tsx +26 -0
- package/template/extras/fmaddon-auth/app/auth/login/schema.ts +6 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/actions.ts +50 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/page.tsx +32 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/reset-password-form.tsx +59 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/schema.ts +14 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/actions.ts +45 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/page.tsx +32 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/schema.ts +5 -0
- package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/verify-email-form.tsx +48 -0
- package/template/extras/fmaddon-auth/app/auth/signup/actions.ts +49 -0
- package/template/extras/fmaddon-auth/app/auth/signup/page.tsx +26 -0
- package/template/extras/fmaddon-auth/app/auth/signup/schema.ts +12 -0
- package/template/extras/fmaddon-auth/app/auth/signup/signup-form.tsx +67 -0
- package/template/extras/fmaddon-auth/app/auth/verify-email/actions.ts +110 -0
- package/template/extras/fmaddon-auth/app/auth/verify-email/email-verification-form.tsx +45 -0
- package/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx +38 -0
- package/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx +35 -0
- package/template/extras/fmaddon-auth/app/auth/verify-email/schema.ts +5 -0
- package/template/extras/fmaddon-auth/components/auth/actions.ts +16 -0
- package/template/extras/fmaddon-auth/components/auth/protect.tsx +17 -0
- package/template/extras/fmaddon-auth/components/auth/redirect.tsx +26 -0
- package/template/extras/fmaddon-auth/components/auth/use-user.ts +59 -0
- package/template/extras/fmaddon-auth/components/auth/user-menu.tsx +51 -0
- package/template/extras/fmaddon-auth/emails/auth-code.tsx +156 -0
- package/template/extras/fmaddon-auth/middleware.ts +45 -0
- package/template/extras/fmaddon-auth/server/auth/utils/email-verification.ts +136 -0
- package/template/extras/fmaddon-auth/server/auth/utils/encryption.ts +51 -0
- package/template/extras/fmaddon-auth/server/auth/utils/index.ts +16 -0
- package/template/extras/fmaddon-auth/server/auth/utils/password-reset.ts +152 -0
- package/template/extras/fmaddon-auth/server/auth/utils/password.ts +67 -0
- package/template/extras/fmaddon-auth/server/auth/utils/redirect.ts +8 -0
- package/template/extras/fmaddon-auth/server/auth/utils/session.ts +192 -0
- package/template/extras/fmaddon-auth/server/auth/utils/user.ts +147 -0
- package/template/extras/prisma/schema/base-planetscale.prisma +24 -0
- package/template/extras/prisma/schema/base.prisma +20 -0
- package/template/extras/prisma/schema/with-auth-planetscale.prisma +77 -0
- package/template/extras/prisma/schema/with-auth.prisma +74 -0
- package/template/extras/src/app/_components/post-tw.tsx +50 -0
- package/template/extras/src/app/_components/post.tsx +54 -0
- package/template/extras/src/app/api/auth/[...nextauth]/route.ts +4 -0
- package/template/extras/src/app/api/trpc/[trpc]/route.ts +34 -0
- package/template/extras/src/app/clerk-auth/layout.tsx +10 -0
- package/template/extras/src/app/clerk-auth/signin/[[...sign-in]]/page.tsx +5 -0
- package/template/extras/src/app/clerk-auth/signup/[[...sign-up]]/page.tsx +5 -0
- package/template/extras/src/app/layout/base.tsx +34 -0
- package/template/extras/src/app/layout/main-shell.tsx +37 -0
- package/template/extras/src/app/layout/with-trpc-tw.tsx +24 -0
- package/template/extras/src/app/layout/with-trpc.tsx +24 -0
- package/template/extras/src/app/layout/with-tw.tsx +20 -0
- package/template/extras/src/app/next-auth/layout.tsx +22 -0
- package/template/extras/src/app/next-auth/signin/page.tsx +82 -0
- package/template/extras/src/app/next-auth/signup/action.ts +24 -0
- package/template/extras/src/app/next-auth/signup/page.tsx +40 -0
- package/template/extras/src/app/next-auth/signup/validation.ts +12 -0
- package/template/extras/src/app/page/base.tsx +6 -0
- package/template/extras/src/app/page/with-auth-trpc-tw.tsx +67 -0
- package/template/extras/src/app/page/with-auth-trpc.tsx +68 -0
- package/template/extras/src/app/page/with-trpc-tw.tsx +53 -0
- package/template/extras/src/app/page/with-trpc.tsx +54 -0
- package/template/extras/src/app/page/with-tw.tsx +37 -0
- package/template/extras/src/components/clerk-auth/clerk-provider.tsx +18 -0
- package/template/extras/src/components/clerk-auth/user-menu-mobile.tsx +36 -0
- package/template/extras/src/components/clerk-auth/user-menu.tsx +24 -0
- package/template/extras/src/components/next-auth/next-auth-provider.tsx +14 -0
- package/template/extras/src/components/next-auth/user-menu-mobile.tsx +31 -0
- package/template/extras/src/components/next-auth/user-menu.tsx +38 -0
- package/template/extras/src/env/with-auth.ts +31 -0
- package/template/extras/src/env/with-clerk.ts +20 -0
- package/template/extras/src/index.module.css +177 -0
- package/template/extras/src/middleware/clerk.ts +20 -0
- package/template/extras/src/middleware/next-auth.ts +5 -0
- package/template/extras/src/pages/_app/base.tsx +14 -0
- package/template/extras/src/pages/_app/with-auth-trpc-tw.tsx +23 -0
- package/template/extras/src/pages/_app/with-auth-trpc.tsx +23 -0
- package/template/extras/src/pages/_app/with-auth-tw.tsx +21 -0
- package/template/extras/src/pages/_app/with-auth.tsx +21 -0
- package/template/extras/src/pages/_app/with-trpc-tw.tsx +16 -0
- package/template/extras/src/pages/_app/with-trpc.tsx +16 -0
- package/template/extras/src/pages/_app/with-tw.tsx +14 -0
- package/template/extras/src/pages/api/auth/[...nextauth].ts +5 -0
- package/template/extras/src/pages/api/trpc/[trpc].ts +19 -0
- package/template/extras/src/pages/index/base.tsx +47 -0
- package/template/extras/src/pages/index/with-auth-trpc-tw.tsx +80 -0
- package/template/extras/src/pages/index/with-auth-trpc.tsx +81 -0
- package/template/extras/src/pages/index/with-trpc-tw.tsx +52 -0
- package/template/extras/src/pages/index/with-trpc.tsx +53 -0
- package/template/extras/src/pages/index/with-tw.tsx +45 -0
- package/template/extras/src/server/api/root.ts +23 -0
- package/template/extras/src/server/api/routers/post/base.ts +40 -0
- package/template/extras/src/server/api/routers/post/with-auth-drizzle.ts +39 -0
- package/template/extras/src/server/api/routers/post/with-auth-prisma.ts +41 -0
- package/template/extras/src/server/api/routers/post/with-auth.ts +37 -0
- package/template/extras/src/server/api/routers/post/with-drizzle.ts +30 -0
- package/template/extras/src/server/api/routers/post/with-prisma.ts +31 -0
- package/template/extras/src/server/api/trpc-app/base.ts +103 -0
- package/template/extras/src/server/api/trpc-app/with-auth-db.ts +133 -0
- package/template/extras/src/server/api/trpc-app/with-auth.ts +130 -0
- package/template/extras/src/server/api/trpc-app/with-db.ts +106 -0
- package/template/extras/src/server/api/trpc-pages/base.ts +122 -0
- package/template/extras/src/server/api/trpc-pages/with-auth-db.ts +160 -0
- package/template/extras/src/server/api/trpc-pages/with-auth.ts +158 -0
- package/template/extras/src/server/api/trpc-pages/with-db.ts +125 -0
- package/template/extras/src/server/data/users.ts +23 -0
- package/template/extras/src/server/db/db-prisma-planetscale.ts +22 -0
- package/template/extras/src/server/db/db-prisma.ts +17 -0
- package/template/extras/src/server/db/index-drizzle/with-mysql.ts +18 -0
- package/template/extras/src/server/db/index-drizzle/with-planetscale.ts +7 -0
- package/template/extras/src/server/db/index-drizzle/with-postgres.ts +18 -0
- package/template/extras/src/server/db/index-drizzle/with-sqlite.ts +19 -0
- package/template/extras/src/server/db/schema-drizzle/base-mysql.ts +34 -0
- package/template/extras/src/server/db/schema-drizzle/base-planetscale.ts +34 -0
- package/template/extras/src/server/db/schema-drizzle/base-postgres.ts +36 -0
- package/template/extras/src/server/db/schema-drizzle/base-sqlite.ts +30 -0
- package/template/extras/src/server/db/schema-drizzle/with-auth-mysql.ts +123 -0
- package/template/extras/src/server/db/schema-drizzle/with-auth-planetscale.ts +117 -0
- package/template/extras/src/server/db/schema-drizzle/with-auth-postgres.ts +130 -0
- package/template/extras/src/server/db/schema-drizzle/with-auth-sqlite.ts +116 -0
- package/template/extras/src/server/next-auth/base.ts +111 -0
- package/template/extras/src/server/next-auth/password.ts +13 -0
- package/template/extras/src/server/next-auth/with-drizzle.ts +83 -0
- package/template/extras/src/server/next-auth/with-prisma.ts +72 -0
- package/template/extras/src/trpc/query-client.ts +25 -0
- package/template/extras/src/trpc/react.tsx +76 -0
- package/template/extras/src/trpc/server.ts +30 -0
- package/template/extras/src/utils/api.ts +68 -0
- package/template/extras/start-database/mysql.sh +54 -0
- package/template/extras/start-database/postgres.sh +55 -0
- package/template/fm-addon/ProofKitAuth/de.xml +518 -0
- package/template/fm-addon/ProofKitAuth/en.xml +518 -0
- package/template/fm-addon/ProofKitAuth/es.xml +518 -0
- package/template/fm-addon/ProofKitAuth/fr.xml +518 -0
- package/template/fm-addon/ProofKitAuth/icon.png +0 -0
- package/template/fm-addon/ProofKitAuth/icon@2x.png +0 -0
- package/template/fm-addon/ProofKitAuth/info.json +11 -0
- package/template/fm-addon/ProofKitAuth/info_de.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_en.json +8 -0
- package/template/fm-addon/ProofKitAuth/info_es.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_fr.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_it.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_ja.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_ko.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_nl.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_pt.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_sv.json +18 -0
- package/template/fm-addon/ProofKitAuth/info_zh.json +18 -0
- package/template/fm-addon/ProofKitAuth/it.xml +518 -0
- package/template/fm-addon/ProofKitAuth/ja.xml +518 -0
- package/template/fm-addon/ProofKitAuth/ko.xml +518 -0
- package/template/fm-addon/ProofKitAuth/nl.xml +518 -0
- package/template/fm-addon/ProofKitAuth/preview.png +0 -0
- package/template/fm-addon/ProofKitAuth/pt.xml +518 -0
- package/template/fm-addon/ProofKitAuth/sv.xml +518 -0
- package/template/fm-addon/ProofKitAuth/template.xml +0 -0
- package/template/fm-addon/ProofKitAuth/zh.xml +518 -0
- package/template/fm-addon/ProofKitWV/de.xml +896 -0
- package/template/fm-addon/ProofKitWV/en.xml +896 -0
- package/template/fm-addon/ProofKitWV/es.xml +896 -0
- package/template/fm-addon/ProofKitWV/fr.xml +896 -0
- package/template/fm-addon/ProofKitWV/icon.png +0 -0
- package/template/fm-addon/ProofKitWV/icon@2x.png +0 -0
- package/template/fm-addon/ProofKitWV/info.json +11 -0
- package/template/fm-addon/ProofKitWV/info_de.json +18 -0
- package/template/fm-addon/ProofKitWV/info_en.json +11 -0
- package/template/fm-addon/ProofKitWV/info_es.json +18 -0
- package/template/fm-addon/ProofKitWV/info_fr.json +18 -0
- package/template/fm-addon/ProofKitWV/info_it.json +18 -0
- package/template/fm-addon/ProofKitWV/info_ja.json +18 -0
- package/template/fm-addon/ProofKitWV/info_ko.json +18 -0
- package/template/fm-addon/ProofKitWV/info_nl.json +18 -0
- package/template/fm-addon/ProofKitWV/info_pt.json +18 -0
- package/template/fm-addon/ProofKitWV/info_sv.json +18 -0
- package/template/fm-addon/ProofKitWV/info_zh.json +18 -0
- package/template/fm-addon/ProofKitWV/it.xml +896 -0
- package/template/fm-addon/ProofKitWV/ja.xml +896 -0
- package/template/fm-addon/ProofKitWV/ko.xml +896 -0
- package/template/fm-addon/ProofKitWV/nl.xml +896 -0
- package/template/fm-addon/ProofKitWV/preview.png +0 -0
- package/template/fm-addon/ProofKitWV/pt.xml +896 -0
- package/template/fm-addon/ProofKitWV/records_de.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_en.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_es.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_fr.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_it.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_ja.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_ko.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_nl.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_pt.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_sv.xml +0 -0
- package/template/fm-addon/ProofKitWV/records_zh.xml +0 -0
- package/template/fm-addon/ProofKitWV/sv.xml +896 -0
- package/template/fm-addon/ProofKitWV/template.xml +0 -0
- package/template/fm-addon/ProofKitWV/zh.xml +896 -0
- package/template/nextjs/README.md +27 -0
- package/template/nextjs/_gitignore +37 -0
- package/template/nextjs/next.config.ts +12 -0
- package/template/nextjs/package.json +50 -0
- package/template/nextjs/postcss.config.cjs +14 -0
- package/template/nextjs/proofkit.json +1 -0
- package/template/nextjs/public/favicon.ico +0 -0
- package/template/nextjs/public/proofkit.png +0 -0
- package/template/nextjs/src/app/(main)/layout.tsx +6 -0
- package/template/nextjs/src/app/(main)/page.tsx +90 -0
- package/template/nextjs/src/app/layout.tsx +39 -0
- package/template/nextjs/src/app/navigation.tsx +12 -0
- package/template/nextjs/src/components/AppLogo.tsx +6 -0
- package/template/nextjs/src/components/AppShell/internal/AppShell.tsx +21 -0
- package/template/nextjs/src/components/AppShell/internal/Header.module.css +40 -0
- package/template/nextjs/src/components/AppShell/internal/Header.tsx +34 -0
- package/template/nextjs/src/components/AppShell/internal/HeaderMobileMenu.tsx +27 -0
- package/template/nextjs/src/components/AppShell/internal/HeaderNavLink.tsx +31 -0
- package/template/nextjs/src/components/AppShell/internal/config.ts +1 -0
- package/template/nextjs/src/components/AppShell/slot-header-center.tsx +13 -0
- package/template/nextjs/src/components/AppShell/slot-header-left.tsx +23 -0
- package/template/nextjs/src/components/AppShell/slot-header-mobile-content.tsx +43 -0
- package/template/nextjs/src/components/AppShell/slot-header-right.tsx +26 -0
- package/template/nextjs/src/config/env.ts +13 -0
- package/template/nextjs/src/config/theme/globals.css +1 -0
- package/template/nextjs/src/config/theme/mantine-theme.ts +22 -0
- package/template/nextjs/src/server/safe-action.ts +3 -0
- package/template/nextjs/src/utils/notification-helpers.ts +32 -0
- package/template/nextjs/tsconfig.json +40 -0
- package/template/pages/nextjs/blank/page.tsx +5 -0
- package/template/pages/nextjs/table/page.tsx +17 -0
- package/template/pages/nextjs/table/table.tsx +18 -0
- package/template/pages/nextjs/table-edit/actions.ts +23 -0
- package/template/pages/nextjs/table-edit/page.tsx +28 -0
- package/template/pages/nextjs/table-edit/schema.ts +4 -0
- package/template/pages/nextjs/table-edit/table.tsx +43 -0
- package/template/pages/nextjs/table-infinite/actions.ts +62 -0
- package/template/pages/nextjs/table-infinite/page.tsx +11 -0
- package/template/pages/nextjs/table-infinite/query.ts +44 -0
- package/template/pages/nextjs/table-infinite/table.tsx +107 -0
- package/template/pages/nextjs/table-infinite-edit/actions.ts +84 -0
- package/template/pages/nextjs/table-infinite-edit/page.tsx +23 -0
- package/template/pages/nextjs/table-infinite-edit/query.ts +81 -0
- package/template/pages/nextjs/table-infinite-edit/schema.ts +4 -0
- package/template/pages/nextjs/table-infinite-edit/table.tsx +130 -0
- package/template/pages/vite-wv/blank/index.tsx +0 -0
- package/template/pages/vite-wv/table/index.tsx +34 -0
- package/template/pages/vite-wv/table-edit/index.tsx +72 -0
- package/template/vite-wv/.vscode/settings.json +11 -0
- package/template/vite-wv/_gitignore +18 -0
- package/template/vite-wv/index.html +13 -0
- package/template/vite-wv/package.json +52 -0
- package/template/vite-wv/pnpm-lock.yaml +2294 -0
- package/template/vite-wv/postcss.config.cjs +14 -0
- package/template/vite-wv/proofkit.json +1 -0
- package/template/vite-wv/scripts/launch-fm.sh +3 -0
- package/template/vite-wv/scripts/upload.js +21 -0
- package/template/vite-wv/src/components/AppLogo.tsx +5 -0
- package/template/vite-wv/src/components/full-screen-loader.tsx +9 -0
- package/template/vite-wv/src/config/env.ts +16 -0
- package/template/vite-wv/src/config/theme/globals.css +1 -0
- package/template/vite-wv/src/config/theme/mantine-theme.ts +22 -0
- package/template/vite-wv/src/main.tsx +42 -0
- package/template/vite-wv/src/routeTree.gen.ts +111 -0
- package/template/vite-wv/src/routes/__root.tsx +21 -0
- package/template/vite-wv/src/routes/index.tsx +63 -0
- package/template/vite-wv/src/routes/secondary.tsx +28 -0
- package/template/vite-wv/src/utils/notification-helpers.ts +32 -0
- package/template/vite-wv/tsconfig.json +14 -0
- package/template/vite-wv/vite.config.ts +18 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useClerk, useUser } from "@clerk/nextjs";
|
|
4
|
+
import { Menu } from "@mantine/core";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Shown in the mobile header menu
|
|
10
|
+
*/
|
|
11
|
+
export default function UserMenuMobile() {
|
|
12
|
+
const { isSignedIn, isLoaded, user } = useUser();
|
|
13
|
+
const { signOut, buildSignInUrl } = useClerk();
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
|
|
16
|
+
if (!isLoaded) return null;
|
|
17
|
+
|
|
18
|
+
if (!isSignedIn)
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<Menu.Divider />
|
|
22
|
+
<Menu.Item onClick={() => router.push(buildSignInUrl())}>
|
|
23
|
+
Sign In
|
|
24
|
+
</Menu.Item>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (isSignedIn)
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<Menu.Divider />
|
|
32
|
+
<Menu.Item>{user.primaryEmailAddress?.emailAddress}</Menu.Item>
|
|
33
|
+
<Menu.Item onClick={() => signOut()}>Sign Out</Menu.Item>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useClerk, UserButton, useUser } from "@clerk/nextjs";
|
|
4
|
+
import { Button } from "@mantine/core";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
|
|
7
|
+
export default function UserMenu() {
|
|
8
|
+
const { isSignedIn, isLoaded } = useUser();
|
|
9
|
+
const { buildSignInUrl } = useClerk();
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
|
|
12
|
+
if (!isLoaded) return null;
|
|
13
|
+
|
|
14
|
+
if (!isSignedIn)
|
|
15
|
+
return (
|
|
16
|
+
<Button variant="subtle" onClick={() => router.push(buildSignInUrl())}>
|
|
17
|
+
Sign In
|
|
18
|
+
</Button>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if (isSignedIn) return <UserButton />;
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Session } from "next-auth";
|
|
4
|
+
import { SessionProvider } from "next-auth/react";
|
|
5
|
+
|
|
6
|
+
export function NextAuthProvider({
|
|
7
|
+
children,
|
|
8
|
+
session,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
session: Session | null | undefined;
|
|
12
|
+
}) {
|
|
13
|
+
return <SessionProvider session={session}>{children}</SessionProvider>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Menu } from "@mantine/core";
|
|
4
|
+
import { signIn, signOut, useSession } from "next-auth/react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shown in the mobile header menu
|
|
9
|
+
*/
|
|
10
|
+
export default function UserMenuMobile() {
|
|
11
|
+
const { data: session, status } = useSession();
|
|
12
|
+
|
|
13
|
+
if (status === "loading") return null;
|
|
14
|
+
|
|
15
|
+
if (status === "unauthenticated")
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Menu.Divider />
|
|
19
|
+
<Menu.Item onClick={() => signIn()}>Sign In</Menu.Item>
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
if (status === "authenticated")
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<Menu.Divider />
|
|
27
|
+
<Menu.Item>{session.user.email}</Menu.Item>
|
|
28
|
+
<Menu.Item onClick={() => signOut()}>Sign Out</Menu.Item>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Button, Menu, px } from "@mantine/core";
|
|
4
|
+
import { IconChevronDown } from "@tabler/icons-react";
|
|
5
|
+
import { signIn, signOut, useSession } from "next-auth/react";
|
|
6
|
+
|
|
7
|
+
export default function UserMenu() {
|
|
8
|
+
const { data: session, status } = useSession();
|
|
9
|
+
|
|
10
|
+
if (status === "loading") return null;
|
|
11
|
+
|
|
12
|
+
if (status === "unauthenticated")
|
|
13
|
+
return (
|
|
14
|
+
<Button variant="subtle" onClick={() => signIn()}>
|
|
15
|
+
Sign In
|
|
16
|
+
</Button>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
if (status === "authenticated")
|
|
20
|
+
return (
|
|
21
|
+
<Menu position="bottom-end" withArrow>
|
|
22
|
+
<Menu.Target>
|
|
23
|
+
<Button
|
|
24
|
+
variant="subtle"
|
|
25
|
+
color="gray"
|
|
26
|
+
rightSection={<IconChevronDown size={px("1rem")} />}
|
|
27
|
+
>
|
|
28
|
+
{session?.user?.email}
|
|
29
|
+
</Button>
|
|
30
|
+
</Menu.Target>
|
|
31
|
+
<Menu.Dropdown>
|
|
32
|
+
<Menu.Item onClick={() => signOut()}>Sign Out</Menu.Item>
|
|
33
|
+
</Menu.Dropdown>
|
|
34
|
+
</Menu>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createEnv } from "@t3-oss/env-nextjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
|
|
4
|
+
export const env = createEnv({
|
|
5
|
+
server: {
|
|
6
|
+
NODE_ENV: z
|
|
7
|
+
.enum(["development", "test", "production"])
|
|
8
|
+
.default("development"),
|
|
9
|
+
FM_DATABASE: z.string().endsWith(".fmp12"),
|
|
10
|
+
FM_SERVER: z.string().url(),
|
|
11
|
+
OTTO_API_KEY: z.string().startsWith("dk_"),
|
|
12
|
+
|
|
13
|
+
// Next Auth
|
|
14
|
+
NEXTAUTH_SECRET:
|
|
15
|
+
process.env.NODE_ENV === "production"
|
|
16
|
+
? z.string()
|
|
17
|
+
: z.string().optional(),
|
|
18
|
+
NEXTAUTH_URL: z.preprocess(
|
|
19
|
+
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
|
|
20
|
+
// Since NextAuth.js automatically uses the VERCEL_URL if present.
|
|
21
|
+
(str) => process.env.VERCEL_URL ?? str,
|
|
22
|
+
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
|
|
23
|
+
process.env.VERCEL ? z.string() : z.string().url()
|
|
24
|
+
),
|
|
25
|
+
DISCORD_CLIENT_ID: z.string(),
|
|
26
|
+
DISCORD_CLIENT_SECRET: z.string(),
|
|
27
|
+
},
|
|
28
|
+
client: {},
|
|
29
|
+
// For Next.js >= 13.4.4, you only need to destructure client variables:
|
|
30
|
+
experimental__runtimeEnv: {},
|
|
31
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createEnv } from "@t3-oss/env-nextjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
|
|
4
|
+
export const env = createEnv({
|
|
5
|
+
server: {
|
|
6
|
+
NODE_ENV: z
|
|
7
|
+
.enum(["development", "test", "production"])
|
|
8
|
+
.default("development"),
|
|
9
|
+
FM_DATABASE: z.string().endsWith(".fmp12"),
|
|
10
|
+
FM_SERVER: z.string().url(),
|
|
11
|
+
OTTO_API_KEY: z.string().startsWith("dk_"),
|
|
12
|
+
|
|
13
|
+
// Clerk
|
|
14
|
+
CLERK_SECRET_KEY: z.string().min(1),
|
|
15
|
+
CLERK_WEBHOOK_SECRET: z.string().min(1),
|
|
16
|
+
},
|
|
17
|
+
client: {},
|
|
18
|
+
// For Next.js >= 13.4.4, you only need to destructure client variables:
|
|
19
|
+
experimental__runtimeEnv: {},
|
|
20
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
min-height: 100vh;
|
|
7
|
+
background-image: linear-gradient(to bottom, #2e026d, #15162c);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
width: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: 3rem;
|
|
17
|
+
padding: 4rem 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 640px) {
|
|
21
|
+
.container {
|
|
22
|
+
max-width: 640px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: 768px) {
|
|
27
|
+
.container {
|
|
28
|
+
max-width: 768px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (min-width: 1024px) {
|
|
33
|
+
.container {
|
|
34
|
+
max-width: 1024px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 1280px) {
|
|
39
|
+
.container {
|
|
40
|
+
max-width: 1280px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (min-width: 1536px) {
|
|
45
|
+
.container {
|
|
46
|
+
max-width: 1536px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.title {
|
|
51
|
+
font-size: 3rem;
|
|
52
|
+
line-height: 1;
|
|
53
|
+
font-weight: 800;
|
|
54
|
+
letter-spacing: -0.025em;
|
|
55
|
+
margin: 0;
|
|
56
|
+
color: white;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (min-width: 640px) {
|
|
60
|
+
.title {
|
|
61
|
+
font-size: 5rem;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.pinkSpan {
|
|
66
|
+
color: hsl(280 100% 70%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cardRow {
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
72
|
+
gap: 1rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (min-width: 640px) {
|
|
76
|
+
.cardRow {
|
|
77
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (min-width: 768px) {
|
|
82
|
+
.cardRow {
|
|
83
|
+
gap: 2rem;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card {
|
|
88
|
+
max-width: 20rem;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 1rem;
|
|
92
|
+
padding: 1rem;
|
|
93
|
+
border-radius: 0.75rem;
|
|
94
|
+
color: white;
|
|
95
|
+
background-color: rgb(255 255 255 / 0.1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.card:hover {
|
|
99
|
+
background-color: rgb(255 255 255 / 0.2);
|
|
100
|
+
transition: background-color 150ms cubic-bezier(0.5, 0, 0.2, 1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.cardTitle {
|
|
104
|
+
font-size: 1.5rem;
|
|
105
|
+
line-height: 2rem;
|
|
106
|
+
font-weight: 700;
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.cardText {
|
|
111
|
+
font-size: 1.125rem;
|
|
112
|
+
line-height: 1.75rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.showcaseContainer {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: 0.5rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.showcaseText {
|
|
123
|
+
color: white;
|
|
124
|
+
text-align: center;
|
|
125
|
+
font-size: 1.5rem;
|
|
126
|
+
line-height: 2rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.authContainer {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
gap: 1rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.loginButton {
|
|
138
|
+
border-radius: 9999px;
|
|
139
|
+
background-color: rgb(255 255 255 / 0.1);
|
|
140
|
+
padding: 0.75rem 2.5rem;
|
|
141
|
+
font-weight: 600;
|
|
142
|
+
color: white;
|
|
143
|
+
text-decoration-line: none;
|
|
144
|
+
transition: background-color 150ms cubic-bezier(0.5, 0, 0.2, 1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.loginButton:hover {
|
|
148
|
+
background-color: rgb(255 255 255 / 0.2);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.form {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: 0.5rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.input {
|
|
158
|
+
width: 100%;
|
|
159
|
+
border-radius: 9999px;
|
|
160
|
+
padding: 0.5rem 1rem;
|
|
161
|
+
color: black;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.submitButton {
|
|
165
|
+
all: unset;
|
|
166
|
+
border-radius: 9999px;
|
|
167
|
+
background-color: rgb(255 255 255 / 0.1);
|
|
168
|
+
padding: 0.75rem 2.5rem;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
color: white;
|
|
171
|
+
text-align: center;
|
|
172
|
+
transition: background-color 150ms cubic-bezier(0.5, 0, 0.2, 1);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.submitButton:hover {
|
|
176
|
+
background-color: rgb(255 255 255 / 0.2);
|
|
177
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
|
|
2
|
+
|
|
3
|
+
// these default settings will require authentication for all routes except the ones in the array
|
|
4
|
+
// to restrict public access to the home page, remove "/" from the array
|
|
5
|
+
const isPublicRoute = createRouteMatcher(["/auth/(.*)", "/"]);
|
|
6
|
+
|
|
7
|
+
export default clerkMiddleware(async (auth, request) => {
|
|
8
|
+
if (!isPublicRoute(request)) {
|
|
9
|
+
await auth.protect();
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const config = {
|
|
14
|
+
matcher: [
|
|
15
|
+
// Skip Next.js internals and all static files, unless found in search params
|
|
16
|
+
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
|
|
17
|
+
// Always run for API routes
|
|
18
|
+
"/(api|trpc)(.*)",
|
|
19
|
+
],
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type AppType } from "next/dist/shared/lib/utils";
|
|
3
|
+
|
|
4
|
+
import "~/styles/globals.css";
|
|
5
|
+
|
|
6
|
+
const MyApp: AppType = ({ Component, pageProps }) => {
|
|
7
|
+
return (
|
|
8
|
+
<div className={GeistSans.className}>
|
|
9
|
+
<Component {...pageProps} />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default MyApp;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type Session } from "next-auth";
|
|
3
|
+
import { SessionProvider } from "next-auth/react";
|
|
4
|
+
import { type AppType } from "next/app";
|
|
5
|
+
|
|
6
|
+
import { api } from "~/utils/api";
|
|
7
|
+
|
|
8
|
+
import "~/styles/globals.css";
|
|
9
|
+
|
|
10
|
+
const MyApp: AppType<{ session: Session | null }> = ({
|
|
11
|
+
Component,
|
|
12
|
+
pageProps: { session, ...pageProps },
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<SessionProvider session={session}>
|
|
16
|
+
<div className={GeistSans.className}>
|
|
17
|
+
<Component {...pageProps} />
|
|
18
|
+
</div>
|
|
19
|
+
</SessionProvider>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default api.withTRPC(MyApp);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type Session } from "next-auth";
|
|
3
|
+
import { SessionProvider } from "next-auth/react";
|
|
4
|
+
import { type AppType } from "next/app";
|
|
5
|
+
|
|
6
|
+
import { api } from "~/utils/api";
|
|
7
|
+
|
|
8
|
+
import "~/styles/globals.css";
|
|
9
|
+
|
|
10
|
+
const MyApp: AppType<{ session: Session | null }> = ({
|
|
11
|
+
Component,
|
|
12
|
+
pageProps: { session, ...pageProps },
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<SessionProvider session={session}>
|
|
16
|
+
<div className={GeistSans.className}>
|
|
17
|
+
<Component {...pageProps} />
|
|
18
|
+
</div>
|
|
19
|
+
</SessionProvider>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default api.withTRPC(MyApp);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type Session } from "next-auth";
|
|
3
|
+
import { SessionProvider } from "next-auth/react";
|
|
4
|
+
import { type AppType } from "next/app";
|
|
5
|
+
|
|
6
|
+
import "~/styles/globals.css";
|
|
7
|
+
|
|
8
|
+
const MyApp: AppType<{ session: Session | null }> = ({
|
|
9
|
+
Component,
|
|
10
|
+
pageProps: { session, ...pageProps },
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<SessionProvider session={session}>
|
|
14
|
+
<div className={GeistSans.className}>
|
|
15
|
+
<Component {...pageProps} />
|
|
16
|
+
</div>
|
|
17
|
+
</SessionProvider>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default MyApp;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type Session } from "next-auth";
|
|
3
|
+
import { SessionProvider } from "next-auth/react";
|
|
4
|
+
import { type AppType } from "next/app";
|
|
5
|
+
|
|
6
|
+
import "~/styles/globals.css";
|
|
7
|
+
|
|
8
|
+
const MyApp: AppType<{ session: Session | null }> = ({
|
|
9
|
+
Component,
|
|
10
|
+
pageProps: { session, ...pageProps },
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<SessionProvider session={session}>
|
|
14
|
+
<div className={GeistSans.className}>
|
|
15
|
+
<Component {...pageProps} />
|
|
16
|
+
</div>
|
|
17
|
+
</SessionProvider>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default MyApp;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type AppType } from "next/app";
|
|
3
|
+
|
|
4
|
+
import { api } from "~/utils/api";
|
|
5
|
+
|
|
6
|
+
import "~/styles/globals.css";
|
|
7
|
+
|
|
8
|
+
const MyApp: AppType = ({ Component, pageProps }) => {
|
|
9
|
+
return (
|
|
10
|
+
<div className={GeistSans.className}>
|
|
11
|
+
<Component {...pageProps} />
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default api.withTRPC(MyApp);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type AppType } from "next/app";
|
|
3
|
+
|
|
4
|
+
import { api } from "~/utils/api";
|
|
5
|
+
|
|
6
|
+
import "~/styles/globals.css";
|
|
7
|
+
|
|
8
|
+
const MyApp: AppType = ({ Component, pageProps }) => {
|
|
9
|
+
return (
|
|
10
|
+
<div className={GeistSans.className}>
|
|
11
|
+
<Component {...pageProps} />
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default api.withTRPC(MyApp);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GeistSans } from "geist/font/sans";
|
|
2
|
+
import { type AppType } from "next/app";
|
|
3
|
+
|
|
4
|
+
import "~/styles/globals.css";
|
|
5
|
+
|
|
6
|
+
const MyApp: AppType = ({ Component, pageProps }) => {
|
|
7
|
+
return (
|
|
8
|
+
<div className={GeistSans.className}>
|
|
9
|
+
<Component {...pageProps} />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default MyApp;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createNextApiHandler } from "@trpc/server/adapters/next";
|
|
2
|
+
|
|
3
|
+
import { env } from "~/env";
|
|
4
|
+
import { appRouter } from "~/server/api/root";
|
|
5
|
+
import { createTRPCContext } from "~/server/api/trpc";
|
|
6
|
+
|
|
7
|
+
// export API handler
|
|
8
|
+
export default createNextApiHandler({
|
|
9
|
+
router: appRouter,
|
|
10
|
+
createContext: createTRPCContext,
|
|
11
|
+
onError:
|
|
12
|
+
env.NODE_ENV === "development"
|
|
13
|
+
? ({ path, error }) => {
|
|
14
|
+
console.error(
|
|
15
|
+
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
: undefined,
|
|
19
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Head from "next/head";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
|
|
4
|
+
import styles from "./index.module.css";
|
|
5
|
+
|
|
6
|
+
export default function Home() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Head>
|
|
10
|
+
<title>Create T3 App</title>
|
|
11
|
+
<meta name="description" content="Generated by proofkit" />
|
|
12
|
+
<link rel="icon" href="/favicon.ico" />
|
|
13
|
+
</Head>
|
|
14
|
+
<main className={styles.main}>
|
|
15
|
+
<div className={styles.container}>
|
|
16
|
+
<h1 className={styles.title}>
|
|
17
|
+
Create <span className={styles.pinkSpan}>T3</span> App
|
|
18
|
+
</h1>
|
|
19
|
+
<div className={styles.cardRow}>
|
|
20
|
+
<Link
|
|
21
|
+
className={styles.card}
|
|
22
|
+
href="https://create.t3.gg/en/usage/first-steps"
|
|
23
|
+
target="_blank"
|
|
24
|
+
>
|
|
25
|
+
<h3 className={styles.cardTitle}>First Steps →</h3>
|
|
26
|
+
<div className={styles.cardText}>
|
|
27
|
+
Just the basics - Everything you need to know to set up your
|
|
28
|
+
database and authentication.
|
|
29
|
+
</div>
|
|
30
|
+
</Link>
|
|
31
|
+
<Link
|
|
32
|
+
className={styles.card}
|
|
33
|
+
href="https://create.t3.gg/en/introduction"
|
|
34
|
+
target="_blank"
|
|
35
|
+
>
|
|
36
|
+
<h3 className={styles.cardTitle}>Documentation →</h3>
|
|
37
|
+
<div className={styles.cardText}>
|
|
38
|
+
Learn more about Create T3 App, the libraries it uses, and how
|
|
39
|
+
to deploy it.
|
|
40
|
+
</div>
|
|
41
|
+
</Link>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</main>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
}
|