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,331 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle,
|
|
8
|
+
} from "@/components/ui/card";
|
|
9
|
+
import { Button } from "@/components/ui/button";
|
|
10
|
+
import { Badge } from "@/components/ui/badge";
|
|
11
|
+
import {
|
|
12
|
+
Code,
|
|
13
|
+
Palette,
|
|
14
|
+
Database,
|
|
15
|
+
Settings,
|
|
16
|
+
BookOpen,
|
|
17
|
+
Table2,
|
|
18
|
+
Shield,
|
|
19
|
+
Server,
|
|
20
|
+
ArrowRight,
|
|
21
|
+
DollarSign,
|
|
22
|
+
Calendar,
|
|
23
|
+
} from "lucide-react";
|
|
24
|
+
import { Navbar } from "@/components/layout/navbar";
|
|
25
|
+
import { obtenerProyectosPublicos } from "@/actions/proyectos";
|
|
26
|
+
|
|
27
|
+
function estadoBadgeClass(estado: string): string {
|
|
28
|
+
switch (estado) {
|
|
29
|
+
case "En Producción":
|
|
30
|
+
return "badge-success";
|
|
31
|
+
case "En Desarrollo":
|
|
32
|
+
return "badge-warning";
|
|
33
|
+
case "Pausado":
|
|
34
|
+
return "badge-error";
|
|
35
|
+
default:
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function formatCurrency(value: number): string {
|
|
41
|
+
return new Intl.NumberFormat("es-AR", {
|
|
42
|
+
style: "currency",
|
|
43
|
+
currency: "USD",
|
|
44
|
+
minimumFractionDigits: 0,
|
|
45
|
+
}).format(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default async function HomePage() {
|
|
49
|
+
const proyectos = await obtenerProyectosPublicos();
|
|
50
|
+
const proyectosDestacados = proyectos.slice(0, 3);
|
|
51
|
+
return (
|
|
52
|
+
<>
|
|
53
|
+
<Navbar />
|
|
54
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
|
|
55
|
+
<div className="text-center mb-16">
|
|
56
|
+
<h2 className="text-5xl font-bold text-base-content mb-6">
|
|
57
|
+
Huenei Frontend
|
|
58
|
+
</h2>
|
|
59
|
+
<p className="text-xl text-base-content/70 max-w-2xl mx-auto mb-6">
|
|
60
|
+
Plantilla estandarizada para proyectos frontend con SSR
|
|
61
|
+
</p>
|
|
62
|
+
<div className="flex flex-wrap justify-center gap-2 mb-6">
|
|
63
|
+
<Badge variant="outline">Next.js 16</Badge>
|
|
64
|
+
<Badge variant="outline">React 19</Badge>
|
|
65
|
+
<Badge variant="outline">TypeScript</Badge>
|
|
66
|
+
<Badge variant="outline">Auth.js</Badge>
|
|
67
|
+
<Badge variant="outline">Prisma</Badge>
|
|
68
|
+
<Badge variant="outline">MySQL</Badge>
|
|
69
|
+
<Badge variant="outline">Tailwind CSS v4</Badge>
|
|
70
|
+
<Badge variant="outline">TanStack Query</Badge>
|
|
71
|
+
<Badge variant="outline">TanStack Table</Badge>
|
|
72
|
+
<Badge variant="outline">shadcn/ui</Badge>
|
|
73
|
+
<Badge variant="outline">Vitest</Badge>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<Card className="bg-primary border-0 text-primary-content mb-8">
|
|
78
|
+
<CardContent className="pt-8 pb-8 text-center">
|
|
79
|
+
<h3 className="text-3xl font-bold mb-4">¿Listo para comenzar?</h3>
|
|
80
|
+
<p className="text-primary-content/90 mb-6 max-w-2xl mx-auto">
|
|
81
|
+
Este template incluye autenticación real con Auth.js, base de
|
|
82
|
+
datos MySQL con Prisma, Server Actions y Server Components.
|
|
83
|
+
</p>
|
|
84
|
+
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
|
85
|
+
<Button
|
|
86
|
+
size="default"
|
|
87
|
+
variant="ghost"
|
|
88
|
+
className="bg-base-100 text-primary hover:bg-base-200"
|
|
89
|
+
asChild
|
|
90
|
+
>
|
|
91
|
+
<Link href="/auth/registro">
|
|
92
|
+
<BookOpen className="w-4 h-4 mr-2" />
|
|
93
|
+
Comenzar
|
|
94
|
+
</Link>
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
</CardContent>
|
|
98
|
+
</Card>
|
|
99
|
+
|
|
100
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 mb-16">
|
|
101
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
102
|
+
<CardHeader>
|
|
103
|
+
<div className="w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4">
|
|
104
|
+
<Code className="w-6 h-6 text-accent" />
|
|
105
|
+
</div>
|
|
106
|
+
<CardTitle>Next.js 16 + TypeScript</CardTitle>
|
|
107
|
+
<CardDescription>
|
|
108
|
+
App Router, Server Components, Server Actions y type safety
|
|
109
|
+
estricto.
|
|
110
|
+
</CardDescription>
|
|
111
|
+
</CardHeader>
|
|
112
|
+
</Card>
|
|
113
|
+
|
|
114
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
115
|
+
<CardHeader>
|
|
116
|
+
<div className="w-12 h-12 bg-info/10 rounded-lg flex items-center justify-center mb-4">
|
|
117
|
+
<Shield className="w-6 h-6 text-info" />
|
|
118
|
+
</div>
|
|
119
|
+
<CardTitle>Auth.js v5</CardTitle>
|
|
120
|
+
<CardDescription>
|
|
121
|
+
Autenticación con Credentials, JWT, protección de rutas con
|
|
122
|
+
middleware.
|
|
123
|
+
</CardDescription>
|
|
124
|
+
</CardHeader>
|
|
125
|
+
</Card>
|
|
126
|
+
|
|
127
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
128
|
+
<CardHeader>
|
|
129
|
+
<div className="w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4">
|
|
130
|
+
<Database className="w-6 h-6 text-success" />
|
|
131
|
+
</div>
|
|
132
|
+
<CardTitle>Prisma + MySQL</CardTitle>
|
|
133
|
+
<CardDescription>
|
|
134
|
+
ORM type-safe con Docker Compose, migraciones y seed data.
|
|
135
|
+
</CardDescription>
|
|
136
|
+
</CardHeader>
|
|
137
|
+
</Card>
|
|
138
|
+
|
|
139
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
140
|
+
<CardHeader>
|
|
141
|
+
<div className="w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4">
|
|
142
|
+
<Server className="w-6 h-6 text-primary" />
|
|
143
|
+
</div>
|
|
144
|
+
<CardTitle>Server Actions</CardTitle>
|
|
145
|
+
<CardDescription>
|
|
146
|
+
CRUD completo con validación Zod, revalidación de cache y
|
|
147
|
+
optimistic updates.
|
|
148
|
+
</CardDescription>
|
|
149
|
+
</CardHeader>
|
|
150
|
+
</Card>
|
|
151
|
+
|
|
152
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
153
|
+
<CardHeader>
|
|
154
|
+
<div className="w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4">
|
|
155
|
+
<Palette className="w-6 h-6 text-warning" />
|
|
156
|
+
</div>
|
|
157
|
+
<CardTitle>Tailwind CSS v4</CardTitle>
|
|
158
|
+
<CardDescription>
|
|
159
|
+
Framework CSS utility-first con DaisyUI y tema Huenei
|
|
160
|
+
personalizado.
|
|
161
|
+
</CardDescription>
|
|
162
|
+
</CardHeader>
|
|
163
|
+
</Card>
|
|
164
|
+
|
|
165
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
166
|
+
<CardHeader>
|
|
167
|
+
<div className="w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4">
|
|
168
|
+
<Code className="w-6 h-6 text-secondary" />
|
|
169
|
+
</div>
|
|
170
|
+
<CardTitle>shadcn/ui</CardTitle>
|
|
171
|
+
<CardDescription>
|
|
172
|
+
Componentes UI reutilizables construidos con Radix UI y Tailwind
|
|
173
|
+
CSS.
|
|
174
|
+
</CardDescription>
|
|
175
|
+
</CardHeader>
|
|
176
|
+
</Card>
|
|
177
|
+
|
|
178
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
179
|
+
<CardHeader>
|
|
180
|
+
<div className="w-12 h-12 bg-error/10 rounded-lg flex items-center justify-center mb-4">
|
|
181
|
+
<Table2 className="w-6 h-6 text-error" />
|
|
182
|
+
</div>
|
|
183
|
+
<CardTitle>TanStack Table + Query</CardTitle>
|
|
184
|
+
<CardDescription>
|
|
185
|
+
Tablas con ordenamiento/filtro y caché de datos client-side.
|
|
186
|
+
</CardDescription>
|
|
187
|
+
</CardHeader>
|
|
188
|
+
</Card>
|
|
189
|
+
|
|
190
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
191
|
+
<CardHeader>
|
|
192
|
+
<div className="w-12 h-12 bg-neutral/10 rounded-lg flex items-center justify-center mb-4">
|
|
193
|
+
<Settings className="w-6 h-6 text-neutral" />
|
|
194
|
+
</div>
|
|
195
|
+
<CardTitle>Docker Ready</CardTitle>
|
|
196
|
+
<CardDescription>
|
|
197
|
+
Dockerfile multi-stage, standalone output y Docker Compose para
|
|
198
|
+
MySQL.
|
|
199
|
+
</CardDescription>
|
|
200
|
+
</CardHeader>
|
|
201
|
+
</Card>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
{proyectosDestacados.length > 0 && (
|
|
205
|
+
<div className="mb-16">
|
|
206
|
+
<div className="flex items-center justify-between mb-6">
|
|
207
|
+
<div>
|
|
208
|
+
<h3 className="text-2xl font-bold text-base-content">
|
|
209
|
+
Proyectos destacados
|
|
210
|
+
</h3>
|
|
211
|
+
<p className="text-base-content/60 text-sm mt-1">
|
|
212
|
+
Algunos de nuestros trabajos más recientes
|
|
213
|
+
</p>
|
|
214
|
+
</div>
|
|
215
|
+
<Button variant="ghost" asChild>
|
|
216
|
+
<Link href="/proyectos" className="flex items-center gap-1">
|
|
217
|
+
Ver todos
|
|
218
|
+
<ArrowRight className="size-4" />
|
|
219
|
+
</Link>
|
|
220
|
+
</Button>
|
|
221
|
+
</div>
|
|
222
|
+
<div className="grid md:grid-cols-3 gap-6">
|
|
223
|
+
{proyectosDestacados.map((proyecto) => (
|
|
224
|
+
<Card
|
|
225
|
+
key={proyecto.id}
|
|
226
|
+
className="hover:shadow-lg transition-shadow"
|
|
227
|
+
>
|
|
228
|
+
<CardHeader className="pb-3">
|
|
229
|
+
<div className="flex items-start justify-between gap-2">
|
|
230
|
+
<CardTitle className="text-lg leading-tight">
|
|
231
|
+
{proyecto.titulo}
|
|
232
|
+
</CardTitle>
|
|
233
|
+
<Badge
|
|
234
|
+
className={`shrink-0 ${estadoBadgeClass(proyecto.estado)}`}
|
|
235
|
+
>
|
|
236
|
+
{proyecto.estado}
|
|
237
|
+
</Badge>
|
|
238
|
+
</div>
|
|
239
|
+
<CardDescription className="line-clamp-2 mt-1">
|
|
240
|
+
{proyecto.descripcion}
|
|
241
|
+
</CardDescription>
|
|
242
|
+
</CardHeader>
|
|
243
|
+
<CardContent className="space-y-3">
|
|
244
|
+
<div className="flex flex-wrap gap-1.5">
|
|
245
|
+
{proyecto.tecnologias.split(",").map((tech) => (
|
|
246
|
+
<Badge
|
|
247
|
+
key={tech.trim()}
|
|
248
|
+
variant="outline"
|
|
249
|
+
className="text-xs"
|
|
250
|
+
>
|
|
251
|
+
{tech.trim()}
|
|
252
|
+
</Badge>
|
|
253
|
+
))}
|
|
254
|
+
</div>
|
|
255
|
+
<div className="flex items-center justify-between text-sm text-base-content/60 pt-2 border-t border-base-200">
|
|
256
|
+
<span className="flex items-center gap-1">
|
|
257
|
+
<DollarSign className="size-3.5" />
|
|
258
|
+
{formatCurrency(proyecto.presupuesto)}
|
|
259
|
+
</span>
|
|
260
|
+
<span className="flex items-center gap-1">
|
|
261
|
+
<Calendar className="size-3.5" />
|
|
262
|
+
{new Date(proyecto.fecha).toLocaleDateString("es-AR", {
|
|
263
|
+
month: "short",
|
|
264
|
+
year: "numeric",
|
|
265
|
+
})}
|
|
266
|
+
</span>
|
|
267
|
+
</div>
|
|
268
|
+
</CardContent>
|
|
269
|
+
</Card>
|
|
270
|
+
))}
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
)}
|
|
274
|
+
|
|
275
|
+
<div className="grid md:grid-cols-2 gap-6 mb-16">
|
|
276
|
+
<Card>
|
|
277
|
+
<CardHeader>
|
|
278
|
+
<CardTitle>Requisitos previos</CardTitle>
|
|
279
|
+
<CardDescription>
|
|
280
|
+
Lo que necesitás para comenzar con este template
|
|
281
|
+
</CardDescription>
|
|
282
|
+
</CardHeader>
|
|
283
|
+
<CardContent>
|
|
284
|
+
<ul className="list-disc list-inside space-y-2 text-base-content/70">
|
|
285
|
+
<li>Node.js 20+</li>
|
|
286
|
+
<li>pnpm</li>
|
|
287
|
+
<li>Docker (para MySQL)</li>
|
|
288
|
+
<li>Conocimientos básicos de React y TypeScript</li>
|
|
289
|
+
</ul>
|
|
290
|
+
</CardContent>
|
|
291
|
+
</Card>
|
|
292
|
+
|
|
293
|
+
<Card>
|
|
294
|
+
<CardHeader>
|
|
295
|
+
<CardTitle>Comandos rápidos</CardTitle>
|
|
296
|
+
<CardDescription>
|
|
297
|
+
Scripts principales para desarrollo
|
|
298
|
+
</CardDescription>
|
|
299
|
+
</CardHeader>
|
|
300
|
+
<CardContent className="space-y-3">
|
|
301
|
+
<h3 className="text-base font-semibold mb-3">Levantar MySQL</h3>
|
|
302
|
+
<div className="bg-base-200 rounded-lg p-3 font-mono text-sm text-base-content">
|
|
303
|
+
<code>docker compose up -d</code>
|
|
304
|
+
</div>
|
|
305
|
+
<h3 className="text-base font-semibold mb-3">
|
|
306
|
+
Instalar y configurar
|
|
307
|
+
</h3>
|
|
308
|
+
<div className="bg-base-200 rounded-lg p-3 font-mono text-sm text-base-content">
|
|
309
|
+
<code>pnpm install && pnpm db:push && pnpm db:seed</code>
|
|
310
|
+
</div>
|
|
311
|
+
<h3 className="text-base font-semibold mb-3">
|
|
312
|
+
Ejecutar en desarrollo
|
|
313
|
+
</h3>
|
|
314
|
+
<div className="bg-base-200 rounded-lg p-3 font-mono text-sm text-base-content">
|
|
315
|
+
<code>pnpm dev</code>
|
|
316
|
+
</div>
|
|
317
|
+
<h3 className="text-base font-semibold mb-3">Ejecutar tests</h3>
|
|
318
|
+
<div className="bg-base-200 rounded-lg p-3 font-mono text-sm text-base-content">
|
|
319
|
+
<code>pnpm test</code>
|
|
320
|
+
</div>
|
|
321
|
+
</CardContent>
|
|
322
|
+
</Card>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
|
|
326
|
+
<footer className="bg-base-200 py-8 text-center text-base-content/50 text-sm">
|
|
327
|
+
<p>Huenei © {new Date().getFullYear()} - Template React SSR</p>
|
|
328
|
+
</footer>
|
|
329
|
+
</>
|
|
330
|
+
);
|
|
331
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { Badge } from "@/components/ui/badge";
|
|
3
|
+
import {
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
} from "@/components/ui/card";
|
|
10
|
+
import { Button } from "@/components/ui/button";
|
|
11
|
+
import {
|
|
12
|
+
Calendar,
|
|
13
|
+
DollarSign,
|
|
14
|
+
User,
|
|
15
|
+
ArrowRight,
|
|
16
|
+
FolderOpen,
|
|
17
|
+
} from "lucide-react";
|
|
18
|
+
import { Navbar } from "@/components/layout/navbar";
|
|
19
|
+
import { obtenerProyectosPublicos } from "@/actions/proyectos";
|
|
20
|
+
|
|
21
|
+
function estadoBadgeClass(estado: string): string {
|
|
22
|
+
switch (estado) {
|
|
23
|
+
case "En Producción":
|
|
24
|
+
return "badge-success";
|
|
25
|
+
case "En Desarrollo":
|
|
26
|
+
return "badge-warning";
|
|
27
|
+
case "Pausado":
|
|
28
|
+
return "badge-error";
|
|
29
|
+
default:
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function formatCurrency(value: number): string {
|
|
35
|
+
return new Intl.NumberFormat("es-AR", {
|
|
36
|
+
style: "currency",
|
|
37
|
+
currency: "USD",
|
|
38
|
+
minimumFractionDigits: 0,
|
|
39
|
+
}).format(value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default async function ProyectosPage() {
|
|
43
|
+
const proyectos = await obtenerProyectosPublicos();
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<Navbar />
|
|
48
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
|
|
49
|
+
<div className="text-center mb-12">
|
|
50
|
+
<h1 className="text-4xl font-bold text-base-content mb-4">
|
|
51
|
+
Nuestros Proyectos
|
|
52
|
+
</h1>
|
|
53
|
+
<p className="text-lg text-base-content/70 max-w-2xl mx-auto">
|
|
54
|
+
Conocé los proyectos en los que estamos trabajando, desde
|
|
55
|
+
plataformas en producción hasta nuevas iniciativas en desarrollo.
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div className="flex flex-wrap justify-center gap-3 mb-10">
|
|
60
|
+
{["En Producción", "En Desarrollo", "Pausado"].map((estado) => {
|
|
61
|
+
const count = proyectos.filter((p) => p.estado === estado).length;
|
|
62
|
+
return (
|
|
63
|
+
<Badge
|
|
64
|
+
key={estado}
|
|
65
|
+
variant="outline"
|
|
66
|
+
className="text-sm px-3 py-1"
|
|
67
|
+
>
|
|
68
|
+
{estado}: {count}
|
|
69
|
+
</Badge>
|
|
70
|
+
);
|
|
71
|
+
})}
|
|
72
|
+
<Badge variant="outline" className="text-sm px-3 py-1">
|
|
73
|
+
Total: {proyectos.length}
|
|
74
|
+
</Badge>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{proyectos.length === 0 ? (
|
|
78
|
+
<div className="flex flex-col items-center justify-center py-20 text-center">
|
|
79
|
+
<div className="flex size-16 items-center justify-center rounded-full bg-base-200 mb-4">
|
|
80
|
+
<FolderOpen className="size-8 text-base-content/40" />
|
|
81
|
+
</div>
|
|
82
|
+
<h3 className="text-lg font-semibold text-base-content mb-1">
|
|
83
|
+
Aún no hay proyectos publicados
|
|
84
|
+
</h3>
|
|
85
|
+
<p className="text-sm text-base-content/60 max-w-sm">
|
|
86
|
+
Los proyectos aparecerán acá una vez que el equipo los cargue en
|
|
87
|
+
el sistema.
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
) : (
|
|
91
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
92
|
+
{proyectos.map((proyecto) => (
|
|
93
|
+
<Card
|
|
94
|
+
key={proyecto.id}
|
|
95
|
+
className="hover:shadow-lg transition-shadow flex flex-col"
|
|
96
|
+
>
|
|
97
|
+
<CardHeader className="pb-3">
|
|
98
|
+
<div className="flex items-start justify-between gap-2">
|
|
99
|
+
<CardTitle className="text-lg leading-tight">
|
|
100
|
+
{proyecto.titulo}
|
|
101
|
+
</CardTitle>
|
|
102
|
+
<Badge
|
|
103
|
+
className={`shrink-0 ${estadoBadgeClass(proyecto.estado)}`}
|
|
104
|
+
>
|
|
105
|
+
{proyecto.estado}
|
|
106
|
+
</Badge>
|
|
107
|
+
</div>
|
|
108
|
+
<CardDescription className="line-clamp-2 mt-1">
|
|
109
|
+
{proyecto.descripcion}
|
|
110
|
+
</CardDescription>
|
|
111
|
+
</CardHeader>
|
|
112
|
+
<CardContent className="flex-1 flex flex-col justify-end gap-3">
|
|
113
|
+
<div className="flex flex-wrap gap-1.5">
|
|
114
|
+
{proyecto.tecnologias.split(",").map((tech) => (
|
|
115
|
+
<Badge
|
|
116
|
+
key={tech.trim()}
|
|
117
|
+
variant="outline"
|
|
118
|
+
className="text-xs"
|
|
119
|
+
>
|
|
120
|
+
{tech.trim()}
|
|
121
|
+
</Badge>
|
|
122
|
+
))}
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div className="flex items-center justify-between text-sm text-base-content/60 pt-2 border-t border-base-200">
|
|
126
|
+
<span className="flex items-center gap-1">
|
|
127
|
+
<DollarSign className="size-3.5" />
|
|
128
|
+
{formatCurrency(proyecto.presupuesto)}
|
|
129
|
+
</span>
|
|
130
|
+
<span className="flex items-center gap-1">
|
|
131
|
+
<Calendar className="size-3.5" />
|
|
132
|
+
{new Date(proyecto.fecha).toLocaleDateString("es-AR", {
|
|
133
|
+
month: "short",
|
|
134
|
+
year: "numeric",
|
|
135
|
+
})}
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div className="flex items-center gap-1 text-xs text-base-content/50">
|
|
140
|
+
<User className="size-3" />
|
|
141
|
+
{proyecto.user.name ?? "Anónimo"}
|
|
142
|
+
</div>
|
|
143
|
+
</CardContent>
|
|
144
|
+
</Card>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
|
|
149
|
+
<div className="text-center mt-16">
|
|
150
|
+
<Card className="bg-primary border-0 text-primary-content inline-block">
|
|
151
|
+
<CardContent className="py-8 px-12">
|
|
152
|
+
<h3 className="text-2xl font-bold mb-3">
|
|
153
|
+
¿Tenés un proyecto en mente?
|
|
154
|
+
</h3>
|
|
155
|
+
<p className="text-primary-content/80 mb-5">
|
|
156
|
+
Contactanos y te ayudamos a hacerlo realidad.
|
|
157
|
+
</p>
|
|
158
|
+
<Button
|
|
159
|
+
variant="ghost"
|
|
160
|
+
className="bg-base-100 text-primary hover:bg-base-200"
|
|
161
|
+
asChild
|
|
162
|
+
>
|
|
163
|
+
<Link href="/contacto">
|
|
164
|
+
Contactanos
|
|
165
|
+
<ArrowRight className="size-4 ml-2" />
|
|
166
|
+
</Link>
|
|
167
|
+
</Button>
|
|
168
|
+
</CardContent>
|
|
169
|
+
</Card>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<footer className="bg-base-200 py-8 text-center text-base-content/50 text-sm">
|
|
174
|
+
<p>Huenei © {new Date().getFullYear()} - Template React SSR</p>
|
|
175
|
+
</footer>
|
|
176
|
+
</>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import NextAuth from "next-auth";
|
|
2
|
+
import Credentials from "next-auth/providers/credentials";
|
|
3
|
+
import { PrismaAdapter } from "@auth/prisma-adapter";
|
|
4
|
+
import bcrypt from "bcryptjs";
|
|
5
|
+
import { prisma } from "@/lib/prisma";
|
|
6
|
+
|
|
7
|
+
export const { handlers, auth, signIn, signOut } = NextAuth({
|
|
8
|
+
adapter: PrismaAdapter(prisma),
|
|
9
|
+
session: { strategy: "jwt" },
|
|
10
|
+
pages: {
|
|
11
|
+
signIn: "/auth/iniciar-sesion",
|
|
12
|
+
},
|
|
13
|
+
providers: [
|
|
14
|
+
Credentials({
|
|
15
|
+
credentials: {
|
|
16
|
+
email: { label: "Email", type: "email" },
|
|
17
|
+
password: { label: "Password", type: "password" },
|
|
18
|
+
},
|
|
19
|
+
async authorize(credentials) {
|
|
20
|
+
if (!credentials?.email || !credentials?.password) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const user = await prisma.user.findUnique({
|
|
25
|
+
where: { email: credentials.email as string },
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (!user || !user.password) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const isValid = await bcrypt.compare(
|
|
33
|
+
credentials.password as string,
|
|
34
|
+
user.password,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (!isValid) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
id: user.id,
|
|
43
|
+
email: user.email,
|
|
44
|
+
name: user.name,
|
|
45
|
+
image: user.image,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
],
|
|
50
|
+
callbacks: {
|
|
51
|
+
jwt({ token, user }) {
|
|
52
|
+
if (user) {
|
|
53
|
+
token.id = user.id;
|
|
54
|
+
}
|
|
55
|
+
return token;
|
|
56
|
+
},
|
|
57
|
+
session({ session, token }) {
|
|
58
|
+
if (session.user) {
|
|
59
|
+
session.user.id = token.id as string;
|
|
60
|
+
}
|
|
61
|
+
return session;
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { auth } from "@/auth";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
4
|
+
import { LogOut, LayoutDashboard } from "lucide-react";
|
|
5
|
+
import { SignOutButton } from "./sign-out-button";
|
|
6
|
+
|
|
7
|
+
export async function Navbar() {
|
|
8
|
+
const session = await auth();
|
|
9
|
+
const isAuthenticated = !!session?.user;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<header className="bg-base-100 shadow-sm">
|
|
13
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
14
|
+
<div className="flex justify-between items-center py-6">
|
|
15
|
+
<div className="flex items-center">
|
|
16
|
+
<Link href="/" className="text-2xl font-bold text-base-content">
|
|
17
|
+
Huenei
|
|
18
|
+
</Link>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<nav className="hidden md:flex space-x-8">
|
|
22
|
+
<Link
|
|
23
|
+
href="/"
|
|
24
|
+
className="text-base-content/70 hover:text-base-content transition-colors"
|
|
25
|
+
>
|
|
26
|
+
Inicio
|
|
27
|
+
</Link>
|
|
28
|
+
<Link
|
|
29
|
+
href="/proyectos"
|
|
30
|
+
className="text-base-content/70 hover:text-base-content transition-colors"
|
|
31
|
+
>
|
|
32
|
+
Proyectos
|
|
33
|
+
</Link>
|
|
34
|
+
<Link
|
|
35
|
+
href="/contacto"
|
|
36
|
+
className="text-base-content/70 hover:text-base-content transition-colors"
|
|
37
|
+
>
|
|
38
|
+
Contacto
|
|
39
|
+
</Link>
|
|
40
|
+
</nav>
|
|
41
|
+
|
|
42
|
+
<div className="flex items-center gap-3">
|
|
43
|
+
{isAuthenticated ? (
|
|
44
|
+
<>
|
|
45
|
+
<Button variant="ghost" asChild>
|
|
46
|
+
<Link href="/dashboard" className="flex items-center gap-2">
|
|
47
|
+
<LayoutDashboard className="h-4 w-4" />
|
|
48
|
+
Dashboard
|
|
49
|
+
</Link>
|
|
50
|
+
</Button>
|
|
51
|
+
<SignOutButton />
|
|
52
|
+
</>
|
|
53
|
+
) : (
|
|
54
|
+
<>
|
|
55
|
+
<Button variant="ghost" asChild>
|
|
56
|
+
<Link href="/auth/iniciar-sesion">Iniciar Sesión</Link>
|
|
57
|
+
</Button>
|
|
58
|
+
<Button asChild>
|
|
59
|
+
<Link href="/auth/registro">Registrarse</Link>
|
|
60
|
+
</Button>
|
|
61
|
+
</>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</header>
|
|
67
|
+
);
|
|
68
|
+
}
|