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,159 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { auth } from "@/auth";
|
|
4
|
+
import { prisma } from "@/lib/prisma";
|
|
5
|
+
import { revalidatePath } from "next/cache";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
const proyectoSchema = z.object({
|
|
9
|
+
titulo: z.string().min(3, "El título debe tener al menos 3 caracteres"),
|
|
10
|
+
descripcion: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(10, "La descripción debe tener al menos 10 caracteres"),
|
|
13
|
+
tecnologias: z.string().min(1, "Ingresá al menos una tecnología"),
|
|
14
|
+
estado: z.enum(["En Producción", "En Desarrollo", "Pausado"]),
|
|
15
|
+
presupuesto: z.coerce.number().min(0, "El presupuesto no puede ser negativo"),
|
|
16
|
+
fecha: z.string().min(1, "La fecha es requerida"),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type ProyectoActionState = {
|
|
20
|
+
error?: string;
|
|
21
|
+
fieldErrors?: Record<string, string[]>;
|
|
22
|
+
success?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export async function obtenerProyectosPublicos() {
|
|
26
|
+
return prisma.proyecto.findMany({
|
|
27
|
+
orderBy: { createdAt: "desc" },
|
|
28
|
+
include: {
|
|
29
|
+
user: {
|
|
30
|
+
select: { name: true },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function obtenerProyectos() {
|
|
37
|
+
const session = await auth();
|
|
38
|
+
if (!session?.user?.id) {
|
|
39
|
+
throw new Error("No autorizado");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return prisma.proyecto.findMany({
|
|
43
|
+
where: { userId: session.user.id },
|
|
44
|
+
orderBy: { createdAt: "desc" },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function obtenerTodosLosProyectos() {
|
|
49
|
+
const session = await auth();
|
|
50
|
+
if (!session?.user?.id) {
|
|
51
|
+
throw new Error("No autorizado");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return prisma.proyecto.findMany({
|
|
55
|
+
orderBy: { createdAt: "desc" },
|
|
56
|
+
include: {
|
|
57
|
+
user: {
|
|
58
|
+
select: { name: true, email: true },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function crearProyecto(
|
|
65
|
+
_prevState: ProyectoActionState,
|
|
66
|
+
formData: FormData,
|
|
67
|
+
): Promise<ProyectoActionState> {
|
|
68
|
+
const session = await auth();
|
|
69
|
+
if (!session?.user?.id) {
|
|
70
|
+
return { error: "No autorizado" };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const raw = Object.fromEntries(formData);
|
|
74
|
+
const parsed = proyectoSchema.safeParse(raw);
|
|
75
|
+
|
|
76
|
+
if (!parsed.success) {
|
|
77
|
+
return {
|
|
78
|
+
fieldErrors: parsed.error.flatten().fieldErrors as Record<
|
|
79
|
+
string,
|
|
80
|
+
string[]
|
|
81
|
+
>,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
await prisma.proyecto.create({
|
|
86
|
+
data: {
|
|
87
|
+
...parsed.data,
|
|
88
|
+
fecha: new Date(parsed.data.fecha),
|
|
89
|
+
userId: session.user.id,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
revalidatePath("/proyectos-crud");
|
|
94
|
+
revalidatePath("/proyectos");
|
|
95
|
+
revalidatePath("/dashboard");
|
|
96
|
+
return { success: true };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export async function editarProyecto(
|
|
100
|
+
id: string,
|
|
101
|
+
_prevState: ProyectoActionState,
|
|
102
|
+
formData: FormData,
|
|
103
|
+
): Promise<ProyectoActionState> {
|
|
104
|
+
const session = await auth();
|
|
105
|
+
if (!session?.user?.id) {
|
|
106
|
+
return { error: "No autorizado" };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const existing = await prisma.proyecto.findUnique({ where: { id } });
|
|
110
|
+
if (!existing || existing.userId !== session.user.id) {
|
|
111
|
+
return { error: "Proyecto no encontrado" };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const raw = Object.fromEntries(formData);
|
|
115
|
+
const parsed = proyectoSchema.safeParse(raw);
|
|
116
|
+
|
|
117
|
+
if (!parsed.success) {
|
|
118
|
+
return {
|
|
119
|
+
fieldErrors: parsed.error.flatten().fieldErrors as Record<
|
|
120
|
+
string,
|
|
121
|
+
string[]
|
|
122
|
+
>,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
await prisma.proyecto.update({
|
|
127
|
+
where: { id },
|
|
128
|
+
data: {
|
|
129
|
+
...parsed.data,
|
|
130
|
+
fecha: new Date(parsed.data.fecha),
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
revalidatePath("/proyectos-crud");
|
|
135
|
+
revalidatePath("/proyectos");
|
|
136
|
+
revalidatePath("/dashboard");
|
|
137
|
+
return { success: true };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export async function eliminarProyecto(
|
|
141
|
+
id: string,
|
|
142
|
+
): Promise<ProyectoActionState> {
|
|
143
|
+
const session = await auth();
|
|
144
|
+
if (!session?.user?.id) {
|
|
145
|
+
return { error: "No autorizado" };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const existing = await prisma.proyecto.findUnique({ where: { id } });
|
|
149
|
+
if (!existing || existing.userId !== session.user.id) {
|
|
150
|
+
return { error: "Proyecto no encontrado" };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
await prisma.proyecto.delete({ where: { id } });
|
|
154
|
+
|
|
155
|
+
revalidatePath("/proyectos-crud");
|
|
156
|
+
revalidatePath("/proyectos");
|
|
157
|
+
revalidatePath("/dashboard");
|
|
158
|
+
return { success: true };
|
|
159
|
+
}
|
package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
6
|
+
import {
|
|
7
|
+
BarChart,
|
|
8
|
+
Bar,
|
|
9
|
+
LineChart,
|
|
10
|
+
Line,
|
|
11
|
+
XAxis,
|
|
12
|
+
YAxis,
|
|
13
|
+
CartesianGrid,
|
|
14
|
+
Tooltip,
|
|
15
|
+
ResponsiveContainer,
|
|
16
|
+
} from "recharts";
|
|
17
|
+
import {
|
|
18
|
+
ArrowUp,
|
|
19
|
+
FolderKanban,
|
|
20
|
+
Rocket,
|
|
21
|
+
Code,
|
|
22
|
+
Wallet,
|
|
23
|
+
} from "lucide-react";
|
|
24
|
+
import {
|
|
25
|
+
Card,
|
|
26
|
+
CardContent,
|
|
27
|
+
CardDescription,
|
|
28
|
+
CardHeader,
|
|
29
|
+
CardTitle,
|
|
30
|
+
} from "@/components/ui/card";
|
|
31
|
+
import {
|
|
32
|
+
Breadcrumb,
|
|
33
|
+
BreadcrumbItem,
|
|
34
|
+
BreadcrumbLink,
|
|
35
|
+
BreadcrumbList,
|
|
36
|
+
BreadcrumbPage,
|
|
37
|
+
BreadcrumbSeparator,
|
|
38
|
+
} from "@/components/ui/breadcrumb";
|
|
39
|
+
import { DataTable } from "@/components/ui/table";
|
|
40
|
+
import { Badge } from "@/components/ui/badge";
|
|
41
|
+
import {
|
|
42
|
+
activeUsersChartData,
|
|
43
|
+
salesOverviewChartData,
|
|
44
|
+
} from "@/data/dashboard";
|
|
45
|
+
|
|
46
|
+
interface DashboardStats {
|
|
47
|
+
totalProyectos: number;
|
|
48
|
+
enDesarrollo: number;
|
|
49
|
+
enProduccion: number;
|
|
50
|
+
presupuestoTotal: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface SerializedProyecto {
|
|
54
|
+
id: string;
|
|
55
|
+
titulo: string;
|
|
56
|
+
descripcion: string;
|
|
57
|
+
tecnologias: string;
|
|
58
|
+
estado: string;
|
|
59
|
+
presupuesto: number;
|
|
60
|
+
fecha: string;
|
|
61
|
+
userId: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface DashboardClientProps {
|
|
67
|
+
userName: string;
|
|
68
|
+
stats: DashboardStats;
|
|
69
|
+
recentProyectos: SerializedProyecto[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function formatCurrency(value: number): string {
|
|
73
|
+
return new Intl.NumberFormat("es-AR", {
|
|
74
|
+
style: "currency",
|
|
75
|
+
currency: "USD",
|
|
76
|
+
minimumFractionDigits: 0,
|
|
77
|
+
}).format(value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function estadoBadgeClass(estado: string): string {
|
|
81
|
+
switch (estado) {
|
|
82
|
+
case "En Producción":
|
|
83
|
+
return "badge-success";
|
|
84
|
+
case "En Desarrollo":
|
|
85
|
+
return "badge-warning";
|
|
86
|
+
case "Pausado":
|
|
87
|
+
return "badge-error";
|
|
88
|
+
default:
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function DashboardClient({
|
|
94
|
+
userName,
|
|
95
|
+
stats,
|
|
96
|
+
recentProyectos,
|
|
97
|
+
}: DashboardClientProps) {
|
|
98
|
+
const gridStroke = "var(--color-base-300)";
|
|
99
|
+
const tickFill = "var(--color-base-content)";
|
|
100
|
+
const primaryColor = "var(--color-secondary)";
|
|
101
|
+
const tooltipStyle = {
|
|
102
|
+
borderRadius: "var(--radius-box)",
|
|
103
|
+
border: `1px solid ${gridStroke}`,
|
|
104
|
+
backgroundColor: "var(--color-base-100)",
|
|
105
|
+
color: "var(--color-base-content)",
|
|
106
|
+
fontSize: "0.875rem",
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const statsCards = [
|
|
110
|
+
{
|
|
111
|
+
label: "Total Proyectos",
|
|
112
|
+
value: stats.totalProyectos.toString(),
|
|
113
|
+
icon: FolderKanban,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: "En Desarrollo",
|
|
117
|
+
value: stats.enDesarrollo.toString(),
|
|
118
|
+
icon: Code,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: "En Producción",
|
|
122
|
+
value: stats.enProduccion.toString(),
|
|
123
|
+
icon: Rocket,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: "Presupuesto Total",
|
|
127
|
+
value: formatCurrency(stats.presupuestoTotal),
|
|
128
|
+
icon: Wallet,
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
const columns = useMemo<ColumnDef<SerializedProyecto, unknown>[]>(
|
|
133
|
+
() => [
|
|
134
|
+
{
|
|
135
|
+
accessorKey: "titulo",
|
|
136
|
+
header: "Título",
|
|
137
|
+
cell: ({ row }) => (
|
|
138
|
+
<div>
|
|
139
|
+
<p className="font-medium text-base-content">
|
|
140
|
+
{row.original.titulo}
|
|
141
|
+
</p>
|
|
142
|
+
<p className="text-xs text-base-content/50 line-clamp-1">
|
|
143
|
+
{row.original.tecnologias}
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
),
|
|
147
|
+
enableSorting: true,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
accessorKey: "estado",
|
|
151
|
+
header: "Estado",
|
|
152
|
+
cell: ({ row }) => (
|
|
153
|
+
<Badge className={estadoBadgeClass(row.original.estado)}>
|
|
154
|
+
{row.original.estado}
|
|
155
|
+
</Badge>
|
|
156
|
+
),
|
|
157
|
+
enableSorting: true,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
accessorKey: "presupuesto",
|
|
161
|
+
header: "Presupuesto",
|
|
162
|
+
cell: ({ row }) => (
|
|
163
|
+
<span className="text-base-content/70">
|
|
164
|
+
{formatCurrency(row.original.presupuesto)}
|
|
165
|
+
</span>
|
|
166
|
+
),
|
|
167
|
+
enableSorting: true,
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
[],
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<div className="px-4 sm:px-6 lg:px-8 py-6 space-y-6">
|
|
175
|
+
<div>
|
|
176
|
+
<Breadcrumb>
|
|
177
|
+
<BreadcrumbList>
|
|
178
|
+
<BreadcrumbItem>
|
|
179
|
+
<BreadcrumbLink asChild>
|
|
180
|
+
<Link href="/">Páginas</Link>
|
|
181
|
+
</BreadcrumbLink>
|
|
182
|
+
</BreadcrumbItem>
|
|
183
|
+
<BreadcrumbSeparator />
|
|
184
|
+
<BreadcrumbItem>
|
|
185
|
+
<BreadcrumbPage>Dashboard</BreadcrumbPage>
|
|
186
|
+
</BreadcrumbItem>
|
|
187
|
+
</BreadcrumbList>
|
|
188
|
+
</Breadcrumb>
|
|
189
|
+
<h1 className="text-2xl font-bold text-base-content mt-1">
|
|
190
|
+
Dashboard
|
|
191
|
+
</h1>
|
|
192
|
+
<p className="text-sm text-base-content/50 mt-0.5">
|
|
193
|
+
Bienvenido de vuelta,{" "}
|
|
194
|
+
<span className="font-medium text-base-content">{userName}</span>
|
|
195
|
+
</p>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4">
|
|
199
|
+
{statsCards.map((stat) => (
|
|
200
|
+
<Card key={stat.label}>
|
|
201
|
+
<CardContent className="flex items-center justify-between py-4">
|
|
202
|
+
<div>
|
|
203
|
+
<p className="text-xs font-medium text-base-content/50 uppercase tracking-wide">
|
|
204
|
+
{stat.label}
|
|
205
|
+
</p>
|
|
206
|
+
<p className="text-xl font-bold text-base-content">
|
|
207
|
+
{stat.value}
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
210
|
+
<div className="flex size-12 items-center justify-center rounded-xl bg-accent text-accent-content">
|
|
211
|
+
<stat.icon className="size-5" />
|
|
212
|
+
</div>
|
|
213
|
+
</CardContent>
|
|
214
|
+
</Card>
|
|
215
|
+
))}
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
|
219
|
+
<Card>
|
|
220
|
+
<CardContent className="pt-4">
|
|
221
|
+
<div className="h-56">
|
|
222
|
+
<ResponsiveContainer width="100%" height="100%">
|
|
223
|
+
<BarChart data={activeUsersChartData}>
|
|
224
|
+
<CartesianGrid
|
|
225
|
+
strokeDasharray="3 3"
|
|
226
|
+
vertical={false}
|
|
227
|
+
stroke={gridStroke}
|
|
228
|
+
/>
|
|
229
|
+
<XAxis
|
|
230
|
+
dataKey="name"
|
|
231
|
+
axisLine={false}
|
|
232
|
+
tickLine={false}
|
|
233
|
+
tick={{ fontSize: 12, fill: tickFill, opacity: 0.5 }}
|
|
234
|
+
/>
|
|
235
|
+
<YAxis
|
|
236
|
+
axisLine={false}
|
|
237
|
+
tickLine={false}
|
|
238
|
+
tick={{ fontSize: 12, fill: tickFill, opacity: 0.5 }}
|
|
239
|
+
/>
|
|
240
|
+
<Tooltip contentStyle={tooltipStyle} />
|
|
241
|
+
<Bar
|
|
242
|
+
dataKey="value"
|
|
243
|
+
fill={primaryColor}
|
|
244
|
+
radius={[4, 4, 0, 0]}
|
|
245
|
+
/>
|
|
246
|
+
</BarChart>
|
|
247
|
+
</ResponsiveContainer>
|
|
248
|
+
</div>
|
|
249
|
+
<h3 className="text-lg font-bold text-base-content mt-4">
|
|
250
|
+
Usuarios Activos
|
|
251
|
+
</h3>
|
|
252
|
+
<p className="text-sm text-base-content/50">
|
|
253
|
+
<span className="font-semibold text-success">(+23)</span> que la
|
|
254
|
+
semana pasada
|
|
255
|
+
</p>
|
|
256
|
+
</CardContent>
|
|
257
|
+
</Card>
|
|
258
|
+
|
|
259
|
+
<Card>
|
|
260
|
+
<CardHeader>
|
|
261
|
+
<CardTitle>Resumen de ventas</CardTitle>
|
|
262
|
+
<CardDescription>
|
|
263
|
+
<span className="font-semibold text-success">(+5) más</span> en
|
|
264
|
+
2024
|
|
265
|
+
</CardDescription>
|
|
266
|
+
</CardHeader>
|
|
267
|
+
<CardContent>
|
|
268
|
+
<div className="h-64">
|
|
269
|
+
<ResponsiveContainer width="100%" height="100%">
|
|
270
|
+
<LineChart data={salesOverviewChartData}>
|
|
271
|
+
<CartesianGrid
|
|
272
|
+
strokeDasharray="3 3"
|
|
273
|
+
vertical={false}
|
|
274
|
+
stroke={gridStroke}
|
|
275
|
+
/>
|
|
276
|
+
<XAxis
|
|
277
|
+
dataKey="name"
|
|
278
|
+
axisLine={false}
|
|
279
|
+
tickLine={false}
|
|
280
|
+
tick={{ fontSize: 12, fill: tickFill, opacity: 0.5 }}
|
|
281
|
+
/>
|
|
282
|
+
<YAxis
|
|
283
|
+
axisLine={false}
|
|
284
|
+
tickLine={false}
|
|
285
|
+
tick={{ fontSize: 12, fill: tickFill, opacity: 0.5 }}
|
|
286
|
+
/>
|
|
287
|
+
<Tooltip contentStyle={tooltipStyle} />
|
|
288
|
+
<Line
|
|
289
|
+
type="monotone"
|
|
290
|
+
dataKey="value"
|
|
291
|
+
stroke={primaryColor}
|
|
292
|
+
strokeWidth={3}
|
|
293
|
+
dot={false}
|
|
294
|
+
activeDot={{ r: 5 }}
|
|
295
|
+
/>
|
|
296
|
+
</LineChart>
|
|
297
|
+
</ResponsiveContainer>
|
|
298
|
+
</div>
|
|
299
|
+
</CardContent>
|
|
300
|
+
</Card>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<Card>
|
|
304
|
+
<CardHeader>
|
|
305
|
+
<CardTitle>Últimos Proyectos</CardTitle>
|
|
306
|
+
<CardDescription>
|
|
307
|
+
<ArrowUp className="inline size-3.5 text-success mr-1" />
|
|
308
|
+
Mostrando los últimos {recentProyectos.length} proyectos
|
|
309
|
+
</CardDescription>
|
|
310
|
+
</CardHeader>
|
|
311
|
+
<CardContent>
|
|
312
|
+
<DataTable
|
|
313
|
+
data={recentProyectos}
|
|
314
|
+
columns={columns}
|
|
315
|
+
filterPlaceholder="Buscar proyecto..."
|
|
316
|
+
/>
|
|
317
|
+
</CardContent>
|
|
318
|
+
</Card>
|
|
319
|
+
</div>
|
|
320
|
+
);
|
|
321
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { auth } from "@/auth";
|
|
2
|
+
import { prisma } from "@/lib/prisma";
|
|
3
|
+
import { DashboardClient } from "./dashboard-client";
|
|
4
|
+
|
|
5
|
+
export default async function DashboardPage() {
|
|
6
|
+
const session = await auth();
|
|
7
|
+
|
|
8
|
+
const totalProyectos = await prisma.proyecto.count({
|
|
9
|
+
where: { userId: session!.user.id },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const enDesarrollo = await prisma.proyecto.count({
|
|
13
|
+
where: { userId: session!.user.id, estado: "En Desarrollo" },
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const enProduccion = await prisma.proyecto.count({
|
|
17
|
+
where: { userId: session!.user.id, estado: "En Producción" },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const presupuestoTotal = await prisma.proyecto.aggregate({
|
|
21
|
+
where: { userId: session!.user.id },
|
|
22
|
+
_sum: { presupuesto: true },
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const recentProyectos = await prisma.proyecto.findMany({
|
|
26
|
+
where: { userId: session!.user.id },
|
|
27
|
+
orderBy: { createdAt: "desc" },
|
|
28
|
+
take: 5,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<DashboardClient
|
|
33
|
+
userName={session!.user.name || session!.user.email || "Usuario"}
|
|
34
|
+
stats={{
|
|
35
|
+
totalProyectos,
|
|
36
|
+
enDesarrollo,
|
|
37
|
+
enProduccion,
|
|
38
|
+
presupuestoTotal: presupuestoTotal._sum.presupuesto || 0,
|
|
39
|
+
}}
|
|
40
|
+
recentProyectos={recentProyectos.map((p) => ({
|
|
41
|
+
...p,
|
|
42
|
+
fecha: p.fecha.toISOString(),
|
|
43
|
+
createdAt: p.createdAt.toISOString(),
|
|
44
|
+
updatedAt: p.updatedAt.toISOString(),
|
|
45
|
+
}))}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Sidebar } from "@/components/layout/sidebar";
|
|
5
|
+
import { Menu } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
export default function AuthenticatedLayout({
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) {
|
|
12
|
+
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex min-h-screen bg-base-200">
|
|
16
|
+
<Sidebar open={sidebarOpen} onClose={() => setSidebarOpen(false)} />
|
|
17
|
+
|
|
18
|
+
<div className="flex flex-1 flex-col">
|
|
19
|
+
<header className="flex h-16 items-center gap-4 border-b border-base-300 bg-base-100 px-6 lg:hidden">
|
|
20
|
+
<button
|
|
21
|
+
onClick={() => setSidebarOpen(true)}
|
|
22
|
+
className="p-2 rounded-md hover:bg-base-200"
|
|
23
|
+
aria-label="Abrir menú"
|
|
24
|
+
>
|
|
25
|
+
<Menu className="size-5" />
|
|
26
|
+
</button>
|
|
27
|
+
<span className="text-lg font-bold">Huenei</span>
|
|
28
|
+
</header>
|
|
29
|
+
|
|
30
|
+
<main className="flex-1 p-6">{children}</main>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { auth } from "@/auth";
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle,
|
|
8
|
+
} from "@/components/ui/card";
|
|
9
|
+
import { User, Shield, Clock, Mail } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
export default async function PerfilPage() {
|
|
12
|
+
const session = await auth();
|
|
13
|
+
const user = session!.user;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
|
|
17
|
+
<div className="flex items-center gap-3 mb-8">
|
|
18
|
+
<User className="h-8 w-8 text-primary" />
|
|
19
|
+
<h1 className="text-3xl font-bold text-base-content">Mi Perfil</h1>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<Card>
|
|
23
|
+
<CardHeader>
|
|
24
|
+
<CardTitle>Información de la cuenta</CardTitle>
|
|
25
|
+
<CardDescription>Datos de tu sesión actual</CardDescription>
|
|
26
|
+
</CardHeader>
|
|
27
|
+
<CardContent className="space-y-4">
|
|
28
|
+
<div className="flex items-center gap-3">
|
|
29
|
+
<div className="rounded-full bg-primary/10 p-3">
|
|
30
|
+
<User className="h-6 w-6 text-primary" />
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<p className="text-sm text-base-content/60">Nombre</p>
|
|
34
|
+
<p className="text-lg font-semibold text-base-content">
|
|
35
|
+
{user.name || "Sin nombre"}
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div className="flex items-center gap-3">
|
|
41
|
+
<div className="rounded-full bg-primary/10 p-3">
|
|
42
|
+
<Mail className="h-6 w-6 text-primary" />
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<p className="text-sm text-base-content/60">Email</p>
|
|
46
|
+
<p className="text-lg font-semibold text-base-content">
|
|
47
|
+
{user.email}
|
|
48
|
+
</p>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div className="flex items-center gap-3">
|
|
53
|
+
<div className="rounded-full bg-primary/10 p-3">
|
|
54
|
+
<Shield className="h-6 w-6 text-primary" />
|
|
55
|
+
</div>
|
|
56
|
+
<div>
|
|
57
|
+
<p className="text-sm text-base-content/60">Rol</p>
|
|
58
|
+
<p className="text-lg font-semibold text-base-content">
|
|
59
|
+
Usuario
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div className="flex items-center gap-3">
|
|
65
|
+
<div className="rounded-full bg-primary/10 p-3">
|
|
66
|
+
<Clock className="h-6 w-6 text-primary" />
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<p className="text-sm text-base-content/60">
|
|
70
|
+
Sesión activa desde
|
|
71
|
+
</p>
|
|
72
|
+
<p className="text-lg font-semibold text-base-content">
|
|
73
|
+
{new Date().toLocaleDateString("es-AR", {
|
|
74
|
+
day: "numeric",
|
|
75
|
+
month: "long",
|
|
76
|
+
year: "numeric",
|
|
77
|
+
})}
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</CardContent>
|
|
82
|
+
</Card>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { auth } from "@/auth";
|
|
2
|
+
import { prisma } from "@/lib/prisma";
|
|
3
|
+
import { ProyectosCrudClient } from "./proyectos-crud-client";
|
|
4
|
+
|
|
5
|
+
export default async function ProyectosCrudPage() {
|
|
6
|
+
const session = await auth();
|
|
7
|
+
|
|
8
|
+
const proyectos = await prisma.proyecto.findMany({
|
|
9
|
+
where: { userId: session!.user.id },
|
|
10
|
+
orderBy: { createdAt: "desc" },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<ProyectosCrudClient
|
|
15
|
+
proyectos={proyectos.map((p) => ({
|
|
16
|
+
...p,
|
|
17
|
+
fecha: p.fecha.toISOString(),
|
|
18
|
+
createdAt: p.createdAt.toISOString(),
|
|
19
|
+
updatedAt: p.updatedAt.toISOString(),
|
|
20
|
+
}))}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|