@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,34 @@
|
|
|
1
|
+
import { ColorSchemeScript, MantineProvider } from "@mantine/core";
|
|
2
|
+
import { ModalsProvider } from "@mantine/modals";
|
|
3
|
+
import { Notifications } from "@mantine/notifications";
|
|
4
|
+
|
|
5
|
+
import "@mantine/core/styles.css";
|
|
6
|
+
import "@mantine/notifications/styles.css";
|
|
7
|
+
import "@mantine/dates/styles.css";
|
|
8
|
+
import "mantine-react-table/styles.css";
|
|
9
|
+
|
|
10
|
+
import { type Metadata } from "next";
|
|
11
|
+
|
|
12
|
+
export const metadata: Metadata = {
|
|
13
|
+
title: "My ProofKit App",
|
|
14
|
+
description: "Generated by proofkit",
|
|
15
|
+
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function RootLayout({
|
|
19
|
+
children,
|
|
20
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
21
|
+
return (
|
|
22
|
+
<html lang="en">
|
|
23
|
+
<head>
|
|
24
|
+
<ColorSchemeScript defaultColorScheme="auto" />
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<MantineProvider defaultColorScheme="auto">
|
|
28
|
+
<Notifications />
|
|
29
|
+
<ModalsProvider>{children}</ModalsProvider>
|
|
30
|
+
</MantineProvider>
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppShell,
|
|
3
|
+
AppShellFooter,
|
|
4
|
+
AppShellHeader,
|
|
5
|
+
AppShellMain,
|
|
6
|
+
AppShellNavbar,
|
|
7
|
+
} from "@mantine/core";
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
/** Layout configuration Edit these values to change the layout */
|
|
11
|
+
export const showHeader = false;
|
|
12
|
+
export const showFooter = false;
|
|
13
|
+
export const showLeftNavbar = false;
|
|
14
|
+
|
|
15
|
+
export const headerHeight = 60;
|
|
16
|
+
export const footerHeight = 60;
|
|
17
|
+
export const leftNavbarWidth = 200;
|
|
18
|
+
|
|
19
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
20
|
+
return (
|
|
21
|
+
<AppShell
|
|
22
|
+
header={showHeader ? { height: headerHeight } : undefined}
|
|
23
|
+
footer={showFooter ? { height: footerHeight } : undefined}
|
|
24
|
+
navbar={
|
|
25
|
+
showLeftNavbar
|
|
26
|
+
? { width: leftNavbarWidth, breakpoint: "sm" }
|
|
27
|
+
: undefined
|
|
28
|
+
}
|
|
29
|
+
padding="md"
|
|
30
|
+
>
|
|
31
|
+
{showHeader && <AppShellHeader>Header</AppShellHeader>}
|
|
32
|
+
{showLeftNavbar && <AppShellNavbar>Left Navbar</AppShellNavbar>}
|
|
33
|
+
<AppShellMain>{children}</AppShellMain>
|
|
34
|
+
{showFooter && <AppShellFooter>Footer</AppShellFooter>}
|
|
35
|
+
</AppShell>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "~/styles/globals.css";
|
|
2
|
+
|
|
3
|
+
import { GeistSans } from "geist/font/sans";
|
|
4
|
+
import { type Metadata } from "next";
|
|
5
|
+
|
|
6
|
+
import { TRPCReactProvider } from "~/trpc/react";
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Create T3 App",
|
|
10
|
+
description: "Generated by proofkit",
|
|
11
|
+
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function RootLayout({
|
|
15
|
+
children,
|
|
16
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
17
|
+
return (
|
|
18
|
+
<html lang="en" className={`${GeistSans.variable}`}>
|
|
19
|
+
<body>
|
|
20
|
+
<TRPCReactProvider>{children}</TRPCReactProvider>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "~/styles/globals.css";
|
|
2
|
+
|
|
3
|
+
import { GeistSans } from "geist/font/sans";
|
|
4
|
+
import { type Metadata } from "next";
|
|
5
|
+
|
|
6
|
+
import { TRPCReactProvider } from "~/trpc/react";
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Create T3 App",
|
|
10
|
+
description: "Generated by proofkit",
|
|
11
|
+
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function RootLayout({
|
|
15
|
+
children,
|
|
16
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
17
|
+
return (
|
|
18
|
+
<html lang="en">
|
|
19
|
+
<body className={GeistSans.className}>
|
|
20
|
+
<TRPCReactProvider>{children}</TRPCReactProvider>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "~/styles/globals.css";
|
|
2
|
+
|
|
3
|
+
import { GeistSans } from "geist/font/sans";
|
|
4
|
+
import { type Metadata } from "next";
|
|
5
|
+
|
|
6
|
+
export const metadata: Metadata = {
|
|
7
|
+
title: "Create T3 App",
|
|
8
|
+
description: "Generated by proofkit",
|
|
9
|
+
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function RootLayout({
|
|
13
|
+
children,
|
|
14
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
15
|
+
return (
|
|
16
|
+
<html lang="en" className={`${GeistSans.variable}`}>
|
|
17
|
+
<body>{children}</body>
|
|
18
|
+
</html>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { auth } from "@/server/auth";
|
|
2
|
+
import { Card, Center } from "@mantine/core";
|
|
3
|
+
import { redirect } from "next/navigation";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
export default async function Layout({
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) {
|
|
11
|
+
const session = await auth();
|
|
12
|
+
if (session) {
|
|
13
|
+
return redirect("/");
|
|
14
|
+
}
|
|
15
|
+
return (
|
|
16
|
+
<Center h="100vh">
|
|
17
|
+
<Card withBorder radius="md" shadow="sm" w={"20rem"}>
|
|
18
|
+
{children}
|
|
19
|
+
</Card>
|
|
20
|
+
</Center>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { providerMap, signIn } from "@/server/auth";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
Divider,
|
|
6
|
+
PasswordInput,
|
|
7
|
+
Stack,
|
|
8
|
+
Text,
|
|
9
|
+
TextInput,
|
|
10
|
+
} from "@mantine/core";
|
|
11
|
+
import { AuthError } from "next-auth";
|
|
12
|
+
import Link from "next/link";
|
|
13
|
+
import { redirect } from "next/navigation";
|
|
14
|
+
|
|
15
|
+
export default async function SignInPage(props: {
|
|
16
|
+
searchParams: Promise<{ callbackUrl: string | undefined }>;
|
|
17
|
+
}) {
|
|
18
|
+
const searchParams = await props.searchParams;
|
|
19
|
+
return (
|
|
20
|
+
<Stack>
|
|
21
|
+
<form
|
|
22
|
+
action={async (formData) => {
|
|
23
|
+
"use server";
|
|
24
|
+
try {
|
|
25
|
+
await signIn("credentials", formData);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error instanceof AuthError) {
|
|
28
|
+
return redirect(`/auth/signin?error=${error.type}`);
|
|
29
|
+
}
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<Stack>
|
|
35
|
+
<TextInput type="email" name="email" id="email" label="Email" />
|
|
36
|
+
<PasswordInput name="password" id="password" label="Password" />
|
|
37
|
+
|
|
38
|
+
<Button type="submit">Sign in</Button>
|
|
39
|
+
</Stack>
|
|
40
|
+
</form>
|
|
41
|
+
{providerMap.length > 0 && (
|
|
42
|
+
<>
|
|
43
|
+
<Divider label="Or" />
|
|
44
|
+
{Object.values(providerMap).map((provider) => (
|
|
45
|
+
<form
|
|
46
|
+
key={provider.id}
|
|
47
|
+
action={async () => {
|
|
48
|
+
"use server";
|
|
49
|
+
try {
|
|
50
|
+
await signIn(provider.id, {
|
|
51
|
+
redirectTo: searchParams.callbackUrl ?? "",
|
|
52
|
+
});
|
|
53
|
+
} catch (error) {
|
|
54
|
+
// Signin can fail for a number of reasons, such as the user
|
|
55
|
+
// not existing, or the user not having the correct role.
|
|
56
|
+
// In some cases, you may want to redirect to a custom error
|
|
57
|
+
if (error instanceof AuthError) {
|
|
58
|
+
return redirect(`/auth/signin?error=${error.type}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Otherwise if a redirects happens Next.js can handle it
|
|
62
|
+
// so you can just re-thrown the error and let Next.js handle it.
|
|
63
|
+
// Docs:
|
|
64
|
+
// https://nextjs.org/docs/app/api-reference/functions/redirect#server-component
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<Button type="submit" variant="white">
|
|
70
|
+
<span>Sign in with {provider.name}</span>
|
|
71
|
+
</Button>
|
|
72
|
+
</form>
|
|
73
|
+
))}
|
|
74
|
+
</>
|
|
75
|
+
)}
|
|
76
|
+
|
|
77
|
+
<Text size="sm" c="dimmed">
|
|
78
|
+
{"Don't have an account? "}<Link href="/auth/signup">Sign up</Link>
|
|
79
|
+
</Text>
|
|
80
|
+
</Stack>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { signIn } from "@/server/auth";
|
|
4
|
+
import { userSignUp } from "@/server/data/users";
|
|
5
|
+
import { actionClient } from "@/server/safe-action";
|
|
6
|
+
|
|
7
|
+
import { signUpSchema } from "./validation";
|
|
8
|
+
|
|
9
|
+
export const signUpAction = actionClient
|
|
10
|
+
.schema(signUpSchema)
|
|
11
|
+
.action(async ({ parsedInput, ctx }) => {
|
|
12
|
+
const { email, password } = parsedInput;
|
|
13
|
+
|
|
14
|
+
await userSignUp({ email, password });
|
|
15
|
+
|
|
16
|
+
await signIn("credentials", {
|
|
17
|
+
email,
|
|
18
|
+
password,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
success: true,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
+
import { Button, PasswordInput, Stack, Text, TextInput } from "@mantine/core";
|
|
5
|
+
import { useHookFormAction } from "@next-safe-action/adapter-react-hook-form/hooks";
|
|
6
|
+
import Link from "next/link";
|
|
7
|
+
import React from "react";
|
|
8
|
+
|
|
9
|
+
import { signUpAction } from "./action";
|
|
10
|
+
import { signUpSchema } from "./validation";
|
|
11
|
+
|
|
12
|
+
export default function SignUpPage(props: {
|
|
13
|
+
searchParams: Promise<{ callbackUrl: string | undefined }>;
|
|
14
|
+
}) {
|
|
15
|
+
const { form, action, handleSubmitWithAction, resetFormAndAction } =
|
|
16
|
+
useHookFormAction(signUpAction, zodResolver(signUpSchema), {
|
|
17
|
+
actionProps: {},
|
|
18
|
+
formProps: {},
|
|
19
|
+
errorMapProps: {},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Stack>
|
|
24
|
+
<form onSubmit={handleSubmitWithAction}>
|
|
25
|
+
<Stack>
|
|
26
|
+
<TextInput type="email" {...form.register("email")} label="Email" />
|
|
27
|
+
<PasswordInput {...form.register("password")} label="Password" />
|
|
28
|
+
<PasswordInput
|
|
29
|
+
{...form.register("passwordConfirm")}
|
|
30
|
+
label="Confirm Password"
|
|
31
|
+
/>
|
|
32
|
+
<Button type="submit">Sign up</Button>
|
|
33
|
+
</Stack>
|
|
34
|
+
</form>
|
|
35
|
+
<Text size="sm" c="dimmed">
|
|
36
|
+
Already have an account? <Link href="/auth/signin">Sign in</Link>
|
|
37
|
+
</Text>
|
|
38
|
+
</Stack>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
|
|
3
|
+
export const signUpSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
email: z.string().email(),
|
|
6
|
+
password: z.string(),
|
|
7
|
+
passwordConfirm: z.string(),
|
|
8
|
+
})
|
|
9
|
+
.refine((data) => data.password === data.passwordConfirm, {
|
|
10
|
+
message: "Passwords don't match",
|
|
11
|
+
path: ["passwordConfirm"],
|
|
12
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
import { LatestPost } from "~/app/_components/post";
|
|
4
|
+
import { getServerAuthSession } from "~/server/auth";
|
|
5
|
+
import { api, HydrateClient } from "~/trpc/server";
|
|
6
|
+
|
|
7
|
+
export default async function Home() {
|
|
8
|
+
const hello = await api.post.hello({ text: "from tRPC" });
|
|
9
|
+
const session = await getServerAuthSession();
|
|
10
|
+
|
|
11
|
+
void api.post.getLatest.prefetch();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<HydrateClient>
|
|
15
|
+
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
|
|
16
|
+
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
|
|
17
|
+
<h1 className="text-5xl font-extrabold tracking-tight sm:text-[5rem]">
|
|
18
|
+
Create <span className="text-[hsl(280,100%,70%)]">T3</span> App
|
|
19
|
+
</h1>
|
|
20
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">
|
|
21
|
+
<Link
|
|
22
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 hover:bg-white/20"
|
|
23
|
+
href="https://create.t3.gg/en/usage/first-steps"
|
|
24
|
+
target="_blank"
|
|
25
|
+
>
|
|
26
|
+
<h3 className="text-2xl font-bold">First Steps →</h3>
|
|
27
|
+
<div className="text-lg">
|
|
28
|
+
Just the basics - Everything you need to know to set up your
|
|
29
|
+
database and authentication.
|
|
30
|
+
</div>
|
|
31
|
+
</Link>
|
|
32
|
+
<Link
|
|
33
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 hover:bg-white/20"
|
|
34
|
+
href="https://create.t3.gg/en/introduction"
|
|
35
|
+
target="_blank"
|
|
36
|
+
>
|
|
37
|
+
<h3 className="text-2xl font-bold">Documentation →</h3>
|
|
38
|
+
<div className="text-lg">
|
|
39
|
+
Learn more about Create T3 App, the libraries it uses, and how
|
|
40
|
+
to deploy it.
|
|
41
|
+
</div>
|
|
42
|
+
</Link>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="flex flex-col items-center gap-2">
|
|
45
|
+
<p className="text-2xl text-white">
|
|
46
|
+
{hello ? hello.greeting : "Loading tRPC query..."}
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
<div className="flex flex-col items-center justify-center gap-4">
|
|
50
|
+
<p className="text-center text-2xl text-white">
|
|
51
|
+
{session && <span>Logged in as {session.user?.name}</span>}
|
|
52
|
+
</p>
|
|
53
|
+
<Link
|
|
54
|
+
href={session ? "/api/auth/signout" : "/api/auth/signin"}
|
|
55
|
+
className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20"
|
|
56
|
+
>
|
|
57
|
+
{session ? "Sign out" : "Sign in"}
|
|
58
|
+
</Link>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{session?.user && <LatestPost />}
|
|
63
|
+
</div>
|
|
64
|
+
</main>
|
|
65
|
+
</HydrateClient>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
import { LatestPost } from "~/app/_components/post";
|
|
4
|
+
import { getServerAuthSession } from "~/server/auth";
|
|
5
|
+
import { api, HydrateClient } from "~/trpc/server";
|
|
6
|
+
import styles from "./index.module.css";
|
|
7
|
+
|
|
8
|
+
export default async function Home() {
|
|
9
|
+
const hello = await api.post.hello({ text: "from tRPC" });
|
|
10
|
+
const session = await getServerAuthSession();
|
|
11
|
+
|
|
12
|
+
void api.post.getLatest.prefetch();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<HydrateClient>
|
|
16
|
+
<main className={styles.main}>
|
|
17
|
+
<div className={styles.container}>
|
|
18
|
+
<h1 className={styles.title}>
|
|
19
|
+
Create <span className={styles.pinkSpan}>T3</span> App
|
|
20
|
+
</h1>
|
|
21
|
+
<div className={styles.cardRow}>
|
|
22
|
+
<Link
|
|
23
|
+
className={styles.card}
|
|
24
|
+
href="https://create.t3.gg/en/usage/first-steps"
|
|
25
|
+
target="_blank"
|
|
26
|
+
>
|
|
27
|
+
<h3 className={styles.cardTitle}>First Steps →</h3>
|
|
28
|
+
<div className={styles.cardText}>
|
|
29
|
+
Just the basics - Everything you need to know to set up your
|
|
30
|
+
database and authentication.
|
|
31
|
+
</div>
|
|
32
|
+
</Link>
|
|
33
|
+
<Link
|
|
34
|
+
className={styles.card}
|
|
35
|
+
href="https://create.t3.gg/en/introduction"
|
|
36
|
+
target="_blank"
|
|
37
|
+
>
|
|
38
|
+
<h3 className={styles.cardTitle}>Documentation →</h3>
|
|
39
|
+
<div className={styles.cardText}>
|
|
40
|
+
Learn more about Create T3 App, the libraries it uses, and how
|
|
41
|
+
to deploy it.
|
|
42
|
+
</div>
|
|
43
|
+
</Link>
|
|
44
|
+
</div>
|
|
45
|
+
<div className={styles.showcaseContainer}>
|
|
46
|
+
<p className={styles.showcaseText}>
|
|
47
|
+
{hello ? hello.greeting : "Loading tRPC query..."}
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
<div className={styles.authContainer}>
|
|
51
|
+
<p className={styles.showcaseText}>
|
|
52
|
+
{session && <span>Logged in as {session.user?.name}</span>}
|
|
53
|
+
</p>
|
|
54
|
+
<Link
|
|
55
|
+
href={session ? "/api/auth/signout" : "/api/auth/signin"}
|
|
56
|
+
className={styles.loginButton}
|
|
57
|
+
>
|
|
58
|
+
{session ? "Sign out" : "Sign in"}
|
|
59
|
+
</Link>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
{session?.user && <LatestPost />}
|
|
64
|
+
</div>
|
|
65
|
+
</main>
|
|
66
|
+
</HydrateClient>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
import { LatestPost } from "~/app/_components/post";
|
|
4
|
+
import { api, HydrateClient } from "~/trpc/server";
|
|
5
|
+
|
|
6
|
+
export default async function Home() {
|
|
7
|
+
const hello = await api.post.hello({ text: "from tRPC" });
|
|
8
|
+
|
|
9
|
+
void api.post.getLatest.prefetch();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<HydrateClient>
|
|
13
|
+
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
|
|
14
|
+
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
|
|
15
|
+
<h1 className="text-5xl font-extrabold tracking-tight sm:text-[5rem]">
|
|
16
|
+
Create <span className="text-[hsl(280,100%,70%)]">T3</span> App
|
|
17
|
+
</h1>
|
|
18
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">
|
|
19
|
+
<Link
|
|
20
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 hover:bg-white/20"
|
|
21
|
+
href="https://create.t3.gg/en/usage/first-steps"
|
|
22
|
+
target="_blank"
|
|
23
|
+
>
|
|
24
|
+
<h3 className="text-2xl font-bold">First Steps →</h3>
|
|
25
|
+
<div className="text-lg">
|
|
26
|
+
Just the basics - Everything you need to know to set up your
|
|
27
|
+
database and authentication.
|
|
28
|
+
</div>
|
|
29
|
+
</Link>
|
|
30
|
+
<Link
|
|
31
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 hover:bg-white/20"
|
|
32
|
+
href="https://create.t3.gg/en/introduction"
|
|
33
|
+
target="_blank"
|
|
34
|
+
>
|
|
35
|
+
<h3 className="text-2xl font-bold">Documentation →</h3>
|
|
36
|
+
<div className="text-lg">
|
|
37
|
+
Learn more about Create T3 App, the libraries it uses, and how
|
|
38
|
+
to deploy it.
|
|
39
|
+
</div>
|
|
40
|
+
</Link>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="flex flex-col items-center gap-2">
|
|
43
|
+
<p className="text-2xl text-white">
|
|
44
|
+
{hello ? hello.greeting : "Loading tRPC query..."}
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<LatestPost />
|
|
49
|
+
</div>
|
|
50
|
+
</main>
|
|
51
|
+
</HydrateClient>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
import { LatestPost } from "~/app/_components/post";
|
|
4
|
+
import { api, HydrateClient } from "~/trpc/server";
|
|
5
|
+
import styles from "./index.module.css";
|
|
6
|
+
|
|
7
|
+
export default async function Home() {
|
|
8
|
+
const hello = await api.post.hello({ text: "from tRPC" });
|
|
9
|
+
|
|
10
|
+
void api.post.getLatest.prefetch();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<HydrateClient>
|
|
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 className={styles.showcaseContainer}>
|
|
44
|
+
<p className={styles.showcaseText}>
|
|
45
|
+
{hello ? hello.greeting : "Loading tRPC query..."}
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<LatestPost />
|
|
50
|
+
</div>
|
|
51
|
+
</main>
|
|
52
|
+
</HydrateClient>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
export default function HomePage() {
|
|
4
|
+
return (
|
|
5
|
+
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
|
|
6
|
+
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
|
|
7
|
+
<h1 className="text-5xl font-extrabold tracking-tight text-white sm:text-[5rem]">
|
|
8
|
+
Create <span className="text-[hsl(280,100%,70%)]">T3</span> App
|
|
9
|
+
</h1>
|
|
10
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">
|
|
11
|
+
<Link
|
|
12
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"
|
|
13
|
+
href="https://create.t3.gg/en/usage/first-steps"
|
|
14
|
+
target="_blank"
|
|
15
|
+
>
|
|
16
|
+
<h3 className="text-2xl font-bold">First Steps →</h3>
|
|
17
|
+
<div className="text-lg">
|
|
18
|
+
Just the basics - Everything you need to know to set up your
|
|
19
|
+
database and authentication.
|
|
20
|
+
</div>
|
|
21
|
+
</Link>
|
|
22
|
+
<Link
|
|
23
|
+
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"
|
|
24
|
+
href="https://create.t3.gg/en/introduction"
|
|
25
|
+
target="_blank"
|
|
26
|
+
>
|
|
27
|
+
<h3 className="text-2xl font-bold">Documentation →</h3>
|
|
28
|
+
<div className="text-lg">
|
|
29
|
+
Learn more about Create T3 App, the libraries it uses, and how to
|
|
30
|
+
deploy it.
|
|
31
|
+
</div>
|
|
32
|
+
</Link>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</main>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ClerkProvider } from "@clerk/nextjs";
|
|
4
|
+
import { dark } from "@clerk/themes";
|
|
5
|
+
import { useComputedColorScheme } from "@mantine/core";
|
|
6
|
+
|
|
7
|
+
export function ClerkAuthProvider({ children }: { children: React.ReactNode }) {
|
|
8
|
+
const computedColorScheme = useComputedColorScheme();
|
|
9
|
+
return (
|
|
10
|
+
<ClerkProvider
|
|
11
|
+
appearance={{
|
|
12
|
+
baseTheme: computedColorScheme === "dark" ? dark : undefined,
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</ClerkProvider>
|
|
17
|
+
);
|
|
18
|
+
}
|