create-huenei-template 0.2.2
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/README.md +132 -0
- package/bin/create-huenei-template.js +2 -0
- package/dist/config/templates.js +54 -0
- package/dist/core/dependency-manager.js +55 -0
- package/dist/core/errors.js +43 -0
- package/dist/core/file-operations.js +25 -0
- package/dist/core/prompts.js +183 -0
- package/dist/core/template-resolver.js +18 -0
- package/dist/index.js +85 -0
- package/dist/templates/backend/.gitkeep +1 -0
- package/dist/templates/backend/nestjs-api/.prettierrc +4 -0
- package/dist/templates/backend/nestjs-api/README.md +98 -0
- package/dist/templates/backend/nestjs-api/eslint.config.mjs +35 -0
- package/dist/templates/backend/nestjs-api/nest-cli.json +8 -0
- package/dist/templates/backend/nestjs-api/package.json +71 -0
- package/dist/templates/backend/nestjs-api/pnpm-lock.yaml +6233 -0
- package/dist/templates/backend/nestjs-api/src/app.controller.spec.ts +22 -0
- package/dist/templates/backend/nestjs-api/src/app.controller.ts +12 -0
- package/dist/templates/backend/nestjs-api/src/app.module.ts +10 -0
- package/dist/templates/backend/nestjs-api/src/app.service.ts +8 -0
- package/dist/templates/backend/nestjs-api/src/main.ts +8 -0
- package/dist/templates/backend/nestjs-api/test/app.e2e-spec.ts +25 -0
- package/dist/templates/backend/nestjs-api/test/jest-e2e.json +9 -0
- package/dist/templates/backend/nestjs-api/tsconfig.build.json +4 -0
- package/dist/templates/backend/nestjs-api/tsconfig.json +25 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/commands/new-endpoint.md +209 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/commands/new-model.md +201 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/api-rest.mdc +126 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/authentication-security.mdc +86 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/dto-validation.mdc +93 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/general-rules.mdc +126 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/prisma-standards.mdc +90 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/rules/swagger-documentation.mdc +90 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/postgresql-table-design/SKILL.md +202 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/dist/templates/backend/nestjs-api-postgres/.dockerignore +50 -0
- package/dist/templates/backend/nestjs-api-postgres/.env.example +18 -0
- package/dist/templates/backend/nestjs-api-postgres/.env.test +18 -0
- package/dist/templates/backend/nestjs-api-postgres/.prettierrc +4 -0
- package/dist/templates/backend/nestjs-api-postgres/README.md +1502 -0
- package/dist/templates/backend/nestjs-api-postgres/docker-compose.yml +24 -0
- package/dist/templates/backend/nestjs-api-postgres/eslint.config.mjs +41 -0
- package/dist/templates/backend/nestjs-api-postgres/nest-cli.json +8 -0
- package/dist/templates/backend/nestjs-api-postgres/package.json +107 -0
- package/dist/templates/backend/nestjs-api-postgres/prisma/migrations/20260126125423_init/migration.sql +84 -0
- package/dist/templates/backend/nestjs-api-postgres/prisma/migrations/migration_lock.toml +3 -0
- package/dist/templates/backend/nestjs-api-postgres/prisma/schema.prisma +76 -0
- package/dist/templates/backend/nestjs-api-postgres/prisma/seed.ts +220 -0
- package/dist/templates/backend/nestjs-api-postgres/prisma.config.ts +10 -0
- package/dist/templates/backend/nestjs-api-postgres/src/app.module.ts +39 -0
- package/dist/templates/backend/nestjs-api-postgres/src/app.service.ts +8 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/auth.controller.ts +36 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/auth.module.ts +22 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/auth.service.ts +63 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/decorators/roles.decorator.ts +5 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/dto/login-response.dto.ts +23 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/dto/login.dto.ts +27 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/guards/roles.guard.ts +23 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/strategies/jwt.strategy.ts +32 -0
- package/dist/templates/backend/nestjs-api-postgres/src/auth/types.ts +18 -0
- package/dist/templates/backend/nestjs-api-postgres/src/common/dto/paginated-response.dto.ts +16 -0
- package/dist/templates/backend/nestjs-api-postgres/src/common/dto/pagination.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-postgres/src/common/filters/http-exception.filter.ts +53 -0
- package/dist/templates/backend/nestjs-api-postgres/src/config/env.validation.ts +41 -0
- package/dist/templates/backend/nestjs-api-postgres/src/health/health.controller.ts +35 -0
- package/dist/templates/backend/nestjs-api-postgres/src/health/health.module.ts +7 -0
- package/dist/templates/backend/nestjs-api-postgres/src/main.ts +87 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/dto/create-post.dto.ts +32 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/dto/post-response.dto.ts +41 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/dto/update-post.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/posts.controller.ts +161 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/posts.module.ts +12 -0
- package/dist/templates/backend/nestjs-api-postgres/src/posts/posts.service.ts +171 -0
- package/dist/templates/backend/nestjs-api-postgres/src/prisma/prisma.module.ts +9 -0
- package/dist/templates/backend/nestjs-api-postgres/src/prisma/prisma.service.ts +27 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/constants/settings.constants.ts +9 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/dto/profile-response.dto.ts +39 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/dto/settings-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/dto/update-profile.dto.ts +48 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/dto/update-settings.dto.ts +40 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/dto/user-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/profile.service.ts +49 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/settings.service.ts +82 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/users.controller.ts +102 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/users.module.ts +14 -0
- package/dist/templates/backend/nestjs-api-postgres/src/users/users.service.ts +27 -0
- package/dist/templates/backend/nestjs-api-postgres/test/README.md +412 -0
- package/dist/templates/backend/nestjs-api-postgres/test/e2e/auth.e2e-spec.ts +147 -0
- package/dist/templates/backend/nestjs-api-postgres/test/e2e/health.e2e-spec.ts +62 -0
- package/dist/templates/backend/nestjs-api-postgres/test/e2e/posts.e2e-spec.ts +407 -0
- package/dist/templates/backend/nestjs-api-postgres/test/e2e/users.e2e-spec.ts +287 -0
- package/dist/templates/backend/nestjs-api-postgres/test/fixtures/test-data.ts +109 -0
- package/dist/templates/backend/nestjs-api-postgres/test/helpers/auth.helper.ts +54 -0
- package/dist/templates/backend/nestjs-api-postgres/test/helpers/db.helper.ts +73 -0
- package/dist/templates/backend/nestjs-api-postgres/test/jest-e2e.json +12 -0
- package/dist/templates/backend/nestjs-api-postgres/test/setup-e2e.ts +8 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/app.service.spec.ts +24 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/auth.controller.spec.ts +91 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/auth.service.spec.ts +161 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/health.controller.spec.ts +78 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/http-exception.filter.spec.ts +150 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/jwt.strategy.spec.ts +41 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/posts.controller.spec.ts +249 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/posts.service.spec.ts +328 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/profile.service.spec.ts +146 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/settings.service.spec.ts +242 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/users.controller.spec.ts +178 -0
- package/dist/templates/backend/nestjs-api-postgres/test/unit/users.service.spec.ts +96 -0
- package/dist/templates/backend/nestjs-api-postgres/tsconfig.build.json +4 -0
- package/dist/templates/backend/nestjs-api-postgres/tsconfig.json +28 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/commands/new-endpoint.md +209 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/commands/new-model.md +201 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/api-rest.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/authentication-security.mdc +86 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/dto-validation.mdc +93 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/general-rules.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/prisma-standards.mdc +90 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/rules/swagger-documentation.mdc +90 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/dist/templates/backend/nestjs-api-sqlite/.env.example +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/.env.test +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/.prettierrc +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/FINAL_IMPLEMENTATION_SUMMARY.md +537 -0
- package/dist/templates/backend/nestjs-api-sqlite/IMPLEMENTATION_REPORT.md +229 -0
- package/dist/templates/backend/nestjs-api-sqlite/IMPLEMENTATION_SUMMARY.md +275 -0
- package/dist/templates/backend/nestjs-api-sqlite/PRISMA_7_MIGRATION.md +175 -0
- package/dist/templates/backend/nestjs-api-sqlite/README.md +1464 -0
- package/dist/templates/backend/nestjs-api-sqlite/SWAGGER_INTEGRATION.md +194 -0
- package/dist/templates/backend/nestjs-api-sqlite/TESTING_IMPLEMENTATION_REPORT.md +368 -0
- package/dist/templates/backend/nestjs-api-sqlite/TESTING_SUMMARY.md +293 -0
- package/dist/templates/backend/nestjs-api-sqlite/Untitled +218 -0
- package/dist/templates/backend/nestjs-api-sqlite/eslint.config.mjs +41 -0
- package/dist/templates/backend/nestjs-api-sqlite/nest-cli.json +8 -0
- package/dist/templates/backend/nestjs-api-sqlite/package.json +105 -0
- package/dist/templates/backend/nestjs-api-sqlite/pnpm-lock.yaml +7630 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/20260123190258_init/migration.sql +12 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/20260123205000_add_roles_and_posts/migration.sql +32 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124163749_init_with_profile_and_settings/migration.sql +33 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124190929_add_render_model/migration.sql +13 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124200534_add_post_indexes/migration.sql +16 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/migrations/migration_lock.toml +3 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +76 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/seed.ts +218 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma.config.ts +10 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/app.module.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/app.service.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/auth.controller.ts +36 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/auth.module.ts +22 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/auth.service.ts +63 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/decorators/roles.decorator.ts +5 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/dto/login-response.dto.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/dto/login.dto.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/guards/roles.guard.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/strategies/jwt.strategy.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/auth/types.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/common/dto/paginated-response.dto.ts +16 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/common/dto/pagination.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/common/filters/http-exception.filter.ts +53 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/config/env.validation.ts +35 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/health/health.controller.ts +35 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/health/health.module.ts +7 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/main.ts +87 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/dto/create-post.dto.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/dto/update-post.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/posts.controller.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/posts.module.ts +12 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/posts.service.ts +171 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/prisma/prisma.module.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/prisma/prisma.service.ts +29 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/constants/settings.constants.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/settings-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +48 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/update-settings.dto.ts +40 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +49 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/settings.service.ts +82 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/users.controller.ts +102 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/users.module.ts +14 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/README.md +412 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/e2e/auth.e2e-spec.ts +147 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/e2e/health.e2e-spec.ts +62 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/e2e/posts.e2e-spec.ts +407 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/e2e/users.e2e-spec.ts +287 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/fixtures/test-data.ts +109 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/helpers/auth.helper.ts +54 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/helpers/db.helper.ts +72 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/jest-e2e.json +12 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/setup-e2e.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/app.service.spec.ts +24 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/auth.controller.spec.ts +91 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/auth.service.spec.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/health.controller.spec.ts +78 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/http-exception.filter.spec.ts +150 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/jwt.strategy.spec.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/posts.controller.spec.ts +249 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/posts.service.spec.ts +328 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/profile.service.spec.ts +146 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/settings.service.spec.ts +242 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/users.controller.spec.ts +178 -0
- package/dist/templates/backend/nestjs-api-sqlite/test/unit/users.service.spec.ts +96 -0
- package/dist/templates/backend/nestjs-api-sqlite/tsconfig.build.json +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/tsconfig.json +28 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-component/SKILL.md +288 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-component/references/component-patterns.md +358 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-di/SKILL.md +387 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-di/references/di-patterns.md +519 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-directives/SKILL.md +437 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-directives/references/directive-patterns.md +570 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-forms/SKILL.md +434 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-forms/references/form-patterns.md +398 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-http/SKILL.md +366 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-http/references/http-patterns.md +448 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-routing/SKILL.md +395 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-routing/references/routing-patterns.md +472 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-signals/SKILL.md +302 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-signals/references/signal-patterns.md +404 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-ssr/SKILL.md +435 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-ssr/references/ssr-patterns.md +497 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-testing/SKILL.md +660 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-testing/references/testing-patterns.md +707 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-tooling/SKILL.md +352 -0
- package/dist/templates/frontend/angular-base/.agents/skills/angular-tooling/references/tooling-patterns.md +448 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-accessibility/SKILL.md +780 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-components/SKILL.md +718 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-animations/SKILL.md +432 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-debugging/SKILL.md +354 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-framework-integration/SKILL.md +578 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-mobile-first/SKILL.md +768 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-performance/SKILL.md +374 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-plugins/SKILL.md +505 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
- package/dist/templates/frontend/angular-base/.agents/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
- package/dist/templates/frontend/angular-base/.agents/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/templates/frontend/angular-base/.cursor/mcp.json +12 -0
- package/dist/templates/frontend/angular-base/.cursor/rules/angular-expert.mdc +153 -0
- package/dist/templates/frontend/angular-base/.editorconfig +17 -0
- package/dist/templates/frontend/angular-base/.eslintrc.json +52 -0
- package/dist/templates/frontend/angular-base/.github/workflows/ci.yml +122 -0
- package/dist/templates/frontend/angular-base/.husky/pre-commit +1 -0
- package/dist/templates/frontend/angular-base/.husky/pre-push +1 -0
- package/dist/templates/frontend/angular-base/.postcssrc.json +5 -0
- package/dist/templates/frontend/angular-base/.prettierignore +8 -0
- package/dist/templates/frontend/angular-base/.prettierrc.json +15 -0
- package/dist/templates/frontend/angular-base/.vscode/extensions.json +4 -0
- package/dist/templates/frontend/angular-base/.vscode/launch.json +20 -0
- package/dist/templates/frontend/angular-base/.vscode/mcp.json +9 -0
- package/dist/templates/frontend/angular-base/.vscode/tasks.json +42 -0
- package/dist/templates/frontend/angular-base/CONTRIBUTING.md +230 -0
- package/dist/templates/frontend/angular-base/README.md +383 -0
- package/dist/templates/frontend/angular-base/angular.json +84 -0
- package/dist/templates/frontend/angular-base/cypress/e2e/app.cy.ts +39 -0
- package/dist/templates/frontend/angular-base/cypress/e2e/auth.cy.ts +196 -0
- package/dist/templates/frontend/angular-base/cypress/e2e/dashboard.cy.ts +56 -0
- package/dist/templates/frontend/angular-base/cypress/e2e/home.cy.ts +35 -0
- package/dist/templates/frontend/angular-base/cypress/fixtures/example.json +4 -0
- package/dist/templates/frontend/angular-base/cypress/support/commands.ts +8 -0
- package/dist/templates/frontend/angular-base/cypress/support/e2e.ts +11 -0
- package/dist/templates/frontend/angular-base/cypress.config.ts +11 -0
- package/dist/templates/frontend/angular-base/docs/ARCHITECTURE.md +337 -0
- package/dist/templates/frontend/angular-base/docs/AUTHENTICATION.md +491 -0
- package/dist/templates/frontend/angular-base/docs/DEPLOYMENT.md +507 -0
- package/dist/templates/frontend/angular-base/docs/FEATURES.md +404 -0
- package/dist/templates/frontend/angular-base/docs/TESTING.md +418 -0
- package/dist/templates/frontend/angular-base/docs/THEMING.md +333 -0
- package/dist/templates/frontend/angular-base/docs/UI_LIBRARIES.md +380 -0
- package/dist/templates/frontend/angular-base/docs/USER_PROFILE_FLOW.md +431 -0
- package/dist/templates/frontend/angular-base/package-lock.json +13321 -0
- package/dist/templates/frontend/angular-base/package.json +93 -0
- package/dist/templates/frontend/angular-base/public/favicon.ico +0 -0
- package/dist/templates/frontend/angular-base/src/app/app.config.server.ts +14 -0
- package/dist/templates/frontend/angular-base/src/app/app.config.ts +32 -0
- package/dist/templates/frontend/angular-base/src/app/app.css +0 -0
- package/dist/templates/frontend/angular-base/src/app/app.html +1 -0
- package/dist/templates/frontend/angular-base/src/app/app.routes.server.ts +28 -0
- package/dist/templates/frontend/angular-base/src/app/app.routes.ts +67 -0
- package/dist/templates/frontend/angular-base/src/app/app.spec.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/app.ts +12 -0
- package/dist/templates/frontend/angular-base/src/app/core/guards/admin.guard.ts +16 -0
- package/dist/templates/frontend/angular-base/src/app/core/guards/auth.guard.spec.ts +43 -0
- package/dist/templates/frontend/angular-base/src/app/core/guards/auth.guard.ts +15 -0
- package/dist/templates/frontend/angular-base/src/app/core/index.ts +10 -0
- package/dist/templates/frontend/angular-base/src/app/core/interceptors/http-error.interceptor.spec.ts +43 -0
- package/dist/templates/frontend/angular-base/src/app/core/interceptors/http-error.interceptor.ts +53 -0
- package/dist/templates/frontend/angular-base/src/app/core/services/auth.service.spec.ts +33 -0
- package/dist/templates/frontend/angular-base/src/app/core/services/auth.service.ts +91 -0
- package/dist/templates/frontend/angular-base/src/app/core/services/theme.service.spec.ts +33 -0
- package/dist/templates/frontend/angular-base/src/app/core/services/theme.service.ts +136 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/routes.ts +21 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/users/models/admin-user.model.ts +32 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/users/pages/user-form.page.ts +279 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/users/pages/user-list.page.ts +336 -0
- package/dist/templates/frontend/angular-base/src/app/features/admin/users/services/admin-user.service.ts +151 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/index.ts +2 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/models/auth.model.ts +39 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/login.page.spec.ts +44 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/login.page.ts +187 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/password-recovery.page.spec.ts +48 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/password-recovery.page.ts +171 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/signup.page.spec.ts +53 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/pages/signup.page.ts +269 -0
- package/dist/templates/frontend/angular-base/src/app/features/auth/routes.ts +22 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/models/customer.model.ts +41 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/pages/customer-detail.page.ts +299 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/pages/customer-form.page.ts +302 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/pages/customer-list.page.ts +439 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/routes.ts +21 -0
- package/dist/templates/frontend/angular-base/src/app/features/customers/services/customer.service.ts +162 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/components/stats-card/stats-card.component.spec.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/components/stats-card/stats-card.component.ts +52 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/index.ts +1 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/pages/dashboard.page.spec.ts +21 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/pages/dashboard.page.ts +122 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/routes.ts +8 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/services/dashboard.service.spec.ts +37 -0
- package/dist/templates/frontend/angular-base/src/app/features/dashboard/services/dashboard.service.ts +48 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/index.ts +1 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/pages/forbidden.page.ts +50 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/pages/maintenance.page.ts +46 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/pages/not-found.page.ts +49 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/pages/server-error.page.ts +60 -0
- package/dist/templates/frontend/angular-base/src/app/features/errors/routes.ts +25 -0
- package/dist/templates/frontend/angular-base/src/app/features/home/index.ts +1 -0
- package/dist/templates/frontend/angular-base/src/app/features/home/pages/home.page.spec.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/features/home/pages/home.page.ts +105 -0
- package/dist/templates/frontend/angular-base/src/app/features/home/routes.ts +8 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/models/project.model.ts +48 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/pages/project-detail.page.ts +444 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/pages/project-form.page.ts +393 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/pages/project-list.page.ts +411 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/routes.ts +21 -0
- package/dist/templates/frontend/angular-base/src/app/features/projects/services/project.service.ts +227 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/models/report.model.ts +27 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/pages/analytics.page.html +246 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/pages/analytics.page.ts +135 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/routes.ts +13 -0
- package/dist/templates/frontend/angular-base/src/app/features/reports/services/report.service.ts +141 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/models/user.model.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/privacy.page.spec.ts +27 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/privacy.page.ts +414 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/profile.page.spec.ts +39 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/profile.page.ts +232 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/settings.page.spec.ts +28 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/pages/settings.page.ts +284 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/routes.ts +21 -0
- package/dist/templates/frontend/angular-base/src/app/features/user/services/user.service.ts +74 -0
- package/dist/templates/frontend/angular-base/src/app/layout/footer/footer.component.spec.ts +25 -0
- package/dist/templates/frontend/angular-base/src/app/layout/footer/footer.component.ts +67 -0
- package/dist/templates/frontend/angular-base/src/app/layout/index.ts +3 -0
- package/dist/templates/frontend/angular-base/src/app/layout/main-layout/main-layout.component.spec.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/layout/main-layout/main-layout.component.ts +30 -0
- package/dist/templates/frontend/angular-base/src/app/layout/navbar/navbar.component.spec.ts +23 -0
- package/dist/templates/frontend/angular-base/src/app/layout/navbar/navbar.component.ts +293 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/badge/badge.component.spec.ts +36 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/badge/badge.component.ts +70 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/button/button.component.spec.ts +44 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/button/button.component.ts +64 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/card/card.component.spec.ts +29 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/card/card.component.ts +60 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/data-table/data-table.component.spec.ts +49 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/data-table/data-table.component.ts +280 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/empty-state/empty-state.component.spec.ts +36 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/empty-state/empty-state.component.ts +56 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/modal/modal.component.spec.ts +32 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/modal/modal.component.ts +131 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/pagination/pagination.component.spec.ts +38 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/pagination/pagination.component.ts +194 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/search-input/search-input.component.spec.ts +37 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/search-input/search-input.component.ts +125 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/skeleton-loader/skeleton-loader.component.spec.ts +30 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/skeleton-loader/skeleton-loader.component.ts +55 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/toggle/toggle.component.spec.ts +49 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/toggle/toggle.component.ts +101 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/user-dropdown/user-dropdown.component.spec.ts +65 -0
- package/dist/templates/frontend/angular-base/src/app/shared/components/user-dropdown/user-dropdown.component.ts +219 -0
- package/dist/templates/frontend/angular-base/src/app/shared/directives/auto-focus.directive.spec.ts +33 -0
- package/dist/templates/frontend/angular-base/src/app/shared/directives/auto-focus.directive.ts +25 -0
- package/dist/templates/frontend/angular-base/src/app/shared/index.ts +18 -0
- package/dist/templates/frontend/angular-base/src/app/shared/pipes/date-format.pipe.spec.ts +29 -0
- package/dist/templates/frontend/angular-base/src/app/shared/pipes/date-format.pipe.ts +39 -0
- package/dist/templates/frontend/angular-base/src/environments/environment.development.ts +4 -0
- package/dist/templates/frontend/angular-base/src/environments/environment.ts +4 -0
- package/dist/templates/frontend/angular-base/src/index.html +44 -0
- package/dist/templates/frontend/angular-base/src/main.server.ts +7 -0
- package/dist/templates/frontend/angular-base/src/main.ts +5 -0
- package/dist/templates/frontend/angular-base/src/server.ts +66 -0
- package/dist/templates/frontend/angular-base/src/styles.css +209 -0
- package/dist/templates/frontend/angular-base/src/test-setup.ts +10 -0
- package/dist/templates/frontend/angular-base/tsconfig.app.json +17 -0
- package/dist/templates/frontend/angular-base/tsconfig.json +41 -0
- package/dist/templates/frontend/angular-base/tsconfig.spec.json +15 -0
- package/dist/templates/frontend/angular-base/vitest.config.ts +25 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/architecture/SKILL.md +26 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/daisyui/SKILL.md +98 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/routing/SKILL.md +32 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/testing/SKILL.md +55 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/dist/templates/frontend/react-vite/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/dist/templates/frontend/react-vite/.prettierrc +6 -0
- package/dist/templates/frontend/react-vite/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/dist/templates/frontend/react-vite/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/dist/templates/frontend/react-vite/.vscode/extensions.json +7 -0
- package/dist/templates/frontend/react-vite/README.md +75 -0
- package/dist/templates/frontend/react-vite/components.json +22 -0
- package/dist/templates/frontend/react-vite/eslint.config.js +31 -0
- package/dist/templates/frontend/react-vite/index.html +13 -0
- package/dist/templates/frontend/react-vite/package.json +62 -0
- package/dist/templates/frontend/react-vite/pnpm-lock.yaml +4487 -0
- package/dist/templates/frontend/react-vite/pnpm-workspace.yaml +2 -0
- package/dist/templates/frontend/react-vite/src/assets/react.svg +1 -0
- package/dist/templates/frontend/react-vite/src/components/ui/badge.tsx +37 -0
- package/dist/templates/frontend/react-vite/src/components/ui/breadcrumb.tsx +106 -0
- package/dist/templates/frontend/react-vite/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-vite/src/components/ui/card.tsx +72 -0
- package/dist/templates/frontend/react-vite/src/components/ui/form.tsx +165 -0
- package/dist/templates/frontend/react-vite/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-vite/src/components/ui/label.tsx +24 -0
- package/dist/templates/frontend/react-vite/src/components/ui/password-input.tsx +41 -0
- package/dist/templates/frontend/react-vite/src/components/ui/separator.tsx +28 -0
- package/dist/templates/frontend/react-vite/src/components/ui/tabs.tsx +62 -0
- package/dist/templates/frontend/react-vite/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-vite/src/index.css +104 -0
- package/dist/templates/frontend/react-vite/src/lib/queryClient.ts +11 -0
- package/dist/templates/frontend/react-vite/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-vite/src/main.tsx +33 -0
- package/dist/templates/frontend/react-vite/src/routeTree.gen.ts +77 -0
- package/dist/templates/frontend/react-vite/src/router.tsx +13 -0
- package/dist/templates/frontend/react-vite/src/routes/__root.tsx +82 -0
- package/dist/templates/frontend/react-vite/src/routes/index.tsx +187 -0
- package/dist/templates/frontend/react-vite/src/routes/otra-ruta.tsx +319 -0
- package/dist/templates/frontend/react-vite/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-vite/tsconfig.app.json +34 -0
- package/dist/templates/frontend/react-vite/tsconfig.json +10 -0
- package/dist/templates/frontend/react-vite/tsconfig.node.json +26 -0
- package/dist/templates/frontend/react-vite/vite.config.ts +22 -0
- package/dist/templates/frontend/react-vite/vitest.config.ts +9 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/architecture/SKILL.md +26 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/daisyui/SKILL.md +98 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/routing/SKILL.md +32 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/testing/SKILL.md +55 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/dist/templates/frontend/react-vite-help/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/dist/templates/frontend/react-vite-help/.prettierrc +6 -0
- package/dist/templates/frontend/react-vite-help/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/dist/templates/frontend/react-vite-help/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/dist/templates/frontend/react-vite-help/.vscode/extensions.json +7 -0
- package/dist/templates/frontend/react-vite-help/README.md +75 -0
- package/dist/templates/frontend/react-vite-help/components.json +22 -0
- package/dist/templates/frontend/react-vite-help/eslint.config.js +31 -0
- package/dist/templates/frontend/react-vite-help/index.html +13 -0
- package/dist/templates/frontend/react-vite-help/package.json +62 -0
- package/dist/templates/frontend/react-vite-help/pnpm-lock.yaml +4487 -0
- package/dist/templates/frontend/react-vite-help/pnpm-workspace.yaml +2 -0
- package/dist/templates/frontend/react-vite-help/src/assets/react.svg +1 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/entorno.tsx +99 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/estructura.tsx +100 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/figma-mcp.tsx +200 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/inicio.tsx +69 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/instalacion.tsx +72 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/personalizacion.tsx +163 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/rutas.tsx +138 -0
- package/dist/templates/frontend/react-vite-help/src/components/documentacion/stack.tsx +401 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/badge.tsx +37 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/breadcrumb.tsx +106 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/card.tsx +72 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/form.tsx +165 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/label.tsx +24 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/password-input.tsx +41 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/separator.tsx +28 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/tabs.tsx +62 -0
- package/dist/templates/frontend/react-vite-help/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-vite-help/src/data/proyectos.json +56 -0
- package/dist/templates/frontend/react-vite-help/src/index.css +104 -0
- package/dist/templates/frontend/react-vite-help/src/lib/queryClient.ts +11 -0
- package/dist/templates/frontend/react-vite-help/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-vite-help/src/main.tsx +33 -0
- package/dist/templates/frontend/react-vite-help/src/routeTree.gen.ts +241 -0
- package/dist/templates/frontend/react-vite-help/src/router.tsx +13 -0
- package/dist/templates/frontend/react-vite-help/src/routes/__root.tsx +92 -0
- package/dist/templates/frontend/react-vite-help/src/routes/auth/iniciar-sesion.tsx +139 -0
- package/dist/templates/frontend/react-vite-help/src/routes/auth/registro.tsx +205 -0
- package/dist/templates/frontend/react-vite-help/src/routes/contacto.tsx +60 -0
- package/dist/templates/frontend/react-vite-help/src/routes/dashbord.tsx +9 -0
- package/dist/templates/frontend/react-vite-help/src/routes/documentacion.tsx +80 -0
- package/dist/templates/frontend/react-vite-help/src/routes/index.test.tsx +42 -0
- package/dist/templates/frontend/react-vite-help/src/routes/index.tsx +211 -0
- package/dist/templates/frontend/react-vite-help/src/routes/perfil.tsx +9 -0
- package/dist/templates/frontend/react-vite-help/src/routes/proyectos.$proyectoId.tsx +156 -0
- package/dist/templates/frontend/react-vite-help/src/routes/proyectos.tsx +93 -0
- package/dist/templates/frontend/react-vite-help/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-vite-help/tsconfig.app.json +34 -0
- package/dist/templates/frontend/react-vite-help/tsconfig.json +10 -0
- package/dist/templates/frontend/react-vite-help/tsconfig.node.json +26 -0
- package/dist/templates/frontend/react-vite-help/vite.config.ts +22 -0
- package/dist/templates/frontend/react-vite-help/vitest.config.ts +9 -0
- package/dist/templates/mobile/.gitkeep +1 -0
- package/dist/templates/mobile/expo-base/.cursor/rules/general-rules.mdc +231 -0
- package/dist/templates/mobile/expo-base/.cursor/rules/react-native-rules.mdc +1348 -0
- package/dist/templates/mobile/expo-base/.env +1 -0
- package/dist/templates/mobile/expo-base/.husky/commit-msg +4 -0
- package/dist/templates/mobile/expo-base/.husky/pre-commit +1 -0
- package/dist/templates/mobile/expo-base/.lintstagedrc.js +25 -0
- package/dist/templates/mobile/expo-base/.prettierignore +10 -0
- package/dist/templates/mobile/expo-base/.prettierrc +11 -0
- package/dist/templates/mobile/expo-base/.vscode/extensions.json +1 -0
- package/dist/templates/mobile/expo-base/.vscode/settings.json +7 -0
- package/dist/templates/mobile/expo-base/CHANGELOG.md +155 -0
- package/dist/templates/mobile/expo-base/IMPLEMENTATION_SUMMARY.md +413 -0
- package/dist/templates/mobile/expo-base/README.md +510 -0
- package/dist/templates/mobile/expo-base/SETUP_NOTES.md +233 -0
- package/dist/templates/mobile/expo-base/TEMPLATE_USAGE.md +623 -0
- package/dist/templates/mobile/expo-base/WARP.md +123 -0
- package/dist/templates/mobile/expo-base/app/(public)/_layout.tsx +21 -0
- package/dist/templates/mobile/expo-base/app/(public)/forgot-password.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/(public)/login.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/(public)/register.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/(tabs)/_layout.tsx +60 -0
- package/dist/templates/mobile/expo-base/app/(tabs)/explore.tsx +235 -0
- package/dist/templates/mobile/expo-base/app/(tabs)/index.tsx +290 -0
- package/dist/templates/mobile/expo-base/app/(tabs)/profile.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/_layout.tsx +143 -0
- package/dist/templates/mobile/expo-base/app/modal.tsx +29 -0
- package/dist/templates/mobile/expo-base/app/onboarding.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/profile/_layout.tsx +44 -0
- package/dist/templates/mobile/expo-base/app/profile/change-password.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/profile/edit.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/settings/_layout.tsx +62 -0
- package/dist/templates/mobile/expo-base/app/settings/about.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/settings/index.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/settings/language.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/settings/notifications.tsx +3 -0
- package/dist/templates/mobile/expo-base/app/settings/theme.tsx +3 -0
- package/dist/templates/mobile/expo-base/app.json +31 -0
- package/dist/templates/mobile/expo-base/commitlint.config.js +50 -0
- package/dist/templates/mobile/expo-base/docs/ARCHITECTURE.md +565 -0
- package/dist/templates/mobile/expo-base/docs/CI_CD.md +461 -0
- package/dist/templates/mobile/expo-base/docs/COMPONENTS.md +1103 -0
- package/dist/templates/mobile/expo-base/docs/CONTRIBUTING.md +733 -0
- package/dist/templates/mobile/expo-base/docs/DESIGN_TOKENS.md +832 -0
- package/dist/templates/mobile/expo-base/docs/GIT_CONVENTIONS.md +411 -0
- package/dist/templates/mobile/expo-base/docs/I18N.md +701 -0
- package/dist/templates/mobile/expo-base/docs/TESTING.md +565 -0
- package/dist/templates/mobile/expo-base/docs/THEMING.md +753 -0
- package/dist/templates/mobile/expo-base/docs/VERSIONING.md +518 -0
- package/dist/templates/mobile/expo-base/eslint.config.js +180 -0
- package/dist/templates/mobile/expo-base/jest.config.js +51 -0
- package/dist/templates/mobile/expo-base/jest.setup.js +106 -0
- package/dist/templates/mobile/expo-base/package.json +74 -0
- package/dist/templates/mobile/expo-base/pnpm-lock.yaml +11354 -0
- package/dist/templates/mobile/expo-base/pnpm-workspace.yaml +4 -0
- package/dist/templates/mobile/expo-base/src/__tests__/helpers/test-utils.tsx +77 -0
- package/dist/templates/mobile/expo-base/src/__tests__/mocks/api.ts +65 -0
- package/dist/templates/mobile/expo-base/src/__tests__/mocks/i18n.ts +22 -0
- package/dist/templates/mobile/expo-base/src/__tests__/mocks/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/__tests__/mocks/navigation.ts +47 -0
- package/dist/templates/mobile/expo-base/src/__tests__/mocks/theme.ts +46 -0
- package/dist/templates/mobile/expo-base/src/assets/images/android-icon-background.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/android-icon-foreground.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/android-icon-monochrome.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/favicon.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/icon.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/partial-react-logo.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/react-logo.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/react-logo@2x.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/react-logo@3x.png +0 -0
- package/dist/templates/mobile/expo-base/src/assets/images/splash-icon.png +0 -0
- package/dist/templates/mobile/expo-base/src/components/external-link.tsx +25 -0
- package/dist/templates/mobile/expo-base/src/components/feedback/empty-state.tsx +150 -0
- package/dist/templates/mobile/expo-base/src/components/feedback/error-boundary.tsx +145 -0
- package/dist/templates/mobile/expo-base/src/components/feedback/error-screen.tsx +121 -0
- package/dist/templates/mobile/expo-base/src/components/feedback/index.ts +11 -0
- package/dist/templates/mobile/expo-base/src/components/feedback/loading.tsx +155 -0
- package/dist/templates/mobile/expo-base/src/components/haptic-tab.tsx +18 -0
- package/dist/templates/mobile/expo-base/src/components/hello-wave.tsx +19 -0
- package/dist/templates/mobile/expo-base/src/components/layout/column.tsx +49 -0
- package/dist/templates/mobile/expo-base/src/components/layout/container.tsx +41 -0
- package/dist/templates/mobile/expo-base/src/components/layout/index.ts +14 -0
- package/dist/templates/mobile/expo-base/src/components/layout/row.tsx +52 -0
- package/dist/templates/mobile/expo-base/src/components/layout/screen.tsx +110 -0
- package/dist/templates/mobile/expo-base/src/components/layout/section.tsx +37 -0
- package/dist/templates/mobile/expo-base/src/components/parallax-scroll-view.tsx +79 -0
- package/dist/templates/mobile/expo-base/src/components/themed-text.tsx +60 -0
- package/dist/templates/mobile/expo-base/src/components/themed-view.tsx +14 -0
- package/dist/templates/mobile/expo-base/src/components/ui/__tests__/button.test.tsx +206 -0
- package/dist/templates/mobile/expo-base/src/components/ui/avatar.tsx +141 -0
- package/dist/templates/mobile/expo-base/src/components/ui/badge.tsx +175 -0
- package/dist/templates/mobile/expo-base/src/components/ui/button.tsx +247 -0
- package/dist/templates/mobile/expo-base/src/components/ui/card.tsx +127 -0
- package/dist/templates/mobile/expo-base/src/components/ui/collapsible.tsx +45 -0
- package/dist/templates/mobile/expo-base/src/components/ui/divider.tsx +50 -0
- package/dist/templates/mobile/expo-base/src/components/ui/icon-symbol.ios.tsx +32 -0
- package/dist/templates/mobile/expo-base/src/components/ui/icon-symbol.tsx +41 -0
- package/dist/templates/mobile/expo-base/src/components/ui/icon.tsx +137 -0
- package/dist/templates/mobile/expo-base/src/components/ui/index.ts +20 -0
- package/dist/templates/mobile/expo-base/src/components/ui/input.tsx +242 -0
- package/dist/templates/mobile/expo-base/src/constants/theme.ts +53 -0
- package/dist/templates/mobile/expo-base/src/contexts/auth-context.tsx +246 -0
- package/dist/templates/mobile/expo-base/src/contexts/index.ts +8 -0
- package/dist/templates/mobile/expo-base/src/contexts/query-client.tsx +43 -0
- package/dist/templates/mobile/expo-base/src/contexts/theme-context.tsx +111 -0
- package/dist/templates/mobile/expo-base/src/features/auth/forgot-password-screen.tsx +164 -0
- package/dist/templates/mobile/expo-base/src/features/auth/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/features/auth/login-screen.tsx +177 -0
- package/dist/templates/mobile/expo-base/src/features/auth/register-screen.tsx +220 -0
- package/dist/templates/mobile/expo-base/src/features/onboarding/README.md +190 -0
- package/dist/templates/mobile/expo-base/src/features/onboarding/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/features/onboarding/onboarding-debug.tsx +120 -0
- package/dist/templates/mobile/expo-base/src/features/onboarding/onboarding-screen.tsx +242 -0
- package/dist/templates/mobile/expo-base/src/features/onboarding/onboarding-utils.ts +49 -0
- package/dist/templates/mobile/expo-base/src/features/profile/change-password-screen.tsx +154 -0
- package/dist/templates/mobile/expo-base/src/features/profile/edit-profile-screen.tsx +183 -0
- package/dist/templates/mobile/expo-base/src/features/profile/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/features/profile/profile-screen.tsx +177 -0
- package/dist/templates/mobile/expo-base/src/features/settings/about-screen.tsx +167 -0
- package/dist/templates/mobile/expo-base/src/features/settings/index.ts +9 -0
- package/dist/templates/mobile/expo-base/src/features/settings/language-settings-screen.tsx +97 -0
- package/dist/templates/mobile/expo-base/src/features/settings/notifications-settings-screen.tsx +128 -0
- package/dist/templates/mobile/expo-base/src/features/settings/settings-screen.tsx +141 -0
- package/dist/templates/mobile/expo-base/src/features/settings/theme-settings-screen.tsx +149 -0
- package/dist/templates/mobile/expo-base/src/hooks/__tests__/use-theme.test.ts +151 -0
- package/dist/templates/mobile/expo-base/src/hooks/index.ts +13 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-api.ts +206 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-auth.ts +7 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-color-scheme.ts +19 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-color-scheme.web.ts +31 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-theme-color.ts +21 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-theme.ts +60 -0
- package/dist/templates/mobile/expo-base/src/hooks/use-translation.ts +48 -0
- package/dist/templates/mobile/expo-base/src/i18n/index.ts +113 -0
- package/dist/templates/mobile/expo-base/src/i18n/locales/en-US.json +134 -0
- package/dist/templates/mobile/expo-base/src/i18n/locales/es-AR.json +134 -0
- package/dist/templates/mobile/expo-base/src/scripts/reset-project.js +112 -0
- package/dist/templates/mobile/expo-base/src/services/api/client.ts +190 -0
- package/dist/templates/mobile/expo-base/src/services/api/endpoints.ts +45 -0
- package/dist/templates/mobile/expo-base/src/services/api/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/services/storage/secure-storage.ts +56 -0
- package/dist/templates/mobile/expo-base/src/theme/colors.ts +147 -0
- package/dist/templates/mobile/expo-base/src/theme/index.ts +40 -0
- package/dist/templates/mobile/expo-base/src/theme/semantic-colors.ts +221 -0
- package/dist/templates/mobile/expo-base/src/theme/shadows.ts +123 -0
- package/dist/templates/mobile/expo-base/src/theme/spacing.ts +118 -0
- package/dist/templates/mobile/expo-base/src/theme/theme-config.ts +111 -0
- package/dist/templates/mobile/expo-base/src/theme/tokens.ts +218 -0
- package/dist/templates/mobile/expo-base/src/theme/typography.ts +152 -0
- package/dist/templates/mobile/expo-base/src/types/index.ts +6 -0
- package/dist/templates/mobile/expo-base/src/types/models.ts +153 -0
- package/dist/templates/mobile/expo-base/src/types/navigation.ts +67 -0
- package/dist/templates/mobile/expo-base/src/utils/__tests__/validators.test.ts +312 -0
- package/dist/templates/mobile/expo-base/src/utils/constants.ts +167 -0
- package/dist/templates/mobile/expo-base/src/utils/formatters.ts +222 -0
- package/dist/templates/mobile/expo-base/src/utils/index.ts +7 -0
- package/dist/templates/mobile/expo-base/src/utils/validators.ts +187 -0
- package/dist/templates/mobile/expo-base/tsconfig.json +26 -0
- package/dist/test-cli.js +40 -0
- package/dist/types/index.js +1 -0
- package/package.json +25 -0
- package/templates/backend/.gitkeep +1 -0
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-endpoint.md +209 -0
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-model.md +201 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/api-rest.mdc +126 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/authentication-security.mdc +86 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/dto-validation.mdc +93 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/general-rules.mdc +126 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/prisma-standards.mdc +90 -0
- package/templates/backend/nestjs-api-postgres/.cursor/rules/swagger-documentation.mdc +90 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/postgresql-table-design/SKILL.md +202 -0
- package/templates/backend/nestjs-api-postgres/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/templates/backend/nestjs-api-postgres/.dockerignore +50 -0
- package/templates/backend/nestjs-api-postgres/.env.example +18 -0
- package/templates/backend/nestjs-api-postgres/.env.test +18 -0
- package/templates/backend/nestjs-api-postgres/.prettierrc +4 -0
- package/templates/backend/nestjs-api-postgres/README.md +1502 -0
- package/templates/backend/nestjs-api-postgres/docker-compose.yml +24 -0
- package/templates/backend/nestjs-api-postgres/eslint.config.mjs +41 -0
- package/templates/backend/nestjs-api-postgres/nest-cli.json +8 -0
- package/templates/backend/nestjs-api-postgres/package.json +107 -0
- package/templates/backend/nestjs-api-postgres/prisma/migrations/20260126125423_init/migration.sql +84 -0
- package/templates/backend/nestjs-api-postgres/prisma/migrations/migration_lock.toml +3 -0
- package/templates/backend/nestjs-api-postgres/prisma/schema.prisma +76 -0
- package/templates/backend/nestjs-api-postgres/prisma/seed.ts +220 -0
- package/templates/backend/nestjs-api-postgres/prisma.config.ts +10 -0
- package/templates/backend/nestjs-api-postgres/src/app.module.ts +39 -0
- package/templates/backend/nestjs-api-postgres/src/app.service.ts +8 -0
- package/templates/backend/nestjs-api-postgres/src/auth/auth.controller.ts +36 -0
- package/templates/backend/nestjs-api-postgres/src/auth/auth.module.ts +22 -0
- package/templates/backend/nestjs-api-postgres/src/auth/auth.service.ts +63 -0
- package/templates/backend/nestjs-api-postgres/src/auth/decorators/roles.decorator.ts +5 -0
- package/templates/backend/nestjs-api-postgres/src/auth/dto/login-response.dto.ts +23 -0
- package/templates/backend/nestjs-api-postgres/src/auth/dto/login.dto.ts +27 -0
- package/templates/backend/nestjs-api-postgres/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/templates/backend/nestjs-api-postgres/src/auth/guards/roles.guard.ts +23 -0
- package/templates/backend/nestjs-api-postgres/src/auth/strategies/jwt.strategy.ts +32 -0
- package/templates/backend/nestjs-api-postgres/src/auth/types.ts +18 -0
- package/templates/backend/nestjs-api-postgres/src/common/dto/paginated-response.dto.ts +16 -0
- package/templates/backend/nestjs-api-postgres/src/common/dto/pagination.dto.ts +31 -0
- package/templates/backend/nestjs-api-postgres/src/common/filters/http-exception.filter.ts +53 -0
- package/templates/backend/nestjs-api-postgres/src/config/env.validation.ts +41 -0
- package/templates/backend/nestjs-api-postgres/src/health/health.controller.ts +35 -0
- package/templates/backend/nestjs-api-postgres/src/health/health.module.ts +7 -0
- package/templates/backend/nestjs-api-postgres/src/main.ts +87 -0
- package/templates/backend/nestjs-api-postgres/src/posts/dto/create-post.dto.ts +32 -0
- package/templates/backend/nestjs-api-postgres/src/posts/dto/post-response.dto.ts +41 -0
- package/templates/backend/nestjs-api-postgres/src/posts/dto/update-post.dto.ts +31 -0
- package/templates/backend/nestjs-api-postgres/src/posts/posts.controller.ts +161 -0
- package/templates/backend/nestjs-api-postgres/src/posts/posts.module.ts +12 -0
- package/templates/backend/nestjs-api-postgres/src/posts/posts.service.ts +171 -0
- package/templates/backend/nestjs-api-postgres/src/prisma/prisma.module.ts +9 -0
- package/templates/backend/nestjs-api-postgres/src/prisma/prisma.service.ts +27 -0
- package/templates/backend/nestjs-api-postgres/src/users/constants/settings.constants.ts +9 -0
- package/templates/backend/nestjs-api-postgres/src/users/dto/profile-response.dto.ts +39 -0
- package/templates/backend/nestjs-api-postgres/src/users/dto/settings-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-postgres/src/users/dto/update-profile.dto.ts +48 -0
- package/templates/backend/nestjs-api-postgres/src/users/dto/update-settings.dto.ts +40 -0
- package/templates/backend/nestjs-api-postgres/src/users/dto/user-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-postgres/src/users/profile.service.ts +49 -0
- package/templates/backend/nestjs-api-postgres/src/users/settings.service.ts +82 -0
- package/templates/backend/nestjs-api-postgres/src/users/users.controller.ts +102 -0
- package/templates/backend/nestjs-api-postgres/src/users/users.module.ts +14 -0
- package/templates/backend/nestjs-api-postgres/src/users/users.service.ts +27 -0
- package/templates/backend/nestjs-api-postgres/test/README.md +412 -0
- package/templates/backend/nestjs-api-postgres/test/e2e/auth.e2e-spec.ts +147 -0
- package/templates/backend/nestjs-api-postgres/test/e2e/health.e2e-spec.ts +62 -0
- package/templates/backend/nestjs-api-postgres/test/e2e/posts.e2e-spec.ts +407 -0
- package/templates/backend/nestjs-api-postgres/test/e2e/users.e2e-spec.ts +287 -0
- package/templates/backend/nestjs-api-postgres/test/fixtures/test-data.ts +109 -0
- package/templates/backend/nestjs-api-postgres/test/helpers/auth.helper.ts +54 -0
- package/templates/backend/nestjs-api-postgres/test/helpers/db.helper.ts +73 -0
- package/templates/backend/nestjs-api-postgres/test/jest-e2e.json +12 -0
- package/templates/backend/nestjs-api-postgres/test/setup-e2e.ts +8 -0
- package/templates/backend/nestjs-api-postgres/test/unit/app.service.spec.ts +24 -0
- package/templates/backend/nestjs-api-postgres/test/unit/auth.controller.spec.ts +91 -0
- package/templates/backend/nestjs-api-postgres/test/unit/auth.service.spec.ts +161 -0
- package/templates/backend/nestjs-api-postgres/test/unit/health.controller.spec.ts +78 -0
- package/templates/backend/nestjs-api-postgres/test/unit/http-exception.filter.spec.ts +150 -0
- package/templates/backend/nestjs-api-postgres/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/templates/backend/nestjs-api-postgres/test/unit/jwt.strategy.spec.ts +41 -0
- package/templates/backend/nestjs-api-postgres/test/unit/posts.controller.spec.ts +249 -0
- package/templates/backend/nestjs-api-postgres/test/unit/posts.service.spec.ts +328 -0
- package/templates/backend/nestjs-api-postgres/test/unit/profile.service.spec.ts +146 -0
- package/templates/backend/nestjs-api-postgres/test/unit/settings.service.spec.ts +242 -0
- package/templates/backend/nestjs-api-postgres/test/unit/users.controller.spec.ts +178 -0
- package/templates/backend/nestjs-api-postgres/test/unit/users.service.spec.ts +96 -0
- package/templates/backend/nestjs-api-postgres/tsconfig.build.json +4 -0
- package/templates/backend/nestjs-api-postgres/tsconfig.json +28 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-endpoint.md +209 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-model.md +201 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/api-rest.mdc +126 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/authentication-security.mdc +86 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/dto-validation.mdc +93 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/general-rules.mdc +126 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/prisma-standards.mdc +90 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/rules/swagger-documentation.mdc +90 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/templates/backend/nestjs-api-sqlite/.env.example +4 -0
- package/templates/backend/nestjs-api-sqlite/.env.test +4 -0
- package/templates/backend/nestjs-api-sqlite/.prettierrc +4 -0
- package/templates/backend/nestjs-api-sqlite/README.md +1464 -0
- package/templates/backend/nestjs-api-sqlite/eslint.config.mjs +41 -0
- package/templates/backend/nestjs-api-sqlite/nest-cli.json +8 -0
- package/templates/backend/nestjs-api-sqlite/package.json +105 -0
- package/templates/backend/nestjs-api-sqlite/pnpm-lock.yaml +7630 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/20260123190258_init/migration.sql +12 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/20260123205000_add_roles_and_posts/migration.sql +32 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124163749_init_with_profile_and_settings/migration.sql +33 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124190929_add_render_model/migration.sql +13 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/20260124200534_add_post_indexes/migration.sql +16 -0
- package/templates/backend/nestjs-api-sqlite/prisma/migrations/migration_lock.toml +3 -0
- package/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +76 -0
- package/templates/backend/nestjs-api-sqlite/prisma/seed.ts +218 -0
- package/templates/backend/nestjs-api-sqlite/prisma.config.ts +10 -0
- package/templates/backend/nestjs-api-sqlite/src/app.module.ts +39 -0
- package/templates/backend/nestjs-api-sqlite/src/app.service.ts +8 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/auth.controller.ts +36 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/auth.module.ts +22 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/auth.service.ts +63 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/decorators/roles.decorator.ts +5 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/dto/login-response.dto.ts +23 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/dto/login.dto.ts +27 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/guards/roles.guard.ts +23 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/strategies/jwt.strategy.ts +32 -0
- package/templates/backend/nestjs-api-sqlite/src/auth/types.ts +18 -0
- package/templates/backend/nestjs-api-sqlite/src/common/dto/paginated-response.dto.ts +16 -0
- package/templates/backend/nestjs-api-sqlite/src/common/dto/pagination.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlite/src/common/filters/http-exception.filter.ts +53 -0
- package/templates/backend/nestjs-api-sqlite/src/config/env.validation.ts +35 -0
- package/templates/backend/nestjs-api-sqlite/src/health/health.controller.ts +35 -0
- package/templates/backend/nestjs-api-sqlite/src/health/health.module.ts +7 -0
- package/templates/backend/nestjs-api-sqlite/src/main.ts +87 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/dto/create-post.dto.ts +32 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +41 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/dto/update-post.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/posts.controller.ts +161 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/posts.module.ts +12 -0
- package/templates/backend/nestjs-api-sqlite/src/posts/posts.service.ts +171 -0
- package/templates/backend/nestjs-api-sqlite/src/prisma/prisma.module.ts +9 -0
- package/templates/backend/nestjs-api-sqlite/src/prisma/prisma.service.ts +29 -0
- package/templates/backend/nestjs-api-sqlite/src/users/constants/settings.constants.ts +9 -0
- package/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +39 -0
- package/templates/backend/nestjs-api-sqlite/src/users/dto/settings-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +48 -0
- package/templates/backend/nestjs-api-sqlite/src/users/dto/update-settings.dto.ts +40 -0
- package/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +49 -0
- package/templates/backend/nestjs-api-sqlite/src/users/settings.service.ts +82 -0
- package/templates/backend/nestjs-api-sqlite/src/users/users.controller.ts +102 -0
- package/templates/backend/nestjs-api-sqlite/src/users/users.module.ts +14 -0
- package/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +27 -0
- package/templates/backend/nestjs-api-sqlite/test/README.md +412 -0
- package/templates/backend/nestjs-api-sqlite/test/e2e/auth.e2e-spec.ts +147 -0
- package/templates/backend/nestjs-api-sqlite/test/e2e/health.e2e-spec.ts +62 -0
- package/templates/backend/nestjs-api-sqlite/test/e2e/posts.e2e-spec.ts +407 -0
- package/templates/backend/nestjs-api-sqlite/test/e2e/users.e2e-spec.ts +287 -0
- package/templates/backend/nestjs-api-sqlite/test/fixtures/test-data.ts +109 -0
- package/templates/backend/nestjs-api-sqlite/test/helpers/auth.helper.ts +54 -0
- package/templates/backend/nestjs-api-sqlite/test/helpers/db.helper.ts +72 -0
- package/templates/backend/nestjs-api-sqlite/test/jest-e2e.json +12 -0
- package/templates/backend/nestjs-api-sqlite/test/setup-e2e.ts +8 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/app.service.spec.ts +24 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/auth.controller.spec.ts +91 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/auth.service.spec.ts +161 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/health.controller.spec.ts +78 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/http-exception.filter.spec.ts +150 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/jwt.strategy.spec.ts +41 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/posts.controller.spec.ts +249 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/posts.service.spec.ts +328 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/profile.service.spec.ts +146 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/settings.service.spec.ts +242 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/users.controller.spec.ts +178 -0
- package/templates/backend/nestjs-api-sqlite/test/unit/users.service.spec.ts +96 -0
- package/templates/backend/nestjs-api-sqlite/tsconfig.build.json +4 -0
- package/templates/backend/nestjs-api-sqlite/tsconfig.json +28 -0
- package/templates/frontend/angular-base/.agents/skills/angular-component/SKILL.md +288 -0
- package/templates/frontend/angular-base/.agents/skills/angular-component/references/component-patterns.md +358 -0
- package/templates/frontend/angular-base/.agents/skills/angular-di/SKILL.md +387 -0
- package/templates/frontend/angular-base/.agents/skills/angular-di/references/di-patterns.md +519 -0
- package/templates/frontend/angular-base/.agents/skills/angular-directives/SKILL.md +437 -0
- package/templates/frontend/angular-base/.agents/skills/angular-directives/references/directive-patterns.md +570 -0
- package/templates/frontend/angular-base/.agents/skills/angular-forms/SKILL.md +434 -0
- package/templates/frontend/angular-base/.agents/skills/angular-forms/references/form-patterns.md +398 -0
- package/templates/frontend/angular-base/.agents/skills/angular-http/SKILL.md +366 -0
- package/templates/frontend/angular-base/.agents/skills/angular-http/references/http-patterns.md +448 -0
- package/templates/frontend/angular-base/.agents/skills/angular-routing/SKILL.md +395 -0
- package/templates/frontend/angular-base/.agents/skills/angular-routing/references/routing-patterns.md +472 -0
- package/templates/frontend/angular-base/.agents/skills/angular-signals/SKILL.md +302 -0
- package/templates/frontend/angular-base/.agents/skills/angular-signals/references/signal-patterns.md +404 -0
- package/templates/frontend/angular-base/.agents/skills/angular-ssr/SKILL.md +435 -0
- package/templates/frontend/angular-base/.agents/skills/angular-ssr/references/ssr-patterns.md +497 -0
- package/templates/frontend/angular-base/.agents/skills/angular-testing/SKILL.md +660 -0
- package/templates/frontend/angular-base/.agents/skills/angular-testing/references/testing-patterns.md +707 -0
- package/templates/frontend/angular-base/.agents/skills/angular-tooling/SKILL.md +352 -0
- package/templates/frontend/angular-base/.agents/skills/angular-tooling/references/tooling-patterns.md +448 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-accessibility/SKILL.md +780 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-components/SKILL.md +718 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-animations/SKILL.md +432 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-debugging/SKILL.md +354 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-framework-integration/SKILL.md +578 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-mobile-first/SKILL.md +768 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-performance/SKILL.md +374 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-plugins/SKILL.md +505 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
- package/templates/frontend/angular-base/.agents/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
- package/templates/frontend/angular-base/.agents/skills/web-design-guidelines/SKILL.md +39 -0
- package/templates/frontend/angular-base/.cursor/mcp.json +12 -0
- package/templates/frontend/angular-base/.cursor/rules/angular-expert.mdc +153 -0
- package/templates/frontend/angular-base/.editorconfig +17 -0
- package/templates/frontend/angular-base/.eslintrc.json +52 -0
- package/templates/frontend/angular-base/.github/workflows/ci.yml +122 -0
- package/templates/frontend/angular-base/.husky/pre-commit +1 -0
- package/templates/frontend/angular-base/.husky/pre-push +1 -0
- package/templates/frontend/angular-base/.postcssrc.json +5 -0
- package/templates/frontend/angular-base/.prettierignore +8 -0
- package/templates/frontend/angular-base/.prettierrc.json +15 -0
- package/templates/frontend/angular-base/.vscode/extensions.json +4 -0
- package/templates/frontend/angular-base/.vscode/launch.json +20 -0
- package/templates/frontend/angular-base/.vscode/mcp.json +9 -0
- package/templates/frontend/angular-base/.vscode/tasks.json +42 -0
- package/templates/frontend/angular-base/CONTRIBUTING.md +230 -0
- package/templates/frontend/angular-base/README.md +383 -0
- package/templates/frontend/angular-base/angular.json +84 -0
- package/templates/frontend/angular-base/cypress/e2e/app.cy.ts +39 -0
- package/templates/frontend/angular-base/cypress/e2e/auth.cy.ts +196 -0
- package/templates/frontend/angular-base/cypress/e2e/dashboard.cy.ts +56 -0
- package/templates/frontend/angular-base/cypress/e2e/home.cy.ts +35 -0
- package/templates/frontend/angular-base/cypress/fixtures/example.json +4 -0
- package/templates/frontend/angular-base/cypress/support/commands.ts +8 -0
- package/templates/frontend/angular-base/cypress/support/e2e.ts +11 -0
- package/templates/frontend/angular-base/cypress.config.ts +11 -0
- package/templates/frontend/angular-base/docs/ARCHITECTURE.md +337 -0
- package/templates/frontend/angular-base/docs/AUTHENTICATION.md +491 -0
- package/templates/frontend/angular-base/docs/DEPLOYMENT.md +507 -0
- package/templates/frontend/angular-base/docs/FEATURES.md +404 -0
- package/templates/frontend/angular-base/docs/TESTING.md +418 -0
- package/templates/frontend/angular-base/docs/THEMING.md +333 -0
- package/templates/frontend/angular-base/docs/UI_LIBRARIES.md +380 -0
- package/templates/frontend/angular-base/docs/USER_PROFILE_FLOW.md +431 -0
- package/templates/frontend/angular-base/package-lock.json +13321 -0
- package/templates/frontend/angular-base/package.json +93 -0
- package/templates/frontend/angular-base/public/favicon.ico +0 -0
- package/templates/frontend/angular-base/src/app/app.config.server.ts +14 -0
- package/templates/frontend/angular-base/src/app/app.config.ts +32 -0
- package/templates/frontend/angular-base/src/app/app.css +0 -0
- package/templates/frontend/angular-base/src/app/app.html +1 -0
- package/templates/frontend/angular-base/src/app/app.routes.server.ts +28 -0
- package/templates/frontend/angular-base/src/app/app.routes.ts +67 -0
- package/templates/frontend/angular-base/src/app/app.spec.ts +23 -0
- package/templates/frontend/angular-base/src/app/app.ts +12 -0
- package/templates/frontend/angular-base/src/app/core/guards/admin.guard.ts +16 -0
- package/templates/frontend/angular-base/src/app/core/guards/auth.guard.spec.ts +43 -0
- package/templates/frontend/angular-base/src/app/core/guards/auth.guard.ts +15 -0
- package/templates/frontend/angular-base/src/app/core/index.ts +10 -0
- package/templates/frontend/angular-base/src/app/core/interceptors/http-error.interceptor.spec.ts +43 -0
- package/templates/frontend/angular-base/src/app/core/interceptors/http-error.interceptor.ts +53 -0
- package/templates/frontend/angular-base/src/app/core/services/auth.service.spec.ts +33 -0
- package/templates/frontend/angular-base/src/app/core/services/auth.service.ts +91 -0
- package/templates/frontend/angular-base/src/app/core/services/theme.service.spec.ts +33 -0
- package/templates/frontend/angular-base/src/app/core/services/theme.service.ts +136 -0
- package/templates/frontend/angular-base/src/app/features/admin/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/features/admin/routes.ts +21 -0
- package/templates/frontend/angular-base/src/app/features/admin/users/models/admin-user.model.ts +32 -0
- package/templates/frontend/angular-base/src/app/features/admin/users/pages/user-form.page.ts +279 -0
- package/templates/frontend/angular-base/src/app/features/admin/users/pages/user-list.page.ts +336 -0
- package/templates/frontend/angular-base/src/app/features/admin/users/services/admin-user.service.ts +151 -0
- package/templates/frontend/angular-base/src/app/features/auth/index.ts +2 -0
- package/templates/frontend/angular-base/src/app/features/auth/models/auth.model.ts +39 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/login.page.spec.ts +44 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/login.page.ts +187 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/password-recovery.page.spec.ts +48 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/password-recovery.page.ts +171 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/signup.page.spec.ts +53 -0
- package/templates/frontend/angular-base/src/app/features/auth/pages/signup.page.ts +269 -0
- package/templates/frontend/angular-base/src/app/features/auth/routes.ts +22 -0
- package/templates/frontend/angular-base/src/app/features/customers/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/features/customers/models/customer.model.ts +41 -0
- package/templates/frontend/angular-base/src/app/features/customers/pages/customer-detail.page.ts +299 -0
- package/templates/frontend/angular-base/src/app/features/customers/pages/customer-form.page.ts +302 -0
- package/templates/frontend/angular-base/src/app/features/customers/pages/customer-list.page.ts +439 -0
- package/templates/frontend/angular-base/src/app/features/customers/routes.ts +21 -0
- package/templates/frontend/angular-base/src/app/features/customers/services/customer.service.ts +162 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/components/stats-card/stats-card.component.spec.ts +23 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/components/stats-card/stats-card.component.ts +52 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/index.ts +1 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/pages/dashboard.page.spec.ts +21 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/pages/dashboard.page.ts +122 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/routes.ts +8 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/services/dashboard.service.spec.ts +37 -0
- package/templates/frontend/angular-base/src/app/features/dashboard/services/dashboard.service.ts +48 -0
- package/templates/frontend/angular-base/src/app/features/errors/index.ts +1 -0
- package/templates/frontend/angular-base/src/app/features/errors/pages/forbidden.page.ts +50 -0
- package/templates/frontend/angular-base/src/app/features/errors/pages/maintenance.page.ts +46 -0
- package/templates/frontend/angular-base/src/app/features/errors/pages/not-found.page.ts +49 -0
- package/templates/frontend/angular-base/src/app/features/errors/pages/server-error.page.ts +60 -0
- package/templates/frontend/angular-base/src/app/features/errors/routes.ts +25 -0
- package/templates/frontend/angular-base/src/app/features/home/index.ts +1 -0
- package/templates/frontend/angular-base/src/app/features/home/pages/home.page.spec.ts +23 -0
- package/templates/frontend/angular-base/src/app/features/home/pages/home.page.ts +105 -0
- package/templates/frontend/angular-base/src/app/features/home/routes.ts +8 -0
- package/templates/frontend/angular-base/src/app/features/projects/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/features/projects/models/project.model.ts +48 -0
- package/templates/frontend/angular-base/src/app/features/projects/pages/project-detail.page.ts +444 -0
- package/templates/frontend/angular-base/src/app/features/projects/pages/project-form.page.ts +393 -0
- package/templates/frontend/angular-base/src/app/features/projects/pages/project-list.page.ts +411 -0
- package/templates/frontend/angular-base/src/app/features/projects/routes.ts +21 -0
- package/templates/frontend/angular-base/src/app/features/projects/services/project.service.ts +227 -0
- package/templates/frontend/angular-base/src/app/features/reports/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/features/reports/models/report.model.ts +27 -0
- package/templates/frontend/angular-base/src/app/features/reports/pages/analytics.page.html +246 -0
- package/templates/frontend/angular-base/src/app/features/reports/pages/analytics.page.ts +135 -0
- package/templates/frontend/angular-base/src/app/features/reports/routes.ts +13 -0
- package/templates/frontend/angular-base/src/app/features/reports/services/report.service.ts +141 -0
- package/templates/frontend/angular-base/src/app/features/user/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/features/user/models/user.model.ts +23 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/privacy.page.spec.ts +27 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/privacy.page.ts +414 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/profile.page.spec.ts +39 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/profile.page.ts +232 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/settings.page.spec.ts +28 -0
- package/templates/frontend/angular-base/src/app/features/user/pages/settings.page.ts +284 -0
- package/templates/frontend/angular-base/src/app/features/user/routes.ts +21 -0
- package/templates/frontend/angular-base/src/app/features/user/services/user.service.ts +74 -0
- package/templates/frontend/angular-base/src/app/layout/footer/footer.component.spec.ts +25 -0
- package/templates/frontend/angular-base/src/app/layout/footer/footer.component.ts +67 -0
- package/templates/frontend/angular-base/src/app/layout/index.ts +3 -0
- package/templates/frontend/angular-base/src/app/layout/main-layout/main-layout.component.spec.ts +23 -0
- package/templates/frontend/angular-base/src/app/layout/main-layout/main-layout.component.ts +30 -0
- package/templates/frontend/angular-base/src/app/layout/navbar/navbar.component.spec.ts +23 -0
- package/templates/frontend/angular-base/src/app/layout/navbar/navbar.component.ts +293 -0
- package/templates/frontend/angular-base/src/app/shared/components/badge/badge.component.spec.ts +36 -0
- package/templates/frontend/angular-base/src/app/shared/components/badge/badge.component.ts +70 -0
- package/templates/frontend/angular-base/src/app/shared/components/button/button.component.spec.ts +44 -0
- package/templates/frontend/angular-base/src/app/shared/components/button/button.component.ts +64 -0
- package/templates/frontend/angular-base/src/app/shared/components/card/card.component.spec.ts +29 -0
- package/templates/frontend/angular-base/src/app/shared/components/card/card.component.ts +60 -0
- package/templates/frontend/angular-base/src/app/shared/components/data-table/data-table.component.spec.ts +49 -0
- package/templates/frontend/angular-base/src/app/shared/components/data-table/data-table.component.ts +280 -0
- package/templates/frontend/angular-base/src/app/shared/components/empty-state/empty-state.component.spec.ts +36 -0
- package/templates/frontend/angular-base/src/app/shared/components/empty-state/empty-state.component.ts +56 -0
- package/templates/frontend/angular-base/src/app/shared/components/modal/modal.component.spec.ts +32 -0
- package/templates/frontend/angular-base/src/app/shared/components/modal/modal.component.ts +131 -0
- package/templates/frontend/angular-base/src/app/shared/components/pagination/pagination.component.spec.ts +38 -0
- package/templates/frontend/angular-base/src/app/shared/components/pagination/pagination.component.ts +194 -0
- package/templates/frontend/angular-base/src/app/shared/components/search-input/search-input.component.spec.ts +37 -0
- package/templates/frontend/angular-base/src/app/shared/components/search-input/search-input.component.ts +125 -0
- package/templates/frontend/angular-base/src/app/shared/components/skeleton-loader/skeleton-loader.component.spec.ts +30 -0
- package/templates/frontend/angular-base/src/app/shared/components/skeleton-loader/skeleton-loader.component.ts +55 -0
- package/templates/frontend/angular-base/src/app/shared/components/toggle/toggle.component.spec.ts +49 -0
- package/templates/frontend/angular-base/src/app/shared/components/toggle/toggle.component.ts +101 -0
- package/templates/frontend/angular-base/src/app/shared/components/user-dropdown/user-dropdown.component.spec.ts +65 -0
- package/templates/frontend/angular-base/src/app/shared/components/user-dropdown/user-dropdown.component.ts +219 -0
- package/templates/frontend/angular-base/src/app/shared/directives/auto-focus.directive.spec.ts +33 -0
- package/templates/frontend/angular-base/src/app/shared/directives/auto-focus.directive.ts +25 -0
- package/templates/frontend/angular-base/src/app/shared/index.ts +18 -0
- package/templates/frontend/angular-base/src/app/shared/pipes/date-format.pipe.spec.ts +29 -0
- package/templates/frontend/angular-base/src/app/shared/pipes/date-format.pipe.ts +39 -0
- package/templates/frontend/angular-base/src/environments/environment.development.ts +4 -0
- package/templates/frontend/angular-base/src/environments/environment.ts +4 -0
- package/templates/frontend/angular-base/src/index.html +44 -0
- package/templates/frontend/angular-base/src/main.server.ts +7 -0
- package/templates/frontend/angular-base/src/main.ts +5 -0
- package/templates/frontend/angular-base/src/server.ts +66 -0
- package/templates/frontend/angular-base/src/styles.css +209 -0
- package/templates/frontend/angular-base/src/test-setup.ts +10 -0
- package/templates/frontend/angular-base/tsconfig.app.json +17 -0
- package/templates/frontend/angular-base/tsconfig.json +41 -0
- package/templates/frontend/angular-base/tsconfig.spec.json +15 -0
- package/templates/frontend/angular-base/vitest.config.ts +25 -0
- package/templates/frontend/react-vite/.cursor/skills/architecture/SKILL.md +26 -0
- package/templates/frontend/react-vite/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/templates/frontend/react-vite/.cursor/skills/daisyui/SKILL.md +98 -0
- package/templates/frontend/react-vite/.cursor/skills/routing/SKILL.md +32 -0
- package/templates/frontend/react-vite/.cursor/skills/testing/SKILL.md +55 -0
- package/templates/frontend/react-vite/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/templates/frontend/react-vite/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/templates/frontend/react-vite/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/templates/frontend/react-vite/.prettierrc +6 -0
- package/templates/frontend/react-vite/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/templates/frontend/react-vite/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/templates/frontend/react-vite/.vscode/extensions.json +7 -0
- package/templates/frontend/react-vite/README.md +75 -0
- package/templates/frontend/react-vite/components.json +22 -0
- package/templates/frontend/react-vite/eslint.config.js +31 -0
- package/templates/frontend/react-vite/index.html +13 -0
- package/templates/frontend/react-vite/package.json +62 -0
- package/templates/frontend/react-vite/pnpm-lock.yaml +4487 -0
- package/templates/frontend/react-vite/pnpm-workspace.yaml +2 -0
- package/templates/frontend/react-vite/src/assets/react.svg +1 -0
- package/templates/frontend/react-vite/src/components/ui/badge.tsx +37 -0
- package/templates/frontend/react-vite/src/components/ui/breadcrumb.tsx +106 -0
- package/templates/frontend/react-vite/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-vite/src/components/ui/card.tsx +72 -0
- package/templates/frontend/react-vite/src/components/ui/form.tsx +165 -0
- package/templates/frontend/react-vite/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-vite/src/components/ui/label.tsx +24 -0
- package/templates/frontend/react-vite/src/components/ui/password-input.tsx +41 -0
- package/templates/frontend/react-vite/src/components/ui/separator.tsx +28 -0
- package/templates/frontend/react-vite/src/components/ui/tabs.tsx +62 -0
- package/templates/frontend/react-vite/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-vite/src/index.css +104 -0
- package/templates/frontend/react-vite/src/lib/queryClient.ts +11 -0
- package/templates/frontend/react-vite/src/lib/utils.ts +6 -0
- package/templates/frontend/react-vite/src/main.tsx +33 -0
- package/templates/frontend/react-vite/src/routeTree.gen.ts +77 -0
- package/templates/frontend/react-vite/src/router.tsx +13 -0
- package/templates/frontend/react-vite/src/routes/__root.tsx +82 -0
- package/templates/frontend/react-vite/src/routes/index.tsx +187 -0
- package/templates/frontend/react-vite/src/routes/otra-ruta.tsx +319 -0
- package/templates/frontend/react-vite/src/test/setup.ts +1 -0
- package/templates/frontend/react-vite/tsconfig.app.json +34 -0
- package/templates/frontend/react-vite/tsconfig.json +10 -0
- package/templates/frontend/react-vite/tsconfig.node.json +26 -0
- package/templates/frontend/react-vite/vite.config.ts +22 -0
- package/templates/frontend/react-vite/vitest.config.ts +9 -0
- package/templates/frontend/react-vite-help/.cursor/skills/architecture/SKILL.md +26 -0
- package/templates/frontend/react-vite-help/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/templates/frontend/react-vite-help/.cursor/skills/daisyui/SKILL.md +98 -0
- package/templates/frontend/react-vite-help/.cursor/skills/routing/SKILL.md +32 -0
- package/templates/frontend/react-vite-help/.cursor/skills/testing/SKILL.md +55 -0
- package/templates/frontend/react-vite-help/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/templates/frontend/react-vite-help/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/templates/frontend/react-vite-help/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/templates/frontend/react-vite-help/.prettierrc +6 -0
- package/templates/frontend/react-vite-help/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/templates/frontend/react-vite-help/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/templates/frontend/react-vite-help/.vscode/extensions.json +7 -0
- package/templates/frontend/react-vite-help/README.md +75 -0
- package/templates/frontend/react-vite-help/components.json +22 -0
- package/templates/frontend/react-vite-help/eslint.config.js +31 -0
- package/templates/frontend/react-vite-help/index.html +13 -0
- package/templates/frontend/react-vite-help/package.json +62 -0
- package/templates/frontend/react-vite-help/pnpm-lock.yaml +4487 -0
- package/templates/frontend/react-vite-help/pnpm-workspace.yaml +2 -0
- package/templates/frontend/react-vite-help/src/assets/react.svg +1 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/entorno.tsx +99 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/estructura.tsx +100 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/figma-mcp.tsx +200 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/inicio.tsx +69 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/instalacion.tsx +72 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/personalizacion.tsx +163 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/rutas.tsx +138 -0
- package/templates/frontend/react-vite-help/src/components/documentacion/stack.tsx +401 -0
- package/templates/frontend/react-vite-help/src/components/ui/badge.tsx +37 -0
- package/templates/frontend/react-vite-help/src/components/ui/breadcrumb.tsx +106 -0
- package/templates/frontend/react-vite-help/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-vite-help/src/components/ui/card.tsx +72 -0
- package/templates/frontend/react-vite-help/src/components/ui/form.tsx +165 -0
- package/templates/frontend/react-vite-help/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-vite-help/src/components/ui/label.tsx +24 -0
- package/templates/frontend/react-vite-help/src/components/ui/password-input.tsx +41 -0
- package/templates/frontend/react-vite-help/src/components/ui/separator.tsx +28 -0
- package/templates/frontend/react-vite-help/src/components/ui/tabs.tsx +62 -0
- package/templates/frontend/react-vite-help/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-vite-help/src/data/proyectos.json +56 -0
- package/templates/frontend/react-vite-help/src/index.css +104 -0
- package/templates/frontend/react-vite-help/src/lib/queryClient.ts +11 -0
- package/templates/frontend/react-vite-help/src/lib/utils.ts +6 -0
- package/templates/frontend/react-vite-help/src/main.tsx +33 -0
- package/templates/frontend/react-vite-help/src/routeTree.gen.ts +241 -0
- package/templates/frontend/react-vite-help/src/router.tsx +13 -0
- package/templates/frontend/react-vite-help/src/routes/__root.tsx +92 -0
- package/templates/frontend/react-vite-help/src/routes/auth/iniciar-sesion.tsx +139 -0
- package/templates/frontend/react-vite-help/src/routes/auth/registro.tsx +205 -0
- package/templates/frontend/react-vite-help/src/routes/contacto.tsx +60 -0
- package/templates/frontend/react-vite-help/src/routes/dashbord.tsx +9 -0
- package/templates/frontend/react-vite-help/src/routes/documentacion.tsx +80 -0
- package/templates/frontend/react-vite-help/src/routes/index.test.tsx +42 -0
- package/templates/frontend/react-vite-help/src/routes/index.tsx +211 -0
- package/templates/frontend/react-vite-help/src/routes/perfil.tsx +9 -0
- package/templates/frontend/react-vite-help/src/routes/proyectos.$proyectoId.tsx +156 -0
- package/templates/frontend/react-vite-help/src/routes/proyectos.tsx +93 -0
- package/templates/frontend/react-vite-help/src/test/setup.ts +1 -0
- package/templates/frontend/react-vite-help/tsconfig.app.json +34 -0
- package/templates/frontend/react-vite-help/tsconfig.json +10 -0
- package/templates/frontend/react-vite-help/tsconfig.node.json +26 -0
- package/templates/frontend/react-vite-help/vite.config.ts +22 -0
- package/templates/frontend/react-vite-help/vitest.config.ts +9 -0
- package/templates/mobile/.gitkeep +1 -0
- package/templates/mobile/expo-base/.cursor/rules/general-rules.mdc +231 -0
- package/templates/mobile/expo-base/.cursor/rules/react-native-rules.mdc +1348 -0
- package/templates/mobile/expo-base/.env +1 -0
- package/templates/mobile/expo-base/.husky/commit-msg +4 -0
- package/templates/mobile/expo-base/.husky/pre-commit +1 -0
- package/templates/mobile/expo-base/.lintstagedrc.js +25 -0
- package/templates/mobile/expo-base/.prettierignore +10 -0
- package/templates/mobile/expo-base/.prettierrc +11 -0
- package/templates/mobile/expo-base/.vscode/extensions.json +1 -0
- package/templates/mobile/expo-base/.vscode/settings.json +7 -0
- package/templates/mobile/expo-base/CHANGELOG.md +155 -0
- package/templates/mobile/expo-base/IMPLEMENTATION_SUMMARY.md +413 -0
- package/templates/mobile/expo-base/README.md +510 -0
- package/templates/mobile/expo-base/SETUP_NOTES.md +233 -0
- package/templates/mobile/expo-base/TEMPLATE_USAGE.md +623 -0
- package/templates/mobile/expo-base/WARP.md +123 -0
- package/templates/mobile/expo-base/app/(public)/_layout.tsx +21 -0
- package/templates/mobile/expo-base/app/(public)/forgot-password.tsx +3 -0
- package/templates/mobile/expo-base/app/(public)/login.tsx +3 -0
- package/templates/mobile/expo-base/app/(public)/register.tsx +3 -0
- package/templates/mobile/expo-base/app/(tabs)/_layout.tsx +60 -0
- package/templates/mobile/expo-base/app/(tabs)/explore.tsx +235 -0
- package/templates/mobile/expo-base/app/(tabs)/index.tsx +290 -0
- package/templates/mobile/expo-base/app/(tabs)/profile.tsx +3 -0
- package/templates/mobile/expo-base/app/_layout.tsx +143 -0
- package/templates/mobile/expo-base/app/modal.tsx +29 -0
- package/templates/mobile/expo-base/app/onboarding.tsx +3 -0
- package/templates/mobile/expo-base/app/profile/_layout.tsx +44 -0
- package/templates/mobile/expo-base/app/profile/change-password.tsx +3 -0
- package/templates/mobile/expo-base/app/profile/edit.tsx +3 -0
- package/templates/mobile/expo-base/app/settings/_layout.tsx +62 -0
- package/templates/mobile/expo-base/app/settings/about.tsx +3 -0
- package/templates/mobile/expo-base/app/settings/index.tsx +3 -0
- package/templates/mobile/expo-base/app/settings/language.tsx +3 -0
- package/templates/mobile/expo-base/app/settings/notifications.tsx +3 -0
- package/templates/mobile/expo-base/app/settings/theme.tsx +3 -0
- package/templates/mobile/expo-base/app.json +31 -0
- package/templates/mobile/expo-base/commitlint.config.js +50 -0
- package/templates/mobile/expo-base/docs/ARCHITECTURE.md +565 -0
- package/templates/mobile/expo-base/docs/CI_CD.md +461 -0
- package/templates/mobile/expo-base/docs/COMPONENTS.md +1103 -0
- package/templates/mobile/expo-base/docs/CONTRIBUTING.md +733 -0
- package/templates/mobile/expo-base/docs/DESIGN_TOKENS.md +832 -0
- package/templates/mobile/expo-base/docs/GIT_CONVENTIONS.md +411 -0
- package/templates/mobile/expo-base/docs/I18N.md +701 -0
- package/templates/mobile/expo-base/docs/TESTING.md +565 -0
- package/templates/mobile/expo-base/docs/THEMING.md +753 -0
- package/templates/mobile/expo-base/docs/VERSIONING.md +518 -0
- package/templates/mobile/expo-base/eslint.config.js +180 -0
- package/templates/mobile/expo-base/jest.config.js +51 -0
- package/templates/mobile/expo-base/jest.setup.js +106 -0
- package/templates/mobile/expo-base/package.json +74 -0
- package/templates/mobile/expo-base/pnpm-lock.yaml +11354 -0
- package/templates/mobile/expo-base/pnpm-workspace.yaml +4 -0
- package/templates/mobile/expo-base/src/__tests__/helpers/test-utils.tsx +77 -0
- package/templates/mobile/expo-base/src/__tests__/mocks/api.ts +65 -0
- package/templates/mobile/expo-base/src/__tests__/mocks/i18n.ts +22 -0
- package/templates/mobile/expo-base/src/__tests__/mocks/index.ts +7 -0
- package/templates/mobile/expo-base/src/__tests__/mocks/navigation.ts +47 -0
- package/templates/mobile/expo-base/src/__tests__/mocks/theme.ts +46 -0
- package/templates/mobile/expo-base/src/assets/images/android-icon-background.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/android-icon-foreground.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/android-icon-monochrome.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/favicon.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/icon.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/partial-react-logo.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/react-logo.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/react-logo@2x.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/react-logo@3x.png +0 -0
- package/templates/mobile/expo-base/src/assets/images/splash-icon.png +0 -0
- package/templates/mobile/expo-base/src/components/external-link.tsx +25 -0
- package/templates/mobile/expo-base/src/components/feedback/empty-state.tsx +150 -0
- package/templates/mobile/expo-base/src/components/feedback/error-boundary.tsx +145 -0
- package/templates/mobile/expo-base/src/components/feedback/error-screen.tsx +121 -0
- package/templates/mobile/expo-base/src/components/feedback/index.ts +11 -0
- package/templates/mobile/expo-base/src/components/feedback/loading.tsx +155 -0
- package/templates/mobile/expo-base/src/components/haptic-tab.tsx +18 -0
- package/templates/mobile/expo-base/src/components/hello-wave.tsx +19 -0
- package/templates/mobile/expo-base/src/components/layout/column.tsx +49 -0
- package/templates/mobile/expo-base/src/components/layout/container.tsx +41 -0
- package/templates/mobile/expo-base/src/components/layout/index.ts +14 -0
- package/templates/mobile/expo-base/src/components/layout/row.tsx +52 -0
- package/templates/mobile/expo-base/src/components/layout/screen.tsx +110 -0
- package/templates/mobile/expo-base/src/components/layout/section.tsx +37 -0
- package/templates/mobile/expo-base/src/components/parallax-scroll-view.tsx +79 -0
- package/templates/mobile/expo-base/src/components/themed-text.tsx +60 -0
- package/templates/mobile/expo-base/src/components/themed-view.tsx +14 -0
- package/templates/mobile/expo-base/src/components/ui/__tests__/button.test.tsx +206 -0
- package/templates/mobile/expo-base/src/components/ui/avatar.tsx +141 -0
- package/templates/mobile/expo-base/src/components/ui/badge.tsx +175 -0
- package/templates/mobile/expo-base/src/components/ui/button.tsx +247 -0
- package/templates/mobile/expo-base/src/components/ui/card.tsx +127 -0
- package/templates/mobile/expo-base/src/components/ui/collapsible.tsx +45 -0
- package/templates/mobile/expo-base/src/components/ui/divider.tsx +50 -0
- package/templates/mobile/expo-base/src/components/ui/icon-symbol.ios.tsx +32 -0
- package/templates/mobile/expo-base/src/components/ui/icon-symbol.tsx +41 -0
- package/templates/mobile/expo-base/src/components/ui/icon.tsx +137 -0
- package/templates/mobile/expo-base/src/components/ui/index.ts +20 -0
- package/templates/mobile/expo-base/src/components/ui/input.tsx +242 -0
- package/templates/mobile/expo-base/src/constants/theme.ts +53 -0
- package/templates/mobile/expo-base/src/contexts/auth-context.tsx +246 -0
- package/templates/mobile/expo-base/src/contexts/index.ts +8 -0
- package/templates/mobile/expo-base/src/contexts/query-client.tsx +43 -0
- package/templates/mobile/expo-base/src/contexts/theme-context.tsx +111 -0
- package/templates/mobile/expo-base/src/features/auth/forgot-password-screen.tsx +164 -0
- package/templates/mobile/expo-base/src/features/auth/index.ts +7 -0
- package/templates/mobile/expo-base/src/features/auth/login-screen.tsx +177 -0
- package/templates/mobile/expo-base/src/features/auth/register-screen.tsx +220 -0
- package/templates/mobile/expo-base/src/features/onboarding/README.md +190 -0
- package/templates/mobile/expo-base/src/features/onboarding/index.ts +7 -0
- package/templates/mobile/expo-base/src/features/onboarding/onboarding-debug.tsx +120 -0
- package/templates/mobile/expo-base/src/features/onboarding/onboarding-screen.tsx +242 -0
- package/templates/mobile/expo-base/src/features/onboarding/onboarding-utils.ts +49 -0
- package/templates/mobile/expo-base/src/features/profile/change-password-screen.tsx +154 -0
- package/templates/mobile/expo-base/src/features/profile/edit-profile-screen.tsx +183 -0
- package/templates/mobile/expo-base/src/features/profile/index.ts +7 -0
- package/templates/mobile/expo-base/src/features/profile/profile-screen.tsx +177 -0
- package/templates/mobile/expo-base/src/features/settings/about-screen.tsx +167 -0
- package/templates/mobile/expo-base/src/features/settings/index.ts +9 -0
- package/templates/mobile/expo-base/src/features/settings/language-settings-screen.tsx +97 -0
- package/templates/mobile/expo-base/src/features/settings/notifications-settings-screen.tsx +128 -0
- package/templates/mobile/expo-base/src/features/settings/settings-screen.tsx +141 -0
- package/templates/mobile/expo-base/src/features/settings/theme-settings-screen.tsx +149 -0
- package/templates/mobile/expo-base/src/hooks/__tests__/use-theme.test.ts +151 -0
- package/templates/mobile/expo-base/src/hooks/index.ts +13 -0
- package/templates/mobile/expo-base/src/hooks/use-api.ts +206 -0
- package/templates/mobile/expo-base/src/hooks/use-auth.ts +7 -0
- package/templates/mobile/expo-base/src/hooks/use-color-scheme.ts +19 -0
- package/templates/mobile/expo-base/src/hooks/use-color-scheme.web.ts +31 -0
- package/templates/mobile/expo-base/src/hooks/use-theme-color.ts +21 -0
- package/templates/mobile/expo-base/src/hooks/use-theme.ts +60 -0
- package/templates/mobile/expo-base/src/hooks/use-translation.ts +48 -0
- package/templates/mobile/expo-base/src/i18n/index.ts +113 -0
- package/templates/mobile/expo-base/src/i18n/locales/en-US.json +134 -0
- package/templates/mobile/expo-base/src/i18n/locales/es-AR.json +134 -0
- package/templates/mobile/expo-base/src/scripts/reset-project.js +112 -0
- package/templates/mobile/expo-base/src/services/api/client.ts +190 -0
- package/templates/mobile/expo-base/src/services/api/endpoints.ts +45 -0
- package/templates/mobile/expo-base/src/services/api/index.ts +7 -0
- package/templates/mobile/expo-base/src/services/storage/secure-storage.ts +56 -0
- package/templates/mobile/expo-base/src/theme/colors.ts +147 -0
- package/templates/mobile/expo-base/src/theme/index.ts +40 -0
- package/templates/mobile/expo-base/src/theme/semantic-colors.ts +221 -0
- package/templates/mobile/expo-base/src/theme/shadows.ts +123 -0
- package/templates/mobile/expo-base/src/theme/spacing.ts +118 -0
- package/templates/mobile/expo-base/src/theme/theme-config.ts +111 -0
- package/templates/mobile/expo-base/src/theme/tokens.ts +218 -0
- package/templates/mobile/expo-base/src/theme/typography.ts +152 -0
- package/templates/mobile/expo-base/src/types/index.ts +6 -0
- package/templates/mobile/expo-base/src/types/models.ts +153 -0
- package/templates/mobile/expo-base/src/types/navigation.ts +67 -0
- package/templates/mobile/expo-base/src/utils/__tests__/validators.test.ts +312 -0
- package/templates/mobile/expo-base/src/utils/constants.ts +167 -0
- package/templates/mobile/expo-base/src/utils/formatters.ts +222 -0
- package/templates/mobile/expo-base/src/utils/index.ts +7 -0
- package/templates/mobile/expo-base/src/utils/validators.ts +187 -0
- package/templates/mobile/expo-base/tsconfig.json +26 -0
|
@@ -0,0 +1,1464 @@
|
|
|
1
|
+
# Huenei API
|
|
2
|
+
|
|
3
|
+
**Template corporativo profesional de API REST** construido con NestJS, Fastify, Prisma y autenticación JWT. Diseñado como base sólida para proyectos empresariales con arquitectura escalable, seguridad robusta y excelente experiencia de desarrollo.
|
|
4
|
+
|
|
5
|
+
## Tabla de Contenidos
|
|
6
|
+
|
|
7
|
+
- [Introducción](#introducción)
|
|
8
|
+
- [Stack Tecnológico](#stack-tecnológico)
|
|
9
|
+
- [Requisitos](#requisitos)
|
|
10
|
+
- [Instalación y Setup Local](#instalación-y-setup-local)
|
|
11
|
+
- [Estructura del Proyecto](#estructura-del-proyecto)
|
|
12
|
+
- [Base de Datos y Prisma](#base-de-datos-y-prisma)
|
|
13
|
+
- [Autenticación y Autorización](#autenticación-y-autorización)
|
|
14
|
+
- [API & Endpoints](#api--endpoints)
|
|
15
|
+
- [Swagger](#swagger)
|
|
16
|
+
- [Variables de Entorno](#variables-de-entorno)
|
|
17
|
+
- [Scripts Disponibles](#scripts-disponibles)
|
|
18
|
+
- [Buenas Prácticas y Convenciones](#buenas-prácticas-y-convenciones)
|
|
19
|
+
- [Testing](#testing)
|
|
20
|
+
- [Roadmap Técnico](#roadmap-técnico)
|
|
21
|
+
- [Uso como Template](#uso-como-template)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Introducción
|
|
26
|
+
|
|
27
|
+
Este proyecto es un **template corporativo** que proporciona una base robusta y lista para producción para construir APIs REST modernas. Está diseñado siguiendo las mejores prácticas de la industria y patrones arquitectónicos probados.
|
|
28
|
+
|
|
29
|
+
### Propósito
|
|
30
|
+
|
|
31
|
+
Servir como punto de partida para proyectos empresariales que requieren:
|
|
32
|
+
- API REST escalable y mantenible
|
|
33
|
+
- Autenticación y autorización robusta
|
|
34
|
+
- Arquitectura modular y testeable
|
|
35
|
+
- Documentación viva y actualizada
|
|
36
|
+
- Código type-safe y validado
|
|
37
|
+
|
|
38
|
+
### Casos de Uso
|
|
39
|
+
|
|
40
|
+
- Base para nuevos proyectos backend corporativos
|
|
41
|
+
- Referencia de arquitectura para equipos de desarrollo
|
|
42
|
+
- Template para microservicios con requerimientos similares
|
|
43
|
+
- Prototipado rápido con estructura profesional
|
|
44
|
+
|
|
45
|
+
### Audiencia
|
|
46
|
+
|
|
47
|
+
Este proyecto está orientado a:
|
|
48
|
+
- **Desarrolladores backend** que buscan estructura sólida
|
|
49
|
+
- **Arquitectos de software** que evalúan patrones y tecnologías
|
|
50
|
+
- **Tech leads** que necesitan estandarizar proyectos en sus equipos
|
|
51
|
+
- **Equipos de desarrollo** que requieren onboarding rápido
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Stack Tecnológico
|
|
56
|
+
|
|
57
|
+
Cada tecnología fue seleccionada por razones técnicas específicas:
|
|
58
|
+
|
|
59
|
+
| Tecnología | Versión | Justificación |
|
|
60
|
+
|------------|---------|---------------|
|
|
61
|
+
| **NestJS** | 11.x | Framework progresivo con arquitectura modular, dependency injection nativo, excelente para aplicaciones enterprise |
|
|
62
|
+
| **Fastify** | 5.x | ~2x más rápido que Express, mejor soporte TypeScript, validación de schemas incorporada |
|
|
63
|
+
| **Prisma** | 7.x | ORM type-safe, migraciones automáticas, soporte multi-database, excelente DX |
|
|
64
|
+
| **SQLite** | - | Zero configuration en desarrollo, fácil migración a PostgreSQL/MySQL en producción |
|
|
65
|
+
| **JWT** | - | Autenticación stateless, escalable horizontalmente, sin necesidad de sesiones en servidor |
|
|
66
|
+
| **Swagger** | - | Documentación viva, testing manual integrado, contrato de API actualizado automáticamente |
|
|
67
|
+
| **TypeScript** | 5.7 | Type safety end-to-end, strict mode, mejor experiencia de desarrollo y mantenibilidad |
|
|
68
|
+
| **pnpm** | - | Más rápido que npm/yarn, ahorra espacio en disco con hard links, monorepo-ready |
|
|
69
|
+
| **class-validator** | - | Validación declarativa con decorators, integración perfecta con NestJS |
|
|
70
|
+
| **zod** | - | Validación type-safe de environment variables, catch errors en startup |
|
|
71
|
+
| **bcrypt** | - | Hashing seguro de passwords (10 rounds), estándar de la industria |
|
|
72
|
+
|
|
73
|
+
### ¿Por qué Fastify en lugar de Express?
|
|
74
|
+
|
|
75
|
+
- **Performance**: ~2x más rápido en benchmarks
|
|
76
|
+
- **TypeScript**: Mejor soporte nativo con tipos completos
|
|
77
|
+
- **Validación**: Schema validation incorporada
|
|
78
|
+
- **Plugins**: Sistema de plugins más robusto y moderno
|
|
79
|
+
|
|
80
|
+
### ¿Por qué Prisma?
|
|
81
|
+
|
|
82
|
+
- **Type Safety**: Tipos TypeScript generados automáticamente
|
|
83
|
+
- **Migraciones**: Sistema de migraciones robusto y versionado
|
|
84
|
+
- **Developer Experience**: Autocompletado inteligente, queries intuitivas
|
|
85
|
+
- **Multi-Database**: Cambiar de SQLite a PostgreSQL sin modificar código
|
|
86
|
+
|
|
87
|
+
### ¿Por qué SQLite por defecto?
|
|
88
|
+
|
|
89
|
+
- **Zero Config**: No requiere servidor de base de datos
|
|
90
|
+
- **Portabilidad**: Perfecto para desarrollo, demos y testing
|
|
91
|
+
- **Migración Fácil**: Se puede cambiar a PostgreSQL/MySQL en producción sin cambios de código
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Requisitos
|
|
96
|
+
|
|
97
|
+
Antes de comenzar, asegúrate de tener instalado:
|
|
98
|
+
|
|
99
|
+
### Software Necesario
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
Node.js: 20.19+ (LTS recomendado)
|
|
103
|
+
pnpm: 10+
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Instalación de pnpm
|
|
107
|
+
|
|
108
|
+
Si no tienes pnpm instalado:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install -g pnpm
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
O usando Corepack (incluido con Node.js 16.13+):
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
corepack enable
|
|
118
|
+
corepack prepare pnpm@latest --activate
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Instalación y Setup Local
|
|
124
|
+
|
|
125
|
+
Sigue estos pasos para levantar el proyecto localmente:
|
|
126
|
+
|
|
127
|
+
### 1. Clonar el Repositorio
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
git clone <repository-url>
|
|
131
|
+
cd huenei-api
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 2. Instalar Dependencias
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pnpm install
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Qué hace:** Instala todas las dependencias definidas en `package.json` usando pnpm.
|
|
141
|
+
|
|
142
|
+
### 3. Configurar Variables de Entorno
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cp .env.example .env
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Edita el archivo `.env` con tus valores. Mínimo requerido:
|
|
149
|
+
|
|
150
|
+
```env
|
|
151
|
+
DATABASE_URL="file:./dev.db"
|
|
152
|
+
JWT_SECRET="your-secret-key-minimum-32-characters-required"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Importante:** `JWT_SECRET` debe tener al menos 32 caracteres por seguridad.
|
|
156
|
+
|
|
157
|
+
### 4. Generar Prisma Client
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pnpm prisma:generate
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Qué hace:** Genera los tipos TypeScript desde `prisma/schema.prisma`. Esto crea el cliente de Prisma con autocompletado completo para tus modelos.
|
|
164
|
+
|
|
165
|
+
### 5. Crear Base de Datos y Ejecutar Migraciones
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
pnpm prisma:migrate
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Qué hace:** Aplica todas las migraciones SQL a la base de datos. En la primera ejecución, crea el archivo `dev.db` con todas las tablas necesarias.
|
|
172
|
+
|
|
173
|
+
### 6. Ejecutar Seed de Datos
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
pnpm prisma:seed
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Qué hace:** Crea datos iniciales para desarrollo:
|
|
180
|
+
- 3 usuarios con diferentes roles (admin, editor, reader)
|
|
181
|
+
- 10 posts de ejemplo
|
|
182
|
+
- Perfiles y configuraciones por defecto
|
|
183
|
+
|
|
184
|
+
### 7. Iniciar en Modo Desarrollo
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pnpm start:dev
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Qué hace:** Inicia el servidor con hot-reload en `http://localhost:3000`. Los cambios en el código se recargan automáticamente.
|
|
191
|
+
|
|
192
|
+
### Verificar la Instalación
|
|
193
|
+
|
|
194
|
+
Si todo funcionó correctamente, deberías ver:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
🚀 Application is running on: http://localhost:3000
|
|
198
|
+
📚 Swagger documentation: http://localhost:3000/docs
|
|
199
|
+
💚 Health check: http://localhost:3000/health
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Verifica accediendo a:
|
|
203
|
+
- http://localhost:3000/health → Debería retornar `{"status": "ok", "timestamp": "..."}`
|
|
204
|
+
- http://localhost:3000/docs → Interfaz de Swagger
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Estructura del Proyecto
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
src/
|
|
212
|
+
├── main.ts # Bootstrap: Fastify, Swagger, CORS, validación
|
|
213
|
+
├── app.module.ts # Módulo raíz con ThrottlerModule
|
|
214
|
+
├── app.service.ts # Servicios de aplicación
|
|
215
|
+
│
|
|
216
|
+
├── config/
|
|
217
|
+
│ └── env.validation.ts # Validación de .env con zod
|
|
218
|
+
│
|
|
219
|
+
├── common/
|
|
220
|
+
│ ├── dto/
|
|
221
|
+
│ │ ├── pagination.dto.ts # DTO reutilizable de paginación
|
|
222
|
+
│ │ └── paginated-response.dto.ts
|
|
223
|
+
│ └── filters/
|
|
224
|
+
│ └── http-exception.filter.ts # Exception filters globales para Fastify
|
|
225
|
+
│
|
|
226
|
+
├── prisma/
|
|
227
|
+
│ ├── prisma.module.ts # Módulo global de Prisma
|
|
228
|
+
│ └── prisma.service.ts # Servicio con lifecycle hooks (onModuleInit, shutdown)
|
|
229
|
+
│
|
|
230
|
+
├── auth/
|
|
231
|
+
│ ├── auth.controller.ts # POST /auth/login con rate limiting
|
|
232
|
+
│ ├── auth.service.ts # Validación de credenciales, JWT signing, bcrypt
|
|
233
|
+
│ ├── auth.module.ts # Configuración JWT (secret, 24h expiry)
|
|
234
|
+
│ ├── strategies/
|
|
235
|
+
│ │ └── jwt.strategy.ts # PassportStrategy para validación JWT
|
|
236
|
+
│ ├── guards/
|
|
237
|
+
│ │ ├── jwt-auth.guard.ts # Guard de autenticación
|
|
238
|
+
│ │ └── roles.guard.ts # Guard de autorización RBAC
|
|
239
|
+
│ ├── decorators/
|
|
240
|
+
│ │ └── roles.decorator.ts # @Roles(Role.ADMIN, Role.EDITOR)
|
|
241
|
+
│ ├── dto/
|
|
242
|
+
│ │ ├── login.dto.ts # DTO de validación de login
|
|
243
|
+
│ │ └── login-response.dto.ts
|
|
244
|
+
│ └── types.ts # Types compartidos (AuthenticatedRequest, ValidatedUser)
|
|
245
|
+
│
|
|
246
|
+
├── users/
|
|
247
|
+
│ ├── users.controller.ts # Endpoints /users/me, /users/me/profile, /users/me/settings
|
|
248
|
+
│ ├── users.service.ts # findById con exclusión automática de password
|
|
249
|
+
│ ├── users.module.ts
|
|
250
|
+
│ ├── profile.service.ts # Auto-creación de perfil, update, metadata JSON
|
|
251
|
+
│ ├── settings.service.ts # Defaults, merge automático, preferencias JSON
|
|
252
|
+
│ ├── constants/
|
|
253
|
+
│ │ └── settings.constants.ts # DEFAULT_USER_SETTINGS
|
|
254
|
+
│ └── dto/
|
|
255
|
+
│ ├── user-response.dto.ts
|
|
256
|
+
│ ├── profile-response.dto.ts
|
|
257
|
+
│ ├── update-profile.dto.ts
|
|
258
|
+
│ ├── settings-response.dto.ts
|
|
259
|
+
│ └── update-settings.dto.ts
|
|
260
|
+
│
|
|
261
|
+
├── posts/
|
|
262
|
+
│ ├── posts.controller.ts # CRUD completo con ownership validation
|
|
263
|
+
│ ├── posts.service.ts # findAll con paginación/filtros
|
|
264
|
+
│ ├── posts.module.ts
|
|
265
|
+
│ └── dto/
|
|
266
|
+
│ ├── create-post.dto.ts
|
|
267
|
+
│ ├── update-post.dto.ts
|
|
268
|
+
│ └── post-response.dto.ts
|
|
269
|
+
│
|
|
270
|
+
└── health/
|
|
271
|
+
├── health.controller.ts # GET /health (público, sin autenticación)
|
|
272
|
+
└── health.module.ts
|
|
273
|
+
|
|
274
|
+
prisma/
|
|
275
|
+
├── schema.prisma # Schema con enums, indexes, relaciones
|
|
276
|
+
├── migrations/ # Historial versionado de migraciones SQL
|
|
277
|
+
└── seed.ts # Seed con bcrypt, 3 usuarios, 10 posts
|
|
278
|
+
|
|
279
|
+
test/
|
|
280
|
+
├── unit/ # 79 tests unitarios
|
|
281
|
+
├── e2e/ # 53 tests end-to-end
|
|
282
|
+
├── fixtures/ # Test data reutilizable
|
|
283
|
+
├── helpers/ # Helpers de autenticación y base de datos
|
|
284
|
+
└── setup-e2e.ts # Setup de environment para tests
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Responsabilidades por Módulo
|
|
288
|
+
|
|
289
|
+
- **auth**: Autenticación JWT completa, validación de credenciales con bcrypt, rate limiting en login
|
|
290
|
+
- **users**: Gestión de perfiles y configuraciones de usuario con auto-creación y merge inteligente
|
|
291
|
+
- **posts**: CRUD con validación de ownership (solo el autor puede editar/eliminar sus posts)
|
|
292
|
+
- **health**: Health check para monitoring de infraestructura y deployment pipelines
|
|
293
|
+
- **prisma**: Conexión a base de datos, lifecycle management, servicio global
|
|
294
|
+
- **common**: Código compartido entre módulos (DTOs, filters, decorators)
|
|
295
|
+
- **config**: Validación de environment variables con errores claros en startup
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Base de Datos y Prisma
|
|
300
|
+
|
|
301
|
+
### Schema Actual
|
|
302
|
+
|
|
303
|
+
```prisma
|
|
304
|
+
enum Role {
|
|
305
|
+
ADMIN // Full access - puede crear/editar/eliminar cualquier recurso
|
|
306
|
+
EDITOR // Puede crear/editar/eliminar sus propios posts
|
|
307
|
+
READER // Solo lectura de recursos públicos
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
model User {
|
|
311
|
+
id Int @id @default(autoincrement())
|
|
312
|
+
email String @unique
|
|
313
|
+
password String // Hasheado con bcrypt (10 rounds)
|
|
314
|
+
name String?
|
|
315
|
+
role Role @default(READER)
|
|
316
|
+
createdAt DateTime @default(now())
|
|
317
|
+
updatedAt DateTime @updatedAt
|
|
318
|
+
|
|
319
|
+
// Relaciones
|
|
320
|
+
posts Post[]
|
|
321
|
+
profile UserProfile?
|
|
322
|
+
settings UserSettings?
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
model UserProfile {
|
|
326
|
+
id Int @id @default(autoincrement())
|
|
327
|
+
userId Int @unique
|
|
328
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
329
|
+
|
|
330
|
+
// Campos estructurados (validación específica)
|
|
331
|
+
avatar String?
|
|
332
|
+
bio String?
|
|
333
|
+
phone String?
|
|
334
|
+
website String?
|
|
335
|
+
publicName String?
|
|
336
|
+
|
|
337
|
+
// Metadata flexible para extensibilidad (redes sociales, campos custom)
|
|
338
|
+
metadata Json?
|
|
339
|
+
|
|
340
|
+
createdAt DateTime @default(now())
|
|
341
|
+
updatedAt DateTime @updatedAt
|
|
342
|
+
|
|
343
|
+
@@index([publicName])
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
model UserSettings {
|
|
347
|
+
id Int @id @default(autoincrement())
|
|
348
|
+
userId Int @unique
|
|
349
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
350
|
+
|
|
351
|
+
// JSON para máxima flexibilidad (theme, language, notifications, privacy, etc)
|
|
352
|
+
preferences Json
|
|
353
|
+
|
|
354
|
+
createdAt DateTime @default(now())
|
|
355
|
+
updatedAt DateTime @updatedAt
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
model Post {
|
|
359
|
+
id Int @id @default(autoincrement())
|
|
360
|
+
title String
|
|
361
|
+
content String
|
|
362
|
+
published Boolean @default(false)
|
|
363
|
+
createdAt DateTime @default(now())
|
|
364
|
+
authorId Int
|
|
365
|
+
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
|
366
|
+
|
|
367
|
+
// Indexes para optimizar queries frecuentes
|
|
368
|
+
@@index([authorId])
|
|
369
|
+
@@index([published])
|
|
370
|
+
@@index([authorId, published]) // Composite index
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Relaciones
|
|
375
|
+
|
|
376
|
+
- **User 1:N Post** - Un usuario puede tener múltiples posts (cascade delete)
|
|
377
|
+
- **User 1:1 UserProfile** - Un usuario tiene un perfil (cascade delete)
|
|
378
|
+
- **User 1:1 UserSettings** - Un usuario tiene configuraciones (cascade delete)
|
|
379
|
+
|
|
380
|
+
### Decisiones de Diseño
|
|
381
|
+
|
|
382
|
+
**Enums en Base de Datos**
|
|
383
|
+
- `Role` enum garantiza type-safety y validación a nivel de BD
|
|
384
|
+
- Evita inconsistencias con valores hardcodeados en código
|
|
385
|
+
|
|
386
|
+
**JSON Flexible**
|
|
387
|
+
- `UserProfile.metadata` permite agregar campos custom sin migraciones (redes sociales, badges, etc)
|
|
388
|
+
- `UserSettings.preferences` soporta cualquier configuración futura sin cambiar schema
|
|
389
|
+
|
|
390
|
+
**Indexes Estratégicos**
|
|
391
|
+
- `@@index([authorId])` optimiza queries de "posts por autor"
|
|
392
|
+
- `@@index([published])` optimiza queries de "posts públicos"
|
|
393
|
+
- `@@index([authorId, published])` optimiza "posts de autor filtrados por estado"
|
|
394
|
+
- `@@index([publicName])` permite búsqueda eficiente de perfiles
|
|
395
|
+
|
|
396
|
+
**Cascade Deletes**
|
|
397
|
+
- Eliminar usuario → elimina automáticamente sus posts, perfil y settings
|
|
398
|
+
- Garantiza integridad referencial sin código adicional
|
|
399
|
+
|
|
400
|
+
### Cómo Agregar un Nuevo Modelo
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
# 1. Editar prisma/schema.prisma
|
|
404
|
+
model Product {
|
|
405
|
+
id Int @id @default(autoincrement())
|
|
406
|
+
name String
|
|
407
|
+
description String?
|
|
408
|
+
price Decimal
|
|
409
|
+
createdAt DateTime @default(now())
|
|
410
|
+
|
|
411
|
+
@@index([name])
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
# 2. Crear y aplicar migración
|
|
415
|
+
pnpm prisma:migrate
|
|
416
|
+
# Ingresa nombre descriptivo: "add_product_model"
|
|
417
|
+
|
|
418
|
+
# 3. Regenerar Prisma Client
|
|
419
|
+
pnpm prisma:generate
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Prisma generará automáticamente:
|
|
423
|
+
- Tipos TypeScript para el modelo
|
|
424
|
+
- CRUD operations type-safe
|
|
425
|
+
- Relaciones y validaciones
|
|
426
|
+
|
|
427
|
+
### Cómo Migrar a PostgreSQL/MySQL
|
|
428
|
+
|
|
429
|
+
**Paso 1: Cambiar datasource en `prisma/schema.prisma`**
|
|
430
|
+
|
|
431
|
+
```prisma
|
|
432
|
+
datasource db {
|
|
433
|
+
provider = "postgresql" // o "mysql"
|
|
434
|
+
url = env("DATABASE_URL")
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**Paso 2: Actualizar `DATABASE_URL` en `.env`**
|
|
439
|
+
|
|
440
|
+
```env
|
|
441
|
+
# PostgreSQL
|
|
442
|
+
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
|
|
443
|
+
|
|
444
|
+
# MySQL
|
|
445
|
+
DATABASE_URL="mysql://user:password@localhost:3306/dbname"
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Paso 3: Cambiar adapter de Prisma 7 (si es necesario)**
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
# Para PostgreSQL
|
|
452
|
+
pnpm remove @prisma/adapter-libsql @libsql/client
|
|
453
|
+
pnpm add pg
|
|
454
|
+
|
|
455
|
+
# Para MySQL
|
|
456
|
+
pnpm remove @prisma/adapter-libsql @libsql/client
|
|
457
|
+
pnpm add mysql2
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Paso 4: Actualizar `src/prisma/prisma.service.ts`** (si usas adapter)
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
// Remover PrismaLibSql adapter
|
|
464
|
+
// Prisma Client funciona directamente con PostgreSQL/MySQL
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Paso 5: Recrear migraciones**
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
rm -rf prisma/migrations
|
|
471
|
+
pnpm prisma:migrate
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Autenticación y Autorización
|
|
477
|
+
|
|
478
|
+
### JWT Flow
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
1. Client → POST /auth/login (email, password)
|
|
482
|
+
2. AuthService.validateUser() → Verifica credenciales con bcrypt.compare()
|
|
483
|
+
3. AuthService.login() → Genera JWT con payload: {sub, email, role}
|
|
484
|
+
4. Client ← access_token (válido 24 horas)
|
|
485
|
+
5. Client → Requests con Header: Authorization: Bearer <token>
|
|
486
|
+
6. JwtAuthGuard → Valida token automáticamente con passport-jwt
|
|
487
|
+
7. Request.user = {id, email, role} disponible en controllers
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Estructura del JWT
|
|
491
|
+
|
|
492
|
+
```json
|
|
493
|
+
{
|
|
494
|
+
"sub": 1, // User ID
|
|
495
|
+
"email": "admin@huenei.com",
|
|
496
|
+
"role": "ADMIN",
|
|
497
|
+
"iat": 1706031234, // Issued at
|
|
498
|
+
"exp": 1706117634 // Expires (24h después)
|
|
499
|
+
}
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Guards Implementados
|
|
503
|
+
|
|
504
|
+
**1. JwtAuthGuard (Autenticación)**
|
|
505
|
+
|
|
506
|
+
Valida que el usuario esté autenticado con JWT válido:
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
@UseGuards(JwtAuthGuard)
|
|
510
|
+
@Get('/users/me')
|
|
511
|
+
getProfile(@Request() req: AuthenticatedRequest) {
|
|
512
|
+
// req.user disponible con {id, email, role}
|
|
513
|
+
return this.usersService.findById(req.user.id);
|
|
514
|
+
}
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
**2. RolesGuard (Autorización)**
|
|
518
|
+
|
|
519
|
+
Valida que el usuario tenga el rol requerido:
|
|
520
|
+
|
|
521
|
+
```typescript
|
|
522
|
+
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
523
|
+
@Roles(Role.ADMIN, Role.EDITOR)
|
|
524
|
+
@Post('/posts')
|
|
525
|
+
createPost(@Body() dto: CreatePostDto, @Request() req: AuthenticatedRequest) {
|
|
526
|
+
// Solo ADMIN y EDITOR pueden acceder
|
|
527
|
+
return this.postsService.create(dto, req.user.id);
|
|
528
|
+
}
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### Sistema de Roles
|
|
532
|
+
|
|
533
|
+
| Rol | Permisos |
|
|
534
|
+
|-----|----------|
|
|
535
|
+
| **ADMIN** | Full access - crear/editar/eliminar cualquier recurso |
|
|
536
|
+
| **EDITOR** | Crear/editar/eliminar sus propios posts |
|
|
537
|
+
| **READER** | Solo lectura de recursos públicos |
|
|
538
|
+
|
|
539
|
+
### Endpoints Protegidos
|
|
540
|
+
|
|
541
|
+
Requieren `Authorization: Bearer <token>`:
|
|
542
|
+
|
|
543
|
+
- `GET /users/me` → Perfil del usuario autenticado
|
|
544
|
+
- `GET /users/me/profile` → Perfil extendido
|
|
545
|
+
- `PATCH /users/me/profile` → Actualizar perfil
|
|
546
|
+
- `GET /users/me/settings` → Configuraciones
|
|
547
|
+
- `PATCH /users/me/settings` → Actualizar configuraciones
|
|
548
|
+
- `POST /posts` → Crear post (requiere Role: ADMIN o EDITOR)
|
|
549
|
+
- `PATCH /posts/:id` → Actualizar post (requiere ownership: ser el autor)
|
|
550
|
+
- `DELETE /posts/:id` → Eliminar post (requiere ownership: ser el autor)
|
|
551
|
+
|
|
552
|
+
### Endpoints Públicos
|
|
553
|
+
|
|
554
|
+
No requieren autenticación:
|
|
555
|
+
|
|
556
|
+
- `GET /health` → Health check
|
|
557
|
+
- `POST /auth/login` → Login
|
|
558
|
+
- `GET /posts` → Listar posts (con filtros opcionales)
|
|
559
|
+
- `GET /posts/:id` → Ver post específico
|
|
560
|
+
|
|
561
|
+
### Rate Limiting
|
|
562
|
+
|
|
563
|
+
**Login endpoint:**
|
|
564
|
+
- 5 intentos por minuto
|
|
565
|
+
- Protección contra ataques de fuerza bruta
|
|
566
|
+
|
|
567
|
+
**Global:**
|
|
568
|
+
- 100 requests por minuto por IP
|
|
569
|
+
- Configurable en `app.module.ts`
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
## API & Endpoints
|
|
574
|
+
|
|
575
|
+
### Convenciones REST
|
|
576
|
+
|
|
577
|
+
| Método | Propósito | Idempotente |
|
|
578
|
+
|--------|-----------|-------------|
|
|
579
|
+
| `GET` | Leer recursos | ✅ Sí |
|
|
580
|
+
| `POST` | Crear recursos | ❌ No |
|
|
581
|
+
| `PATCH` | Actualización parcial | ✅ Sí |
|
|
582
|
+
| `DELETE` | Eliminar recursos | ✅ Sí |
|
|
583
|
+
|
|
584
|
+
### HTTP Status Codes
|
|
585
|
+
|
|
586
|
+
| Código | Significado | Uso |
|
|
587
|
+
|--------|-------------|-----|
|
|
588
|
+
| `200 OK` | Éxito | GET, PATCH exitosos |
|
|
589
|
+
| `201 Created` | Recurso creado | POST exitoso |
|
|
590
|
+
| `400 Bad Request` | Validación fallida | DTO inválido, campos requeridos faltantes |
|
|
591
|
+
| `401 Unauthorized` | Sin autenticación | Token ausente, token inválido o expirado |
|
|
592
|
+
| `403 Forbidden` | Sin autorización | Role insuficiente para la operación |
|
|
593
|
+
| `404 Not Found` | Recurso no existe | ID inexistente o sin ownership |
|
|
594
|
+
| `429 Too Many Requests` | Rate limit excedido | Demasiadas requests en ventana de tiempo |
|
|
595
|
+
|
|
596
|
+
### Paginación
|
|
597
|
+
|
|
598
|
+
Endpoints que retornan listas soportan paginación:
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
GET /posts?page=1&limit=10&published=true
|
|
602
|
+
|
|
603
|
+
# Response:
|
|
604
|
+
{
|
|
605
|
+
"data": [
|
|
606
|
+
{
|
|
607
|
+
"id": 1,
|
|
608
|
+
"title": "Post Title",
|
|
609
|
+
"content": "...",
|
|
610
|
+
"published": true,
|
|
611
|
+
"createdAt": "2026-01-24T...",
|
|
612
|
+
"author": {
|
|
613
|
+
"id": 1,
|
|
614
|
+
"email": "admin@huenei.com",
|
|
615
|
+
"name": "Admin User"
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
],
|
|
619
|
+
"meta": {
|
|
620
|
+
"page": 1,
|
|
621
|
+
"limit": 10,
|
|
622
|
+
"total": 50,
|
|
623
|
+
"totalPages": 5
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
**Parámetros de paginación:**
|
|
629
|
+
- `page` - Número de página (default: 1, min: 1)
|
|
630
|
+
- `limit` - Items por página (default: 10, max: 100)
|
|
631
|
+
|
|
632
|
+
### Ejemplos de Requests
|
|
633
|
+
|
|
634
|
+
**Login:**
|
|
635
|
+
|
|
636
|
+
```bash
|
|
637
|
+
curl -X POST http://localhost:3000/auth/login \
|
|
638
|
+
-H "Content-Type: application/json" \
|
|
639
|
+
-d '{
|
|
640
|
+
"email": "admin@huenei.com",
|
|
641
|
+
"password": "Admin123!"
|
|
642
|
+
}'
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
**Response:**
|
|
646
|
+
```json
|
|
647
|
+
{
|
|
648
|
+
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
649
|
+
"user": {
|
|
650
|
+
"id": 1,
|
|
651
|
+
"email": "admin@huenei.com",
|
|
652
|
+
"name": "Admin User",
|
|
653
|
+
"role": "ADMIN"
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
**Get Profile (autenticado):**
|
|
659
|
+
|
|
660
|
+
```bash
|
|
661
|
+
curl http://localhost:3000/users/me \
|
|
662
|
+
-H "Authorization: Bearer <token>"
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
**Response:**
|
|
666
|
+
```json
|
|
667
|
+
{
|
|
668
|
+
"id": 1,
|
|
669
|
+
"email": "admin@huenei.com",
|
|
670
|
+
"name": "Admin User",
|
|
671
|
+
"role": "ADMIN",
|
|
672
|
+
"createdAt": "2026-01-24T...",
|
|
673
|
+
"updatedAt": "2026-01-24T..."
|
|
674
|
+
}
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
**Create Post:**
|
|
678
|
+
|
|
679
|
+
```bash
|
|
680
|
+
curl -X POST http://localhost:3000/posts \
|
|
681
|
+
-H "Authorization: Bearer <token>" \
|
|
682
|
+
-H "Content-Type: application/json" \
|
|
683
|
+
-d '{
|
|
684
|
+
"title": "My New Post",
|
|
685
|
+
"content": "This is the content of my post.",
|
|
686
|
+
"published": false
|
|
687
|
+
}'
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
**Get Posts (público, con filtro):**
|
|
691
|
+
|
|
692
|
+
```bash
|
|
693
|
+
curl "http://localhost:3000/posts?published=true&page=1&limit=10"
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
**Update Post (requiere ownership):**
|
|
697
|
+
|
|
698
|
+
```bash
|
|
699
|
+
curl -X PATCH http://localhost:3000/posts/1 \
|
|
700
|
+
-H "Authorization: Bearer <token>" \
|
|
701
|
+
-H "Content-Type: application/json" \
|
|
702
|
+
-d '{
|
|
703
|
+
"published": true
|
|
704
|
+
}'
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
---
|
|
708
|
+
|
|
709
|
+
## Swagger
|
|
710
|
+
|
|
711
|
+
### Acceso
|
|
712
|
+
|
|
713
|
+
**Interfaz UI:**
|
|
714
|
+
```
|
|
715
|
+
http://localhost:3000/docs
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
**Documento OpenAPI JSON:**
|
|
719
|
+
```
|
|
720
|
+
http://localhost:3000/docs-json
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Uso de JWT en Swagger
|
|
724
|
+
|
|
725
|
+
**Paso 1:** Login
|
|
726
|
+
|
|
727
|
+
1. Ir a `POST /auth/login` en Swagger
|
|
728
|
+
2. Click en "Try it out"
|
|
729
|
+
3. Ingresar credenciales:
|
|
730
|
+
```json
|
|
731
|
+
{
|
|
732
|
+
"email": "admin@huenei.com",
|
|
733
|
+
"password": "Admin123!"
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
4. Click en "Execute"
|
|
737
|
+
5. Copiar el `access_token` de la respuesta
|
|
738
|
+
|
|
739
|
+
**Paso 2:** Autenticarse
|
|
740
|
+
|
|
741
|
+
1. Click en botón **"Authorize"** (candado verde) en la esquina superior derecha
|
|
742
|
+
2. Pegar el token en el campo (Swagger agregará "Bearer " automáticamente)
|
|
743
|
+
3. Click en "Authorize"
|
|
744
|
+
4. Click en "Close"
|
|
745
|
+
|
|
746
|
+
**Paso 3:** Usar endpoints protegidos
|
|
747
|
+
|
|
748
|
+
Ahora puedes probar cualquier endpoint protegido como:
|
|
749
|
+
- `GET /users/me`
|
|
750
|
+
- `POST /posts`
|
|
751
|
+
- `PATCH /users/me/profile`
|
|
752
|
+
|
|
753
|
+
### Usuarios para Testing
|
|
754
|
+
|
|
755
|
+
El seed crea 3 usuarios con diferentes roles:
|
|
756
|
+
|
|
757
|
+
| Email | Password | Rol | Uso |
|
|
758
|
+
|-------|----------|-----|-----|
|
|
759
|
+
| admin@huenei.com | Admin123! | ADMIN | Full access, testing de roles |
|
|
760
|
+
| editor@huenei.com | Editor123! | EDITOR | Crear/editar posts propios |
|
|
761
|
+
| reader@huenei.com | Reader123! | READER | Solo lectura, testing de restricciones |
|
|
762
|
+
|
|
763
|
+
### Tags en Swagger
|
|
764
|
+
|
|
765
|
+
Los endpoints están organizados por tags:
|
|
766
|
+
|
|
767
|
+
- **Health** → Health check de la aplicación
|
|
768
|
+
- **Authentication** → Login y gestión de tokens
|
|
769
|
+
- **Users** → Gestión de perfil y configuraciones
|
|
770
|
+
- **Posts** → CRUD completo de posts
|
|
771
|
+
|
|
772
|
+
### Qué se Documenta
|
|
773
|
+
|
|
774
|
+
- **Todos los endpoints** con descripción de operación
|
|
775
|
+
- **Parámetros** de path, query y body
|
|
776
|
+
- **DTOs** con validaciones y ejemplos
|
|
777
|
+
- **Respuestas HTTP** con status codes y schemas
|
|
778
|
+
- **Autenticación** (Bearer JWT)
|
|
779
|
+
- **Filtros y paginación**
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
## Variables de Entorno
|
|
784
|
+
|
|
785
|
+
### Archivo `.env` Requerido
|
|
786
|
+
|
|
787
|
+
Crea un archivo `.env` en la raíz del proyecto:
|
|
788
|
+
|
|
789
|
+
```env
|
|
790
|
+
# Database
|
|
791
|
+
DATABASE_URL="file:./dev.db"
|
|
792
|
+
|
|
793
|
+
# JWT Authentication
|
|
794
|
+
JWT_SECRET="your-secret-key-minimum-32-characters-required"
|
|
795
|
+
|
|
796
|
+
# Server
|
|
797
|
+
PORT=3000
|
|
798
|
+
|
|
799
|
+
# CORS
|
|
800
|
+
ALLOWED_ORIGINS="http://localhost:3000,http://localhost:3001"
|
|
801
|
+
|
|
802
|
+
# Environment (opcional, default: development)
|
|
803
|
+
NODE_ENV=development
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
### Validación con Zod
|
|
807
|
+
|
|
808
|
+
Las variables de entorno se validan al inicio con errores claros:
|
|
809
|
+
|
|
810
|
+
| Variable | Tipo | Validación | Default |
|
|
811
|
+
|----------|------|------------|---------|
|
|
812
|
+
| `DATABASE_URL` | string | Requerido, min 1 character | - |
|
|
813
|
+
| `JWT_SECRET` | string | Requerido, min 32 characters | - |
|
|
814
|
+
| `PORT` | number | Convertido a number | 3000 |
|
|
815
|
+
| `ALLOWED_ORIGINS` | string | Opcional, comma-separated | - |
|
|
816
|
+
| `NODE_ENV` | enum | development \| production \| test | development |
|
|
817
|
+
|
|
818
|
+
### Importante
|
|
819
|
+
|
|
820
|
+
**⚠️ Seguridad:**
|
|
821
|
+
|
|
822
|
+
- **Cambiar `JWT_SECRET` en producción** - Debe ser un string aleatorio de al menos 32 caracteres
|
|
823
|
+
- **Nunca commitear `.env`** - Ya está en `.gitignore`
|
|
824
|
+
- **Usar PostgreSQL/MySQL en producción** - SQLite es solo para desarrollo
|
|
825
|
+
- **Configurar `ALLOWED_ORIGINS`** - Especificar dominios reales de frontend
|
|
826
|
+
|
|
827
|
+
**Ejemplo de JWT_SECRET seguro:**
|
|
828
|
+
```bash
|
|
829
|
+
# Generar con openssl:
|
|
830
|
+
openssl rand -base64 32
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
### Archivo `.env.test`
|
|
834
|
+
|
|
835
|
+
Para tests, se usa configuración separada:
|
|
836
|
+
|
|
837
|
+
```env
|
|
838
|
+
DATABASE_URL="file:./test.db"
|
|
839
|
+
JWT_SECRET="test-secret-key-32-characters-minimum-length"
|
|
840
|
+
NODE_ENV=test
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
---
|
|
844
|
+
|
|
845
|
+
## Scripts Disponibles
|
|
846
|
+
|
|
847
|
+
### Desarrollo
|
|
848
|
+
|
|
849
|
+
```bash
|
|
850
|
+
# Iniciar servidor
|
|
851
|
+
pnpm start # Modo normal
|
|
852
|
+
pnpm start:dev # Con hot-reload (recomendado)
|
|
853
|
+
pnpm start:debug # Modo debug (puerto 9229)
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
### Producción
|
|
857
|
+
|
|
858
|
+
```bash
|
|
859
|
+
# Compilar y ejecutar
|
|
860
|
+
pnpm build # Compila TypeScript a dist/
|
|
861
|
+
pnpm start:prod # Ejecuta desde dist/main.js
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
### Prisma
|
|
865
|
+
|
|
866
|
+
```bash
|
|
867
|
+
# Generar Prisma Client
|
|
868
|
+
pnpm prisma:generate # Genera tipos TypeScript
|
|
869
|
+
|
|
870
|
+
# Migraciones
|
|
871
|
+
pnpm prisma:migrate # Crea y aplica nueva migración
|
|
872
|
+
|
|
873
|
+
# Herramientas
|
|
874
|
+
pnpm prisma:studio # Abre GUI de base de datos (localhost:5555)
|
|
875
|
+
pnpm prisma:seed # Ejecuta seed manualmente
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
### Testing
|
|
879
|
+
|
|
880
|
+
```bash
|
|
881
|
+
# Tests unitarios
|
|
882
|
+
pnpm test # Ejecuta 79 tests unitarios (~5s)
|
|
883
|
+
pnpm test:watch # Modo watch para desarrollo
|
|
884
|
+
|
|
885
|
+
# Tests E2E
|
|
886
|
+
pnpm test:e2e # Ejecuta 53 tests end-to-end (~10s)
|
|
887
|
+
|
|
888
|
+
# Cobertura
|
|
889
|
+
pnpm test:cov # Genera reporte de coverage (97.34%)
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
### Code Quality
|
|
893
|
+
|
|
894
|
+
```bash
|
|
895
|
+
# Linting
|
|
896
|
+
pnpm lint # Ejecuta ESLint
|
|
897
|
+
pnpm lint --fix # Auto-fix de issues
|
|
898
|
+
|
|
899
|
+
# Formateo
|
|
900
|
+
pnpm format # Ejecuta Prettier en src/ y test/
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
### Output Esperado
|
|
904
|
+
|
|
905
|
+
Al ejecutar `pnpm start:dev`, deberías ver:
|
|
906
|
+
|
|
907
|
+
```
|
|
908
|
+
🚀 Application is running on: http://localhost:3000
|
|
909
|
+
📚 Swagger documentation: http://localhost:3000/docs
|
|
910
|
+
💚 Health check: http://localhost:3000/health
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
---
|
|
914
|
+
|
|
915
|
+
## Buenas Prácticas y Convenciones
|
|
916
|
+
|
|
917
|
+
### Naming Conventions
|
|
918
|
+
|
|
919
|
+
| Tipo | Convención | Ejemplo |
|
|
920
|
+
|------|------------|---------|
|
|
921
|
+
| Controllers | `kebab-case.controller.ts` | `users.controller.ts` → `UsersController` |
|
|
922
|
+
| Services | `kebab-case.service.ts` | `users.service.ts` → `UsersService` |
|
|
923
|
+
| DTOs | `kebab-case.dto.ts` | `create-user.dto.ts` → `CreateUserDto` |
|
|
924
|
+
| Modules | `kebab-case.module.ts` | `users.module.ts` → `UsersModule` |
|
|
925
|
+
| Interfaces | `kebab-case.interface.ts` | `user.interface.ts` → `User` |
|
|
926
|
+
| Enums | Definidos en Prisma | `Role` (ADMIN, EDITOR, READER) |
|
|
927
|
+
|
|
928
|
+
### DTOs
|
|
929
|
+
|
|
930
|
+
**Siempre:**
|
|
931
|
+
- Usar decorators de `class-validator` para validación
|
|
932
|
+
- Documentar con `@ApiProperty` para Swagger
|
|
933
|
+
- Separar request DTOs de response DTOs
|
|
934
|
+
- Usar `PartialType()` o `OmitType()` para DTOs derivados
|
|
935
|
+
|
|
936
|
+
**Ejemplo completo:**
|
|
937
|
+
|
|
938
|
+
```typescript
|
|
939
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
940
|
+
import { IsEmail, IsNotEmpty, MinLength } from 'class-validator';
|
|
941
|
+
|
|
942
|
+
export class CreateUserDto {
|
|
943
|
+
@ApiProperty({
|
|
944
|
+
description: 'User email address',
|
|
945
|
+
example: 'user@example.com',
|
|
946
|
+
})
|
|
947
|
+
@IsEmail()
|
|
948
|
+
@IsNotEmpty()
|
|
949
|
+
email: string;
|
|
950
|
+
|
|
951
|
+
@ApiProperty({
|
|
952
|
+
description: 'User password',
|
|
953
|
+
example: 'SecurePass123!',
|
|
954
|
+
minLength: 8,
|
|
955
|
+
})
|
|
956
|
+
@IsNotEmpty()
|
|
957
|
+
@MinLength(8)
|
|
958
|
+
password: string;
|
|
959
|
+
}
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
### Services
|
|
963
|
+
|
|
964
|
+
**Principios:**
|
|
965
|
+
- **Lógica de negocio pura** - No incluir lógica HTTP (status codes, responses)
|
|
966
|
+
- **Retornar datos** - Dejar que controllers manejen la serialización
|
|
967
|
+
- **Lanzar excepciones** - `NotFoundException`, `BadRequestException`, etc.
|
|
968
|
+
- **Inyección de dependencias** - Siempre por constructor
|
|
969
|
+
- **Usar Prisma** - Para todo acceso a datos
|
|
970
|
+
|
|
971
|
+
**Ejemplo:**
|
|
972
|
+
|
|
973
|
+
```typescript
|
|
974
|
+
@Injectable()
|
|
975
|
+
export class UsersService {
|
|
976
|
+
constructor(private prisma: PrismaService) {}
|
|
977
|
+
|
|
978
|
+
async findById(id: number): Promise<User> {
|
|
979
|
+
const user = await this.prisma.user.findUnique({
|
|
980
|
+
where: { id },
|
|
981
|
+
select: {
|
|
982
|
+
id: true,
|
|
983
|
+
email: true,
|
|
984
|
+
name: true,
|
|
985
|
+
role: true,
|
|
986
|
+
createdAt: true,
|
|
987
|
+
updatedAt: true,
|
|
988
|
+
// password: false (excluido)
|
|
989
|
+
},
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
if (!user) {
|
|
993
|
+
throw new NotFoundException(`User with ID ${id} not found`);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return user;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
### Controllers
|
|
1002
|
+
|
|
1003
|
+
**Responsabilidades:**
|
|
1004
|
+
- **Solo HTTP logic** - Manejar requests y responses
|
|
1005
|
+
- **Delegar a services** - No incluir lógica de negocio
|
|
1006
|
+
- **Validación automática** - Con DTOs y `ValidationPipe`
|
|
1007
|
+
- **Documentación Swagger** - Con decorators `@Api*`
|
|
1008
|
+
|
|
1009
|
+
**Ejemplo:**
|
|
1010
|
+
|
|
1011
|
+
```typescript
|
|
1012
|
+
@ApiTags('Users')
|
|
1013
|
+
@Controller('users')
|
|
1014
|
+
export class UsersController {
|
|
1015
|
+
constructor(private readonly usersService: UsersService) {}
|
|
1016
|
+
|
|
1017
|
+
@Get('me')
|
|
1018
|
+
@UseGuards(JwtAuthGuard)
|
|
1019
|
+
@ApiBearerAuth('JWT-auth')
|
|
1020
|
+
@ApiOperation({ summary: 'Get current user profile' })
|
|
1021
|
+
@ApiResponse({ status: 200, description: 'User found', type: UserResponseDto })
|
|
1022
|
+
@ApiResponse({ status: 401, description: 'Unauthorized' })
|
|
1023
|
+
async getProfile(@Request() req: AuthenticatedRequest): Promise<UserResponseDto> {
|
|
1024
|
+
return this.usersService.findById(req.user.id);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
### Prisma
|
|
1030
|
+
|
|
1031
|
+
**Buenas prácticas:**
|
|
1032
|
+
- **Nunca SQL raw** - Usar Prisma Client exclusivamente
|
|
1033
|
+
- **Transacciones** - Para operaciones múltiples relacionadas
|
|
1034
|
+
- **Excluir campos sensibles** - Usar `select` para no exponer passwords
|
|
1035
|
+
- **Aprovechar type-safety** - Dejar que TypeScript valide queries
|
|
1036
|
+
|
|
1037
|
+
**Transacciones:**
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
async transferPost(postId: number, newAuthorId: number) {
|
|
1041
|
+
return this.prisma.$transaction(async (tx) => {
|
|
1042
|
+
const post = await tx.post.findUnique({ where: { id: postId } });
|
|
1043
|
+
if (!post) throw new NotFoundException();
|
|
1044
|
+
|
|
1045
|
+
return tx.post.update({
|
|
1046
|
+
where: { id: postId },
|
|
1047
|
+
data: { authorId: newAuthorId },
|
|
1048
|
+
});
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
### Errores Comunes a Evitar
|
|
1054
|
+
|
|
1055
|
+
| ❌ No Hacer | ✅ Hacer |
|
|
1056
|
+
|-------------|----------|
|
|
1057
|
+
| Exponer campo `password` en responses | Usar `select` en Prisma para excluirlo |
|
|
1058
|
+
| Olvidar decorators de validación en DTOs | Siempre usar `@IsString()`, `@IsNotEmpty()`, etc. |
|
|
1059
|
+
| No usar guards en endpoints protegidos | Aplicar `@UseGuards(JwtAuthGuard)` |
|
|
1060
|
+
| Olvidar documentar en Swagger | Usar `@ApiOperation()`, `@ApiResponse()` |
|
|
1061
|
+
| Hardcodear valores de configuración | Usar variables de entorno |
|
|
1062
|
+
| No usar índices en queries frecuentes | Agregar `@@index()` en schema.prisma |
|
|
1063
|
+
| No testear edge cases | Escribir tests para casos límite y errores |
|
|
1064
|
+
| Mezclar lógica HTTP con lógica de negocio | Separar en controllers y services |
|
|
1065
|
+
|
|
1066
|
+
---
|
|
1067
|
+
|
|
1068
|
+
## Testing
|
|
1069
|
+
|
|
1070
|
+
### Suite Completa Implementada
|
|
1071
|
+
|
|
1072
|
+
El proyecto incluye **132 tests** con **97.34% de cobertura**:
|
|
1073
|
+
|
|
1074
|
+
### Cobertura
|
|
1075
|
+
|
|
1076
|
+
| Métrica | Cobertura | Estado |
|
|
1077
|
+
|---------|-----------|--------|
|
|
1078
|
+
| **Statements** | 97.34% | ✅ Excelente |
|
|
1079
|
+
| **Branches** | 81.42% | ✅ Bueno |
|
|
1080
|
+
| **Functions** | 91.83% | ✅ Muy bueno |
|
|
1081
|
+
| **Lines** | 96.93% | ✅ Excelente |
|
|
1082
|
+
|
|
1083
|
+
### Tests Unitarios (79 tests)
|
|
1084
|
+
|
|
1085
|
+
**Servicios:**
|
|
1086
|
+
- `AuthService` (7 tests) - validateUser, login, hashPassword
|
|
1087
|
+
- `UsersService` (3 tests) - findById, password exclusion
|
|
1088
|
+
- `ProfileService` (4 tests) - getProfile, updateProfile, auto-creation
|
|
1089
|
+
- `SettingsService` (6 tests) - getSettings, updateSettings, defaults, merge
|
|
1090
|
+
- `PostsService` (16 tests) - CRUD, filtros, ownership validation
|
|
1091
|
+
|
|
1092
|
+
**Controllers:**
|
|
1093
|
+
- `AuthController` (3 tests)
|
|
1094
|
+
- `UsersController` (6 tests)
|
|
1095
|
+
- `PostsController` (8 tests)
|
|
1096
|
+
- `HealthController` (3 tests)
|
|
1097
|
+
|
|
1098
|
+
**Guards & Filters:**
|
|
1099
|
+
- `JwtAuthGuard` (5 tests)
|
|
1100
|
+
- `JwtStrategy` (4 tests)
|
|
1101
|
+
- `HttpExceptionFilter` (9 tests)
|
|
1102
|
+
- `AllExceptionsFilter` (incluido)
|
|
1103
|
+
|
|
1104
|
+
**Otros:**
|
|
1105
|
+
- `AppService` (5 tests)
|
|
1106
|
+
|
|
1107
|
+
### Tests E2E (53 tests)
|
|
1108
|
+
|
|
1109
|
+
**Health (2 tests):**
|
|
1110
|
+
- GET /health retorna status ok
|
|
1111
|
+
- Respuesta contiene timestamp válido
|
|
1112
|
+
|
|
1113
|
+
**Authentication (8 tests):**
|
|
1114
|
+
- Login exitoso con credenciales válidas
|
|
1115
|
+
- Login fallido con email incorrecto (401)
|
|
1116
|
+
- Login fallido con password incorrecta (401)
|
|
1117
|
+
- Validación de DTOs (email inválido, campos faltantes)
|
|
1118
|
+
|
|
1119
|
+
**Users (18 tests):**
|
|
1120
|
+
- GET /users/me (con/sin token)
|
|
1121
|
+
- GET /users/me/profile (auto-creación)
|
|
1122
|
+
- PATCH /users/me/profile (actualización parcial)
|
|
1123
|
+
- GET /users/me/settings (defaults)
|
|
1124
|
+
- PATCH /users/me/settings (merge)
|
|
1125
|
+
|
|
1126
|
+
**Posts (25 tests):**
|
|
1127
|
+
- POST /posts (creación, validación)
|
|
1128
|
+
- GET /posts (listado, filtros, paginación)
|
|
1129
|
+
- GET /posts/:id (detalle, 404)
|
|
1130
|
+
- PATCH /posts/:id (actualización, ownership)
|
|
1131
|
+
- DELETE /posts/:id (eliminación, ownership)
|
|
1132
|
+
|
|
1133
|
+
### Comandos
|
|
1134
|
+
|
|
1135
|
+
```bash
|
|
1136
|
+
# Tests unitarios
|
|
1137
|
+
pnpm test # Ejecuta todos los tests unitarios (~5 segundos)
|
|
1138
|
+
pnpm test:watch # Modo watch para desarrollo
|
|
1139
|
+
|
|
1140
|
+
# Tests E2E
|
|
1141
|
+
pnpm test:e2e # Ejecuta tests end-to-end (~10 segundos)
|
|
1142
|
+
|
|
1143
|
+
# Cobertura
|
|
1144
|
+
pnpm test:cov # Genera reporte HTML en coverage/
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
### Base de Datos de Test
|
|
1148
|
+
|
|
1149
|
+
- **SQLite en archivo** `test.db`
|
|
1150
|
+
- **Limpieza automática** antes de cada test
|
|
1151
|
+
- **NODE_ENV=test** desactiva seed automático
|
|
1152
|
+
- **Aislamiento completo** entre tests
|
|
1153
|
+
|
|
1154
|
+
### Cómo Agregar Tests
|
|
1155
|
+
|
|
1156
|
+
**Test unitario básico:**
|
|
1157
|
+
|
|
1158
|
+
```typescript
|
|
1159
|
+
// test/unit/my-service.spec.ts
|
|
1160
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
1161
|
+
import { MyService } from '../../src/my-module/my.service';
|
|
1162
|
+
|
|
1163
|
+
describe('MyService', () => {
|
|
1164
|
+
let service: MyService;
|
|
1165
|
+
|
|
1166
|
+
beforeEach(async () => {
|
|
1167
|
+
const module: TestingModule = await Test.createTestingModule({
|
|
1168
|
+
providers: [MyService],
|
|
1169
|
+
}).compile();
|
|
1170
|
+
|
|
1171
|
+
service = module.get<MyService>(MyService);
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
it('should be defined', () => {
|
|
1175
|
+
expect(service).toBeDefined();
|
|
1176
|
+
});
|
|
1177
|
+
|
|
1178
|
+
it('should do something', () => {
|
|
1179
|
+
const result = service.doSomething();
|
|
1180
|
+
expect(result).toBe(expectedValue);
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
**Test E2E básico:**
|
|
1186
|
+
|
|
1187
|
+
```typescript
|
|
1188
|
+
// test/e2e/my-endpoint.e2e-spec.ts
|
|
1189
|
+
import * as request from 'supertest';
|
|
1190
|
+
import { INestApplication } from '@nestjs/common';
|
|
1191
|
+
import { Test } from '@nestjs/testing';
|
|
1192
|
+
import { AppModule } from '../../src/app.module';
|
|
1193
|
+
|
|
1194
|
+
describe('My Endpoint (e2e)', () => {
|
|
1195
|
+
let app: INestApplication;
|
|
1196
|
+
|
|
1197
|
+
beforeAll(async () => {
|
|
1198
|
+
const moduleFixture = await Test.createTestingModule({
|
|
1199
|
+
imports: [AppModule],
|
|
1200
|
+
}).compile();
|
|
1201
|
+
|
|
1202
|
+
app = moduleFixture.createNestApplication();
|
|
1203
|
+
await app.init();
|
|
1204
|
+
});
|
|
1205
|
+
|
|
1206
|
+
afterAll(async () => {
|
|
1207
|
+
await app.close();
|
|
1208
|
+
});
|
|
1209
|
+
|
|
1210
|
+
it('/my-endpoint (GET)', () => {
|
|
1211
|
+
return request(app.getHttpServer())
|
|
1212
|
+
.get('/my-endpoint')
|
|
1213
|
+
.expect(200)
|
|
1214
|
+
.expect({ status: 'ok' });
|
|
1215
|
+
});
|
|
1216
|
+
});
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
---
|
|
1220
|
+
|
|
1221
|
+
## Roadmap Técnico
|
|
1222
|
+
|
|
1223
|
+
### Seguridad
|
|
1224
|
+
|
|
1225
|
+
- [ ] **Refresh tokens** con rotación automática
|
|
1226
|
+
- [ ] **Token blacklist** usando Redis
|
|
1227
|
+
- [ ] **Two-factor authentication (2FA)** con TOTP
|
|
1228
|
+
- [ ] **API key authentication** para servicios machine-to-machine
|
|
1229
|
+
- [ ] **Helmet.js** para security headers HTTP
|
|
1230
|
+
- [ ] **Rate limiting por usuario/IP** (no solo global)
|
|
1231
|
+
- [ ] **CSRF protection** para endpoints críticos
|
|
1232
|
+
|
|
1233
|
+
### Performance
|
|
1234
|
+
|
|
1235
|
+
- [ ] **Redis para caching** de queries frecuentes
|
|
1236
|
+
- [ ] **Query optimization** con análisis de explain plans
|
|
1237
|
+
- [ ] **Lazy loading** de relaciones en Prisma
|
|
1238
|
+
- [ ] **Compression middleware** para responses
|
|
1239
|
+
- [ ] **CDN** para assets estáticos
|
|
1240
|
+
- [ ] **Database connection pooling** optimizado
|
|
1241
|
+
|
|
1242
|
+
### Observabilidad
|
|
1243
|
+
|
|
1244
|
+
- [ ] **Winston/Pino** para structured logging
|
|
1245
|
+
- [ ] **Sentry** para error tracking y alertas
|
|
1246
|
+
- [ ] **Prometheus metrics** para monitoring
|
|
1247
|
+
- [ ] **OpenTelemetry** para distributed tracing
|
|
1248
|
+
- [ ] **Health checks avanzados** (DB health, Redis health, external services)
|
|
1249
|
+
- [ ] **APM** (Application Performance Monitoring)
|
|
1250
|
+
|
|
1251
|
+
### Features
|
|
1252
|
+
|
|
1253
|
+
- [ ] **File uploads** con S3/Cloudinary
|
|
1254
|
+
- [ ] **Email notifications** con SendGrid/AWS SES
|
|
1255
|
+
- [ ] **Webhooks** para eventos importantes
|
|
1256
|
+
- [ ] **GraphQL API** complementaria
|
|
1257
|
+
- [ ] **WebSockets** para features real-time
|
|
1258
|
+
- [ ] **Background jobs** con Bull/BullMQ
|
|
1259
|
+
- [ ] **Search** con Elasticsearch
|
|
1260
|
+
- [ ] **Multi-tenancy** para SaaS
|
|
1261
|
+
|
|
1262
|
+
### DevOps
|
|
1263
|
+
|
|
1264
|
+
- [ ] **Docker** con multi-stage builds
|
|
1265
|
+
- [ ] **Docker Compose** para desarrollo local
|
|
1266
|
+
- [ ] **CI/CD pipeline** (GitHub Actions, GitLab CI)
|
|
1267
|
+
- [ ] **Kubernetes** deployment con Helm charts
|
|
1268
|
+
- [ ] **Terraform** para Infrastructure as Code
|
|
1269
|
+
- [ ] **Automated backups** de base de datos
|
|
1270
|
+
- [ ] **Blue-green deployments**
|
|
1271
|
+
- [ ] **Feature flags** para releases graduales
|
|
1272
|
+
|
|
1273
|
+
### Database
|
|
1274
|
+
|
|
1275
|
+
- [ ] **Migración a PostgreSQL/MySQL** en producción
|
|
1276
|
+
- [ ] **Read replicas** para escalabilidad de lectura
|
|
1277
|
+
- [ ] **Connection pooling** con PgBouncer
|
|
1278
|
+
- [ ] **Database backups** automatizados con retención
|
|
1279
|
+
- [ ] **Soft deletes** para recuperación de datos
|
|
1280
|
+
- [ ] **Database migrations** en CI/CD
|
|
1281
|
+
- [ ] **Data seeding** automatizado por environment
|
|
1282
|
+
|
|
1283
|
+
### Testing
|
|
1284
|
+
|
|
1285
|
+
- [ ] **Aumentar coverage a 100%**
|
|
1286
|
+
- [ ] **Contract testing** con Pact
|
|
1287
|
+
- [ ] **Load testing** con k6/Artillery
|
|
1288
|
+
- [ ] **Security testing** con OWASP ZAP
|
|
1289
|
+
- [ ] **Mutation testing** con Stryker
|
|
1290
|
+
- [ ] **Visual regression testing** para documentación
|
|
1291
|
+
- [ ] **Chaos engineering** para resiliencia
|
|
1292
|
+
|
|
1293
|
+
---
|
|
1294
|
+
|
|
1295
|
+
## Uso como Template
|
|
1296
|
+
|
|
1297
|
+
### Cómo Usar Este Proyecto como Base
|
|
1298
|
+
|
|
1299
|
+
#### 1. Duplicar el Proyecto
|
|
1300
|
+
|
|
1301
|
+
**Opción A: Fork en GitHub**
|
|
1302
|
+
```bash
|
|
1303
|
+
# 1. Fork el repositorio en GitHub
|
|
1304
|
+
# 2. Clonar tu fork
|
|
1305
|
+
git clone https://github.com/tu-usuario/tu-fork.git
|
|
1306
|
+
cd tu-fork
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
**Opción B: Download y nuevo repositorio**
|
|
1310
|
+
```bash
|
|
1311
|
+
# 1. Download como ZIP desde GitHub
|
|
1312
|
+
# 2. Descomprimir en directorio nuevo
|
|
1313
|
+
# 3. Inicializar nuevo repositorio Git
|
|
1314
|
+
cd mi-proyecto-api
|
|
1315
|
+
git init
|
|
1316
|
+
git add .
|
|
1317
|
+
git commit -m "Initial commit from template"
|
|
1318
|
+
```
|
|
1319
|
+
|
|
1320
|
+
#### 2. Personalización Inicial
|
|
1321
|
+
|
|
1322
|
+
**Actualizar información del proyecto:**
|
|
1323
|
+
|
|
1324
|
+
```bash
|
|
1325
|
+
# package.json
|
|
1326
|
+
{
|
|
1327
|
+
"name": "mi-proyecto-api",
|
|
1328
|
+
"description": "Descripción de mi API corporativa",
|
|
1329
|
+
"version": "1.0.0"
|
|
1330
|
+
}
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
**Actualizar Swagger (src/main.ts):**
|
|
1334
|
+
|
|
1335
|
+
```typescript
|
|
1336
|
+
const config = new DocumentBuilder()
|
|
1337
|
+
.setTitle('Mi API')
|
|
1338
|
+
.setDescription('Documentación de Mi API Corporativa')
|
|
1339
|
+
.setVersion('1.0.0')
|
|
1340
|
+
// ... resto de configuración
|
|
1341
|
+
.build();
|
|
1342
|
+
```
|
|
1343
|
+
|
|
1344
|
+
**Configurar variables de entorno:**
|
|
1345
|
+
|
|
1346
|
+
```bash
|
|
1347
|
+
cp .env.example .env
|
|
1348
|
+
# Editar .env con valores reales:
|
|
1349
|
+
# - JWT_SECRET (generar con: openssl rand -base64 32)
|
|
1350
|
+
# - DATABASE_URL
|
|
1351
|
+
# - ALLOWED_ORIGINS
|
|
1352
|
+
```
|
|
1353
|
+
|
|
1354
|
+
#### 3. Instalar y Verificar
|
|
1355
|
+
|
|
1356
|
+
```bash
|
|
1357
|
+
pnpm install
|
|
1358
|
+
pnpm prisma:generate
|
|
1359
|
+
pnpm prisma:migrate
|
|
1360
|
+
pnpm start:dev
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
**Verificar que funciona:**
|
|
1364
|
+
- http://localhost:3000/health
|
|
1365
|
+
- http://localhost:3000/docs
|
|
1366
|
+
|
|
1367
|
+
#### 4. Extender con Nuevos Módulos
|
|
1368
|
+
|
|
1369
|
+
```bash
|
|
1370
|
+
# Generar nuevo módulo con NestJS CLI
|
|
1371
|
+
nest g module productos
|
|
1372
|
+
nest g service productos
|
|
1373
|
+
nest g controller productos
|
|
1374
|
+
|
|
1375
|
+
# Crear DTOs
|
|
1376
|
+
mkdir src/productos/dto
|
|
1377
|
+
touch src/productos/dto/create-producto.dto.ts
|
|
1378
|
+
touch src/productos/dto/update-producto.dto.ts
|
|
1379
|
+
touch src/productos/dto/producto-response.dto.ts
|
|
1380
|
+
|
|
1381
|
+
# Actualizar schema.prisma
|
|
1382
|
+
# Agregar modelo Producto
|
|
1383
|
+
|
|
1384
|
+
# Aplicar migración
|
|
1385
|
+
pnpm prisma:migrate
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
### Checklist de Personalización
|
|
1389
|
+
|
|
1390
|
+
**Prioridad Alta:**
|
|
1391
|
+
|
|
1392
|
+
- [ ] Cambiar `package.json` (name, description, author)
|
|
1393
|
+
- [ ] Actualizar `.env` (JWT_SECRET, DATABASE_URL)
|
|
1394
|
+
- [ ] Modificar `src/main.ts` (Swagger title, description)
|
|
1395
|
+
- [ ] Actualizar `README.md` con información de tu proyecto
|
|
1396
|
+
- [ ] Cambiar usuarios de seed en `prisma/seed.ts`
|
|
1397
|
+
- [ ] Modificar `prisma/schema.prisma` con tus modelos
|
|
1398
|
+
|
|
1399
|
+
**Prioridad Media:**
|
|
1400
|
+
|
|
1401
|
+
- [ ] Configurar `ALLOWED_ORIGINS` para tu frontend
|
|
1402
|
+
- [ ] Ajustar rate limits en `app.module.ts`
|
|
1403
|
+
- [ ] Personalizar exception filters si necesario
|
|
1404
|
+
- [ ] Configurar logging según tus necesidades
|
|
1405
|
+
- [ ] Actualizar tests con tus casos de uso
|
|
1406
|
+
|
|
1407
|
+
**Prioridad Baja:**
|
|
1408
|
+
|
|
1409
|
+
- [ ] Cambiar puerto por defecto si es necesario
|
|
1410
|
+
- [ ] Ajustar configuración de CORS
|
|
1411
|
+
- [ ] Modificar duración de JWT (default 24h)
|
|
1412
|
+
- [ ] Personalizar mensajes de error
|
|
1413
|
+
|
|
1414
|
+
### Qué NO Romper
|
|
1415
|
+
|
|
1416
|
+
**Mantener estas características core:**
|
|
1417
|
+
|
|
1418
|
+
- ✅ **Estructura de carpetas** - Convenciones de NestJS
|
|
1419
|
+
- ✅ **Arquitectura modular** - Separation of concerns
|
|
1420
|
+
- ✅ **Guards y decorators** - Sistema de seguridad
|
|
1421
|
+
- ✅ **Exception filters** - Manejo de errores consistente
|
|
1422
|
+
- ✅ **Validación de DTOs** - Integridad de datos
|
|
1423
|
+
- ✅ **Prisma como ORM** - Type-safety en base de datos
|
|
1424
|
+
- ✅ **Testing setup** - Infraestructura de tests
|
|
1425
|
+
- ✅ **TypeScript strict mode** - Type safety
|
|
1426
|
+
- ✅ **Environment validation** - Validación en startup
|
|
1427
|
+
|
|
1428
|
+
### Características Core a Mantener
|
|
1429
|
+
|
|
1430
|
+
- **JWT authentication flow** - Sistema probado y seguro
|
|
1431
|
+
- **RBAC con guards** - Autorización flexible
|
|
1432
|
+
- **Swagger documentation** - Documentación viva
|
|
1433
|
+
- **Environment validation** - Catch errors temprano
|
|
1434
|
+
- **Exception handling** - Responses consistentes
|
|
1435
|
+
- **Rate limiting** - Protección contra abuso
|
|
1436
|
+
- **TypeScript strict mode** - Máxima seguridad de tipos
|
|
1437
|
+
- **Testing infrastructure** - Base para quality assurance
|
|
1438
|
+
|
|
1439
|
+
### Recomendaciones
|
|
1440
|
+
|
|
1441
|
+
1. **Mantener la estructura modular** - Agregar nuevos módulos siguiendo el patrón existente
|
|
1442
|
+
2. **Documentar en Swagger** - Todos los endpoints nuevos deben tener decorators @Api*
|
|
1443
|
+
3. **Escribir tests** - Mantener cobertura alta para nuevas features
|
|
1444
|
+
4. **Seguir naming conventions** - kebab-case para archivos, PascalCase para clases
|
|
1445
|
+
5. **Usar DTOs** - Para todas las request/response, con validación
|
|
1446
|
+
6. **Validar environment variables** - Agregar nuevas variables a `env.validation.ts`
|
|
1447
|
+
7. **No exponer datos sensibles** - Nunca retornar passwords, secrets, o tokens en responses
|
|
1448
|
+
8. **Aprovechar Prisma** - Type-safety end-to-end desde DB hasta API
|
|
1449
|
+
|
|
1450
|
+
---
|
|
1451
|
+
|
|
1452
|
+
## Licencia
|
|
1453
|
+
|
|
1454
|
+
UNLICENSED - Template de uso interno corporativo.
|
|
1455
|
+
|
|
1456
|
+
---
|
|
1457
|
+
|
|
1458
|
+
## Soporte
|
|
1459
|
+
|
|
1460
|
+
Para preguntas, problemas o sugerencias, contactar al equipo de desarrollo.
|
|
1461
|
+
|
|
1462
|
+
---
|
|
1463
|
+
|
|
1464
|
+
**Desarrollado con las mejores prácticas de la industria para equipos empresariales.**
|