create-huenei-template 0.2.13 → 0.2.15
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/dist/config/templates.js +7 -0
- package/dist/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
- package/dist/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
- package/dist/templates/frontend/react-ssr/.env.example +9 -0
- package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
- package/dist/templates/frontend/react-ssr/README.md +121 -0
- package/dist/templates/frontend/react-ssr/components.json +22 -0
- package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
- package/dist/templates/frontend/react-ssr/package.json +86 -0
- package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
- package/package.json +1 -1
- package/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
- package/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.dockerignore +14 -0
- package/templates/frontend/react-ssr/.env.example +9 -0
- package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/templates/frontend/react-ssr/Dockerfile +41 -0
- package/templates/frontend/react-ssr/README.md +121 -0
- package/templates/frontend/react-ssr/components.json +22 -0
- package/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/templates/frontend/react-ssr/next.config.ts +7 -0
- package/templates/frontend/react-ssr/package.json +86 -0
- package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/templates/frontend/react-ssr/vitest.config.ts +41 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# prisma db seed
|
|
2
|
+
|
|
3
|
+
Runs your database seed script to populate data.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma db seed [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
- Executes your configured seed script
|
|
14
|
+
- Populates database with initial/test data
|
|
15
|
+
- Runs independently (not auto-run by migrations in v7)
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| Option | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `--config` | Custom path to your Prisma config file |
|
|
22
|
+
| `--` | Pass custom arguments to seed script |
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
Configure seed script in `prisma.config.ts`:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import 'dotenv/config'
|
|
30
|
+
import { defineConfig, env } from 'prisma/config'
|
|
31
|
+
|
|
32
|
+
export default defineConfig({
|
|
33
|
+
schema: 'prisma/schema.prisma',
|
|
34
|
+
migrations: {
|
|
35
|
+
path: 'prisma/migrations',
|
|
36
|
+
seed: 'tsx prisma/seed.ts', // Your seed command
|
|
37
|
+
},
|
|
38
|
+
datasource: {
|
|
39
|
+
url: env('DATABASE_URL'),
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Common seed commands
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// TypeScript with tsx
|
|
48
|
+
seed: 'tsx prisma/seed.ts'
|
|
49
|
+
|
|
50
|
+
// TypeScript with ts-node
|
|
51
|
+
seed: 'ts-node prisma/seed.ts'
|
|
52
|
+
|
|
53
|
+
// JavaScript
|
|
54
|
+
seed: 'node prisma/seed.js'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Seed Script Example
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// prisma/seed.ts
|
|
61
|
+
import { PrismaClient } from '../generated/client'
|
|
62
|
+
|
|
63
|
+
const prisma = new PrismaClient()
|
|
64
|
+
|
|
65
|
+
async function main() {
|
|
66
|
+
// Create users
|
|
67
|
+
const alice = await prisma.user.upsert({
|
|
68
|
+
where: { email: 'alice@prisma.io' },
|
|
69
|
+
update: {},
|
|
70
|
+
create: {
|
|
71
|
+
email: 'alice@prisma.io',
|
|
72
|
+
name: 'Alice',
|
|
73
|
+
posts: {
|
|
74
|
+
create: {
|
|
75
|
+
title: 'Hello World',
|
|
76
|
+
published: true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const bob = await prisma.user.upsert({
|
|
83
|
+
where: { email: 'bob@prisma.io' },
|
|
84
|
+
update: {},
|
|
85
|
+
create: {
|
|
86
|
+
email: 'bob@prisma.io',
|
|
87
|
+
name: 'Bob',
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
console.log({ alice, bob })
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
main()
|
|
95
|
+
.then(async () => {
|
|
96
|
+
await prisma.$disconnect()
|
|
97
|
+
})
|
|
98
|
+
.catch(async (e) => {
|
|
99
|
+
console.error(e)
|
|
100
|
+
await prisma.$disconnect()
|
|
101
|
+
process.exit(1)
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
### Run seed
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
prisma db seed
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### With custom arguments
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
prisma db seed -- --environment development
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Arguments after `--` are passed to your seed script.
|
|
120
|
+
|
|
121
|
+
## v7 Changes
|
|
122
|
+
|
|
123
|
+
In Prisma 7, seeding is NOT automatic after migrations:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# v7 workflow
|
|
127
|
+
prisma migrate dev --name init
|
|
128
|
+
prisma generate
|
|
129
|
+
prisma db seed # Must run explicitly
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Previously (v6), `migrate dev` and `migrate reset` auto-ran seeds.
|
|
133
|
+
|
|
134
|
+
## Idempotent Seeding
|
|
135
|
+
|
|
136
|
+
Use `upsert` to make seeds re-runnable:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// Good: Can run multiple times
|
|
140
|
+
await prisma.user.upsert({
|
|
141
|
+
where: { email: 'alice@prisma.io' },
|
|
142
|
+
update: {}, // Don't change existing
|
|
143
|
+
create: { email: 'alice@prisma.io', name: 'Alice' },
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// Bad: Fails on second run
|
|
147
|
+
await prisma.user.create({
|
|
148
|
+
data: { email: 'alice@prisma.io', name: 'Alice' },
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Common Patterns
|
|
153
|
+
|
|
154
|
+
### Development reset
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
prisma migrate reset --force
|
|
158
|
+
prisma db seed
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Conditional seeding
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
// prisma/seed.ts
|
|
165
|
+
const count = await prisma.user.count()
|
|
166
|
+
if (count === 0) {
|
|
167
|
+
// Only seed if empty
|
|
168
|
+
await seedUsers()
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Environment-specific seeds
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// prisma/seed.ts
|
|
176
|
+
const env = process.env.NODE_ENV || 'development'
|
|
177
|
+
|
|
178
|
+
if (env === 'development') {
|
|
179
|
+
await seedDevData()
|
|
180
|
+
} else if (env === 'test') {
|
|
181
|
+
await seedTestData()
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Best Practices
|
|
186
|
+
|
|
187
|
+
1. Use `upsert` for idempotent seeds
|
|
188
|
+
2. Keep seeds focused and minimal
|
|
189
|
+
3. Use realistic but fake data
|
|
190
|
+
4. Document required seed data
|
|
191
|
+
5. Version control your seed scripts
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# prisma debug
|
|
2
|
+
|
|
3
|
+
Prints information helpful for debugging and bug reports.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma debug [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
Outputs details about your Prisma environment, including:
|
|
14
|
+
- Prisma CLI version
|
|
15
|
+
- Prisma Client version (if installed)
|
|
16
|
+
- Engine binaries (Query Engine, Migration Engine, etc.)
|
|
17
|
+
- Platform information (OS, Architecture)
|
|
18
|
+
- Node.js version
|
|
19
|
+
- Configured datasource provider
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
| Option | Description |
|
|
24
|
+
|--------|-------------|
|
|
25
|
+
| `--schema` | Path to schema file |
|
|
26
|
+
| `--config` | Custom path to your Prisma config file |
|
|
27
|
+
|
|
28
|
+
## Example Output
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
prisma : 7.3.0
|
|
32
|
+
@prisma/client : 7.3.0
|
|
33
|
+
Operating System : darwin
|
|
34
|
+
Architecture : arm64
|
|
35
|
+
Node.js : v20.10.0
|
|
36
|
+
TypeScript : 5.3.3
|
|
37
|
+
Query Compiler : enabled
|
|
38
|
+
PSL : ...
|
|
39
|
+
Schema Engine : ...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## When to Use
|
|
43
|
+
|
|
44
|
+
- **Troubleshooting**: Checking version mismatches
|
|
45
|
+
- **Reporting Issues**: Including environment info in GitHub issues
|
|
46
|
+
- **Verifying Installation**: Ensuring correct binaries are downloaded
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# prisma dev
|
|
2
|
+
|
|
3
|
+
Starts a local Prisma Postgres database for development. Provides a PostgreSQL-compatible database that runs entirely on your machine.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma dev [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
- Starts a local PostgreSQL-compatible database
|
|
14
|
+
- Runs in your terminal or as a background process
|
|
15
|
+
- Perfect for development and testing
|
|
16
|
+
- Easy migration to Prisma Postgres cloud in production
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
| Option | Description | Default |
|
|
21
|
+
|--------|-------------|---------|
|
|
22
|
+
| `--name` / `-n` | Name for the database instance | `default` |
|
|
23
|
+
| `--port` / `-p` | HTTP server port | `51213` |
|
|
24
|
+
| `--db-port` / `-P` | Database server port | `51214` |
|
|
25
|
+
| `--shadow-db-port` | Shadow database port (for migrations) | `51215` |
|
|
26
|
+
| `--detach` / `-d` | Run in background | `false` |
|
|
27
|
+
| `--debug` | Enable debug logging | `false` |
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
### Start local database
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
prisma dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Interactive mode with keyboard shortcuts:
|
|
38
|
+
- `q` - Quit
|
|
39
|
+
- `h` - Show HTTP URL
|
|
40
|
+
- `t` - Show TCP URLs
|
|
41
|
+
|
|
42
|
+
### Named instance
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
prisma dev --name myproject
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Useful for multiple projects.
|
|
49
|
+
|
|
50
|
+
### Background mode
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
prisma dev --detach
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Frees your terminal for other commands.
|
|
57
|
+
|
|
58
|
+
### Custom ports
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
prisma dev --port 5000 --db-port 5432
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Instance Management
|
|
65
|
+
|
|
66
|
+
### List all instances
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
prisma dev ls
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Shows all local Prisma Postgres instances with status.
|
|
73
|
+
|
|
74
|
+
### Start existing instance
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
prisma dev start myproject
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Starts a previously created instance in background.
|
|
81
|
+
|
|
82
|
+
### Stop instance
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
prisma dev stop myproject
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Stop with glob pattern
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
prisma dev stop "myproject*"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Stops all instances matching pattern.
|
|
95
|
+
|
|
96
|
+
### Remove instance
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
prisma dev rm myproject
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Removes instance data from filesystem.
|
|
103
|
+
|
|
104
|
+
### Force remove (stops first)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
prisma dev rm myproject --force
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Configuration
|
|
111
|
+
|
|
112
|
+
Configure your `prisma.config.ts` to use local Prisma Postgres:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import 'dotenv/config'
|
|
116
|
+
import { defineConfig, env } from 'prisma/config'
|
|
117
|
+
|
|
118
|
+
export default defineConfig({
|
|
119
|
+
schema: 'prisma/schema.prisma',
|
|
120
|
+
migrations: {
|
|
121
|
+
path: 'prisma/migrations',
|
|
122
|
+
},
|
|
123
|
+
datasource: {
|
|
124
|
+
// Local Prisma Postgres URL (from prisma dev output)
|
|
125
|
+
url: env('DATABASE_URL'),
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Workflow
|
|
131
|
+
|
|
132
|
+
1. Start local database:
|
|
133
|
+
```bash
|
|
134
|
+
prisma dev
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
2. In another terminal, run migrations:
|
|
138
|
+
```bash
|
|
139
|
+
prisma migrate dev
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
3. Generate client:
|
|
143
|
+
```bash
|
|
144
|
+
prisma generate
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
4. Run your application
|
|
148
|
+
|
|
149
|
+
## Production Migration
|
|
150
|
+
|
|
151
|
+
When ready for production, switch to Prisma Postgres cloud:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
prisma init --db
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Update your `DATABASE_URL` to the cloud connection string.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# prisma format
|
|
2
|
+
|
|
3
|
+
Formats your Prisma schema file.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma format [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
- Fixes formatting (indentation, spacing)
|
|
14
|
+
- Adds missing back-relations (e.g., adds the other side of a relation)
|
|
15
|
+
- Adds missing relation arguments (e.g., `fields`, `references`)
|
|
16
|
+
- Sorts fields and attributes (opinionated)
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
| Option | Description |
|
|
21
|
+
|--------|-------------|
|
|
22
|
+
| `--schema` | Path to schema file |
|
|
23
|
+
| `--config` | Custom path to your Prisma config file |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
### Format default schema
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
prisma format
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Format specific schema
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
prisma format --schema=./custom/schema.prisma
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Behavior
|
|
40
|
+
|
|
41
|
+
`prisma format` modifies the file in place. It is equivalent to "Prettier for Prisma schemas" but also has semantic understanding to fix/add missing schema definitions.
|
|
42
|
+
|
|
43
|
+
## Use in Editor
|
|
44
|
+
|
|
45
|
+
Most Prisma editor extensions (VS Code, WebStorm) run `prisma format` automatically on save. This command is useful for:
|
|
46
|
+
- CI pipelines (check formatting)
|
|
47
|
+
- CLI-based workflows
|
|
48
|
+
- Fixing large schema refactors
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# prisma generate
|
|
2
|
+
|
|
3
|
+
Generates assets based on the generator blocks in your Prisma schema, most commonly Prisma Client.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma generate [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Bun Runtime
|
|
12
|
+
|
|
13
|
+
If you're using Bun, run Prisma with `bunx --bun` so it doesn't fall back to Node.js:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bunx --bun prisma generate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What It Does
|
|
20
|
+
|
|
21
|
+
1. Reads your `schema.prisma` file
|
|
22
|
+
2. Generates a customized Prisma Client based on your models
|
|
23
|
+
3. Outputs to the directory specified in the generator block
|
|
24
|
+
|
|
25
|
+
## Options
|
|
26
|
+
|
|
27
|
+
| Option | Description |
|
|
28
|
+
|--------|-------------|
|
|
29
|
+
| `--schema` | Custom path to your Prisma schema |
|
|
30
|
+
| `--config` | Custom path to your Prisma config file |
|
|
31
|
+
| `--sql` | Generate typed sql module |
|
|
32
|
+
| `--watch` | Watch the Prisma schema and rerun after a change |
|
|
33
|
+
| `--generator` | Generator to use (may be provided multiple times) |
|
|
34
|
+
| `--no-hints` | Hides the hint messages but still outputs errors and warnings |
|
|
35
|
+
| `--require-models` | Do not allow generating a client without models |
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
### Basic generation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
prisma generate
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Watch mode (development)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
prisma generate --watch
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Auto-regenerates when `schema.prisma` changes.
|
|
52
|
+
|
|
53
|
+
### Specific generator
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
prisma generate --generator client
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Multiple generators
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
prisma generate --generator client --generator zod_schemas
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Typed SQL generation
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
prisma generate --sql
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Schema Configuration (v7)
|
|
72
|
+
|
|
73
|
+
```prisma
|
|
74
|
+
generator client {
|
|
75
|
+
provider = "prisma-client"
|
|
76
|
+
output = "../generated"
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Key v7 Changes
|
|
81
|
+
|
|
82
|
+
- Provider must be `prisma-client`
|
|
83
|
+
- `output` is now **required** - client no longer generates to `node_modules`
|
|
84
|
+
- Update imports after generating:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// Before (v6)
|
|
88
|
+
import { PrismaClient } from '@prisma/client'
|
|
89
|
+
|
|
90
|
+
// After (v7)
|
|
91
|
+
import { PrismaClient } from '../generated/client'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Common Patterns
|
|
95
|
+
|
|
96
|
+
### After schema changes
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
prisma migrate dev --name my_migration
|
|
100
|
+
prisma generate
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Note: In v7, `migrate dev` no longer auto-runs `generate`.
|
|
104
|
+
|
|
105
|
+
### CI/CD pipeline
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
prisma generate
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Run before building your application.
|
|
112
|
+
|
|
113
|
+
### Multiple generators
|
|
114
|
+
|
|
115
|
+
```prisma
|
|
116
|
+
generator client {
|
|
117
|
+
provider = "prisma-client"
|
|
118
|
+
output = "../generated"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
generator zod {
|
|
122
|
+
provider = "zod-prisma-types"
|
|
123
|
+
output = "../generated/zod"
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
prisma generate # Runs all generators
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Output Structure
|
|
132
|
+
|
|
133
|
+
After running `prisma generate`, your output directory contains:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
generated/
|
|
137
|
+
├── client.ts
|
|
138
|
+
├── models/
|
|
139
|
+
├── enums.ts
|
|
140
|
+
└── ...
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Import the client:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { PrismaClient, Prisma } from '../generated/client'
|
|
147
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# prisma init
|
|
2
|
+
|
|
3
|
+
Bootstraps a fresh Prisma ORM project in the current directory.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
prisma init [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Bun Runtime
|
|
12
|
+
|
|
13
|
+
If you're using Bun, run Prisma with `bunx --bun` so it doesn't fall back to Node.js:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bunx --bun prisma init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What It Creates
|
|
20
|
+
|
|
21
|
+
- `prisma/schema.prisma` - Your Prisma schema file
|
|
22
|
+
- `prisma.config.ts` - TypeScript configuration for Prisma CLI
|
|
23
|
+
- `.env` - Environment variables (DATABASE_URL)
|
|
24
|
+
- `.gitignore` - Ignores node_modules, .env, and generated files
|
|
25
|
+
|
|
26
|
+
## Options
|
|
27
|
+
|
|
28
|
+
| Option | Description | Default |
|
|
29
|
+
|--------|-------------|---------|
|
|
30
|
+
| `--datasource-provider` | Database provider: `postgresql`, `mysql`, `sqlite`, `sqlserver`, `mongodb`, `cockroachdb` | `postgresql` |
|
|
31
|
+
| `--db` | Provisions a fully managed Prisma Postgres database on the Prisma Data Platform | - |
|
|
32
|
+
| `--url` | Define a custom datasource url | - |
|
|
33
|
+
| `--generator-provider` | Define the generator provider to use | `prisma-client` |
|
|
34
|
+
| `--output` | Define Prisma Client generator output path to use | - |
|
|
35
|
+
| `--preview-feature` | Define a preview feature to use | - |
|
|
36
|
+
| `--with-model` | Add example model to created schema file | - |
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
### Basic initialization
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
prisma init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Creates a PostgreSQL project setup.
|
|
47
|
+
|
|
48
|
+
### SQLite project
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
prisma init --datasource-provider sqlite
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### MySQL with custom URL
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
prisma init --datasource-provider mysql --url "mysql://user:password@localhost:3306/mydb"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Prisma Postgres (cloud)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
prisma init --db
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Opens browser for authentication, creates cloud database instance.
|
|
67
|
+
|
|
68
|
+
### AI-generated schema
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
prisma init --prompt "Blog with users, posts, comments, and tags"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Generates schema based on description and deploys to Prisma Postgres.
|
|
75
|
+
|
|
76
|
+
### With preview features
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
prisma init --preview-feature relationJoins --preview-feature fullTextSearch
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Generated Schema (v7)
|
|
83
|
+
|
|
84
|
+
```prisma
|
|
85
|
+
generator client {
|
|
86
|
+
provider = "prisma-client"
|
|
87
|
+
output = "../generated"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
datasource db {
|
|
91
|
+
provider = "postgresql"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Generated Config (v7)
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// prisma.config.ts
|
|
99
|
+
import { defineConfig, env } from 'prisma/config'
|
|
100
|
+
|
|
101
|
+
export default defineConfig({
|
|
102
|
+
schema: 'prisma/schema.prisma',
|
|
103
|
+
migrations: {
|
|
104
|
+
path: 'prisma/migrations',
|
|
105
|
+
},
|
|
106
|
+
datasource: {
|
|
107
|
+
url: env('DATABASE_URL'),
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Next Steps After Init
|
|
113
|
+
|
|
114
|
+
1. Configure `DATABASE_URL` in `prisma.config.ts` or `.env`
|
|
115
|
+
2. Define your models in `prisma/schema.prisma`
|
|
116
|
+
3. Run `prisma dev` for local development or connect to remote DB
|
|
117
|
+
4. Run `prisma migrate dev` to create migrations
|
|
118
|
+
5. Run `prisma generate` to generate Prisma Client
|