kybernus 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +321 -0
- package/dist/cli/commands/init.d.ts +12 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +71 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +6 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +42 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +22 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/register.d.ts +2 -0
- package/dist/cli/commands/register.d.ts.map +1 -0
- package/dist/cli/commands/register.js +69 -0
- package/dist/cli/commands/register.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +46 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/upgrade.d.ts +2 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +62 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/prompts/wizard.d.ts +3 -0
- package/dist/cli/prompts/wizard.d.ts.map +1 -0
- package/dist/cli/prompts/wizard.js +121 -0
- package/dist/cli/prompts/wizard.js.map +1 -0
- package/dist/cli/services/AnalyticsClient.d.ts +11 -0
- package/dist/cli/services/AnalyticsClient.d.ts.map +1 -0
- package/dist/cli/services/AnalyticsClient.js +32 -0
- package/dist/cli/services/AnalyticsClient.js.map +1 -0
- package/dist/core/ai/documentation-generator.d.ts +36 -0
- package/dist/core/ai/documentation-generator.d.ts.map +1 -0
- package/dist/core/ai/documentation-generator.js +111 -0
- package/dist/core/ai/documentation-generator.js.map +1 -0
- package/dist/core/ai/gemini-service.d.ts +17 -0
- package/dist/core/ai/gemini-service.d.ts.map +1 -0
- package/dist/core/ai/gemini-service.js +68 -0
- package/dist/core/ai/gemini-service.js.map +1 -0
- package/dist/core/ai/prompts/documentation-prompts.d.ts +17 -0
- package/dist/core/ai/prompts/documentation-prompts.d.ts.map +1 -0
- package/dist/core/ai/prompts/documentation-prompts.js +195 -0
- package/dist/core/ai/prompts/documentation-prompts.js.map +1 -0
- package/dist/core/auth/license-validator.d.ts +33 -0
- package/dist/core/auth/license-validator.d.ts.map +1 -0
- package/dist/core/auth/license-validator.js +81 -0
- package/dist/core/auth/license-validator.js.map +1 -0
- package/dist/core/config/config-manager.d.ts +24 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +56 -0
- package/dist/core/config/config-manager.js.map +1 -0
- package/dist/core/generator/context-builder.d.ts +10 -0
- package/dist/core/generator/context-builder.d.ts.map +1 -0
- package/dist/core/generator/context-builder.js +43 -0
- package/dist/core/generator/context-builder.js.map +1 -0
- package/dist/core/generator/project.d.ts +42 -0
- package/dist/core/generator/project.d.ts.map +1 -0
- package/dist/core/generator/project.js +278 -0
- package/dist/core/generator/project.js.map +1 -0
- package/dist/core/templates/engine.d.ts +25 -0
- package/dist/core/templates/engine.d.ts.map +1 -0
- package/dist/core/templates/engine.js +78 -0
- package/dist/core/templates/engine.js.map +1 -0
- package/dist/core/templates/helpers.d.ts +6 -0
- package/dist/core/templates/helpers.d.ts.map +1 -0
- package/dist/core/templates/helpers.js +63 -0
- package/dist/core/templates/helpers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/models/config.d.ts +38 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/config.js +2 -0
- package/dist/models/config.js.map +1 -0
- package/package.json +66 -0
- package/templates/java-spring/free/mvc/.gitignore.hbs +39 -0
- package/templates/java-spring/free/mvc/README.md.hbs +116 -0
- package/templates/java-spring/free/mvc/docker-compose.yml.hbs +18 -0
- package/templates/java-spring/free/mvc/pom.xml.hbs +92 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/config/GlobalExceptionHandler.java.hbs +39 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/config/WebConfig.java.hbs +30 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/controller/HealthController.java.hbs +30 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/model/.gitkeep +0 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/repository/.gitkeep +0 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/service/.gitkeep +0 -0
- package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +13 -0
- package/templates/java-spring/free/mvc/src/main/resources/application.yml.hbs +32 -0
- package/templates/java-spring/free/mvc/src/test/java/{{packagePath}}/{{projectNamePascalCase}}ApplicationTests.java.hbs +13 -0
- package/templates/java-spring/free/mvc/src/test/resources/application.yml.hbs +10 -0
- package/templates/java-spring/free/mvc/template.json +14 -0
- package/templates/java-spring/pro/clean/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/java-spring/pro/clean/Dockerfile.hbs +45 -0
- package/templates/java-spring/pro/clean/README.md.hbs +31 -0
- package/templates/java-spring/pro/clean/docker-compose.yml.hbs +18 -0
- package/templates/java-spring/pro/clean/infra/main.tf.hbs +83 -0
- package/templates/java-spring/pro/clean/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/java-spring/pro/clean/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/java-spring/pro/clean/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/java-spring/pro/clean/pom.xml.hbs +130 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/application/service/AuthService.java.hbs +36 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/entity/User.java.hbs +77 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/repository/UserRepository.java.hbs +15 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/usecase/LoginUserUseCase.java.hbs +36 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/usecase/RegisterUserUseCase.java.hbs +46 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/persistence/InMemoryUserRepository.java.hbs +41 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/security/SecurityAdapters.java.hbs +53 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/web/controller/AuthController.java.hbs +41 -0
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +14 -0
- package/templates/java-spring/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/java-spring/pro/hexagonal/Dockerfile.hbs +45 -0
- package/templates/java-spring/pro/hexagonal/README.md.hbs +38 -0
- package/templates/java-spring/pro/hexagonal/docker-compose.yml.hbs +18 -0
- package/templates/java-spring/pro/hexagonal/infra/main.tf.hbs +83 -0
- package/templates/java-spring/pro/hexagonal/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/java-spring/pro/hexagonal/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/java-spring/pro/hexagonal/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/java-spring/pro/hexagonal/pom.xml.hbs +130 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/application/service/AuthService.java.hbs +36 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/entity/User.java.hbs +77 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/repository/UserRepository.java.hbs +15 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/usecase/LoginUserUseCase.java.hbs +36 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/usecase/RegisterUserUseCase.java.hbs +46 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/persistence/InMemoryUserRepository.java.hbs +41 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/security/SecurityAdapters.java.hbs +53 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/web/controller/AuthController.java.hbs +41 -0
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +14 -0
- package/templates/java-spring/pro/mvc/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/java-spring/pro/mvc/Dockerfile.hbs +45 -0
- package/templates/java-spring/pro/mvc/README.md.hbs +116 -0
- package/templates/java-spring/pro/mvc/docker-compose.yml.hbs +18 -0
- package/templates/java-spring/pro/mvc/infra/main.tf.hbs +83 -0
- package/templates/java-spring/pro/mvc/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/java-spring/pro/mvc/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/java-spring/pro/mvc/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/java-spring/pro/mvc/pom.xml.hbs +130 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/GlobalExceptionHandler.java.hbs +39 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/SecurityConfig.java.hbs +44 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/WebConfig.java.hbs +30 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/AuthController.java.hbs +69 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/HealthController.java.hbs +30 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/PaymentsController.java.hbs +49 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/dto/AuthRequest.java.hbs +3 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/dto/AuthResponse.java.hbs +3 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/model/.gitkeep +0 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/repository/.gitkeep +0 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/security/JwtAuthenticationFilter.java.hbs +56 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/security/JwtTokenProvider.java.hbs +59 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/service/.gitkeep +0 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/service/StripeService.java.hbs +67 -0
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +13 -0
- package/templates/java-spring/pro/mvc/src/main/resources/application.yml.hbs +32 -0
- package/templates/java-spring/pro/mvc/src/test/java/{{packagePath}}/{{projectNamePascalCase}}ApplicationTests.java.hbs +13 -0
- package/templates/java-spring/pro/mvc/src/test/resources/application.yml.hbs +10 -0
- package/templates/java-spring/pro/mvc/template.json +14 -0
- package/templates/nestjs/free/mvc/README.md.hbs +28 -0
- package/templates/nestjs/free/mvc/package.json.hbs +29 -0
- package/templates/nestjs/free/mvc/src/app.module.ts.hbs +13 -0
- package/templates/nestjs/free/mvc/src/controllers/health.controller.ts.hbs +9 -0
- package/templates/nestjs/free/mvc/src/controllers/items.controller.ts.hbs +32 -0
- package/templates/nestjs/free/mvc/src/main.ts.hbs +17 -0
- package/templates/nestjs/free/mvc/src/models/create-item.dto.ts.hbs +10 -0
- package/templates/nestjs/free/mvc/src/models/item.model.ts.hbs +6 -0
- package/templates/nestjs/free/mvc/src/modules/items.module.ts.hbs +9 -0
- package/templates/nestjs/free/mvc/src/services/items.service.ts.hbs +32 -0
- package/templates/nestjs/free/mvc/tsconfig.json.hbs +21 -0
- package/templates/nestjs/pro/clean/.env.example.hbs +19 -0
- package/templates/nestjs/pro/clean/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nestjs/pro/clean/Dockerfile.hbs +45 -0
- package/templates/nestjs/pro/clean/infra/main.tf.hbs +83 -0
- package/templates/nestjs/pro/clean/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nestjs/pro/clean/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nestjs/pro/clean/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nestjs/pro/clean/package.json.hbs +37 -0
- package/templates/nestjs/pro/clean/src/auth.module.ts.hbs +17 -0
- package/templates/nestjs/pro/clean/src/domain/entities/user.entity.ts.hbs +12 -0
- package/templates/nestjs/pro/clean/src/domain/repositories/user.repository.ts.hbs +6 -0
- package/templates/nestjs/pro/clean/src/domain/use-cases/register.use-case.ts.hbs +18 -0
- package/templates/nestjs/pro/clean/src/infrastructure/database/in-memory.repository.ts.hbs +17 -0
- package/templates/nestjs/pro/clean/src/infrastructure/http/auth.controller.ts.hbs +16 -0
- package/templates/nestjs/pro/clean/tsconfig.json.hbs +21 -0
- package/templates/nestjs/pro/hexagonal/.env.example.hbs +19 -0
- package/templates/nestjs/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nestjs/pro/hexagonal/Dockerfile.hbs +45 -0
- package/templates/nestjs/pro/hexagonal/infra/main.tf.hbs +83 -0
- package/templates/nestjs/pro/hexagonal/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nestjs/pro/hexagonal/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nestjs/pro/hexagonal/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nestjs/pro/hexagonal/package.json.hbs +37 -0
- package/templates/nestjs/pro/hexagonal/src/adapters/inbound/http.adapter.ts.hbs +12 -0
- package/templates/nestjs/pro/hexagonal/src/adapters/outbound/persistence.adapter.ts.hbs +13 -0
- package/templates/nestjs/pro/hexagonal/src/auth.module.ts.hbs +19 -0
- package/templates/nestjs/pro/hexagonal/src/core/auth.service.ts.hbs +16 -0
- package/templates/nestjs/pro/hexagonal/src/core/domain/user.entity.ts.hbs +8 -0
- package/templates/nestjs/pro/hexagonal/src/core/ports/ports.ts.hbs +9 -0
- package/templates/nestjs/pro/hexagonal/tsconfig.json.hbs +21 -0
- package/templates/nestjs/pro/mvc/.env.example.hbs +19 -0
- package/templates/nestjs/pro/mvc/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nestjs/pro/mvc/Dockerfile.hbs +45 -0
- package/templates/nestjs/pro/mvc/README.md.hbs +28 -0
- package/templates/nestjs/pro/mvc/infra/main.tf.hbs +83 -0
- package/templates/nestjs/pro/mvc/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nestjs/pro/mvc/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nestjs/pro/mvc/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nestjs/pro/mvc/package.json.hbs +37 -0
- package/templates/nestjs/pro/mvc/src/app.module.ts.hbs +17 -0
- package/templates/nestjs/pro/mvc/src/auth/auth.controller.ts.hbs +35 -0
- package/templates/nestjs/pro/mvc/src/auth/auth.module.ts.hbs +25 -0
- package/templates/nestjs/pro/mvc/src/auth/auth.service.ts.hbs +55 -0
- package/templates/nestjs/pro/mvc/src/auth/jwt.strategy.ts.hbs +19 -0
- package/templates/nestjs/pro/mvc/src/controllers/health.controller.ts.hbs +9 -0
- package/templates/nestjs/pro/mvc/src/controllers/items.controller.ts.hbs +32 -0
- package/templates/nestjs/pro/mvc/src/main.ts.hbs +17 -0
- package/templates/nestjs/pro/mvc/src/models/create-item.dto.ts.hbs +10 -0
- package/templates/nestjs/pro/mvc/src/models/item.model.ts.hbs +6 -0
- package/templates/nestjs/pro/mvc/src/modules/items.module.ts.hbs +9 -0
- package/templates/nestjs/pro/mvc/src/payments/payments.controller.ts.hbs +26 -0
- package/templates/nestjs/pro/mvc/src/payments/payments.module.ts.hbs +11 -0
- package/templates/nestjs/pro/mvc/src/payments/payments.service.ts.hbs +43 -0
- package/templates/nestjs/pro/mvc/src/services/items.service.ts.hbs +32 -0
- package/templates/nestjs/pro/mvc/tsconfig.json.hbs +21 -0
- package/templates/nextjs/free/default/.env.example.hbs +1 -0
- package/templates/nextjs/free/default/.gitignore.hbs +8 -0
- package/templates/nextjs/free/default/README.md.hbs +96 -0
- package/templates/nextjs/free/default/docker-compose.yml.hbs +18 -0
- package/templates/nextjs/free/default/next.config.js.hbs +4 -0
- package/templates/nextjs/free/default/package.json.hbs +32 -0
- package/templates/nextjs/free/default/postcss.config.js.hbs +6 -0
- package/templates/nextjs/free/default/prisma/schema.prisma.hbs +18 -0
- package/templates/nextjs/free/default/public/.gitkeep +0 -0
- package/templates/nextjs/free/default/src/app/api/health/route.ts.hbs +9 -0
- package/templates/nextjs/free/default/src/app/globals.css.hbs +3 -0
- package/templates/nextjs/free/default/src/app/layout.tsx.hbs +22 -0
- package/templates/nextjs/free/default/src/app/page.tsx.hbs +38 -0
- package/templates/nextjs/free/default/src/components/.gitkeep +0 -0
- package/templates/nextjs/free/default/src/lib/prisma.ts.hbs +13 -0
- package/templates/nextjs/free/default/src/proxy.ts.hbs +22 -0
- package/templates/nextjs/free/default/tailwind.config.ts.hbs +15 -0
- package/templates/nextjs/free/default/template.json +18 -0
- package/templates/nextjs/free/default/tsconfig.json.hbs +23 -0
- package/templates/nextjs/pro/default/.env.example.hbs +20 -0
- package/templates/nextjs/pro/default/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nextjs/pro/default/Dockerfile.hbs +45 -0
- package/templates/nextjs/pro/default/README.md.hbs +96 -0
- package/templates/nextjs/pro/default/docker-compose.yml.hbs +18 -0
- package/templates/nextjs/pro/default/infra/main.tf.hbs +83 -0
- package/templates/nextjs/pro/default/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nextjs/pro/default/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nextjs/pro/default/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nextjs/pro/default/next.config.js.hbs +4 -0
- package/templates/nextjs/pro/default/package.json.hbs +34 -0
- package/templates/nextjs/pro/default/postcss.config.js.hbs +6 -0
- package/templates/nextjs/pro/default/prisma/schema.prisma.hbs +18 -0
- package/templates/nextjs/pro/default/public/.gitkeep +0 -0
- package/templates/nextjs/pro/default/src/app/api/auth/[...nextauth]/route.ts.hbs +61 -0
- package/templates/nextjs/pro/default/src/app/api/checkout/route.ts.hbs +30 -0
- package/templates/nextjs/pro/default/src/app/api/health/route.ts.hbs +9 -0
- package/templates/nextjs/pro/default/src/app/api/webhook/route.ts.hbs +51 -0
- package/templates/nextjs/pro/default/src/app/dashboard/page.tsx.hbs +52 -0
- package/templates/nextjs/pro/default/src/app/globals.css.hbs +3 -0
- package/templates/nextjs/pro/default/src/app/layout.tsx.hbs +22 -0
- package/templates/nextjs/pro/default/src/app/page.tsx.hbs +38 -0
- package/templates/nextjs/pro/default/src/components/.gitkeep +0 -0
- package/templates/nextjs/pro/default/src/components/AuthButton.tsx.hbs +34 -0
- package/templates/nextjs/pro/default/src/components/Providers.tsx.hbs +7 -0
- package/templates/nextjs/pro/default/src/lib/prisma.ts.hbs +13 -0
- package/templates/nextjs/pro/default/src/proxy.ts.hbs +22 -0
- package/templates/nextjs/pro/default/tailwind.config.ts.hbs +15 -0
- package/templates/nextjs/pro/default/template.json +18 -0
- package/templates/nextjs/pro/default/tsconfig.json.hbs +40 -0
- package/templates/nodejs-express/free/mvc/.env.example.hbs +3 -0
- package/templates/nodejs-express/free/mvc/.gitignore.hbs +6 -0
- package/templates/nodejs-express/free/mvc/README.md.hbs +128 -0
- package/templates/nodejs-express/free/mvc/docker-compose.yml.hbs +18 -0
- package/templates/nodejs-express/free/mvc/package.json.hbs +39 -0
- package/templates/nodejs-express/free/mvc/src/app.ts.hbs +29 -0
- package/templates/nodejs-express/free/mvc/src/config/database.ts.hbs +10 -0
- package/templates/nodejs-express/free/mvc/src/controllers/healthController.ts.hbs +20 -0
- package/templates/nodejs-express/free/mvc/src/index.ts.hbs +12 -0
- package/templates/nodejs-express/free/mvc/src/middleware/errorHandler.ts.hbs +22 -0
- package/templates/nodejs-express/free/mvc/src/models/.gitkeep +0 -0
- package/templates/nodejs-express/free/mvc/src/routes/index.ts.hbs +14 -0
- package/templates/nodejs-express/free/mvc/src/services/.gitkeep +0 -0
- package/templates/nodejs-express/free/mvc/template.json +18 -0
- package/templates/nodejs-express/free/mvc/tsconfig.json.hbs +18 -0
- package/templates/nodejs-express/pro/clean/.env.example.hbs +19 -0
- package/templates/nodejs-express/pro/clean/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nodejs-express/pro/clean/Dockerfile.hbs +45 -0
- package/templates/nodejs-express/pro/clean/README.md.hbs +41 -0
- package/templates/nodejs-express/pro/clean/docker-compose.yml.hbs +18 -0
- package/templates/nodejs-express/pro/clean/infra/main.tf.hbs +83 -0
- package/templates/nodejs-express/pro/clean/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nodejs-express/pro/clean/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nodejs-express/pro/clean/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nodejs-express/pro/clean/package.json.hbs +55 -0
- package/templates/nodejs-express/pro/clean/src/application/services/AuthService.ts.hbs +66 -0
- package/templates/nodejs-express/pro/clean/src/domain/entities/User.ts.hbs +38 -0
- package/templates/nodejs-express/pro/clean/src/domain/repositories/IUserRepository.ts.hbs +13 -0
- package/templates/nodejs-express/pro/clean/src/domain/usecases/LoginUserUseCase.ts.hbs +39 -0
- package/templates/nodejs-express/pro/clean/src/domain/usecases/RegisterUserUseCase.ts.hbs +51 -0
- package/templates/nodejs-express/pro/clean/src/index.ts.hbs +40 -0
- package/templates/nodejs-express/pro/clean/src/infrastructure/database/InMemoryUserRepository.ts.hbs +46 -0
- package/templates/nodejs-express/pro/clean/src/infrastructure/http/controllers/AuthController.ts.hbs +45 -0
- package/templates/nodejs-express/pro/clean/src/infrastructure/http/middlewares/AuthMiddleware.ts.hbs +27 -0
- package/templates/nodejs-express/pro/clean/src/infrastructure/providers/PasswordHasher.ts.hbs +14 -0
- package/templates/nodejs-express/pro/clean/src/infrastructure/providers/TokenGenerator.ts.hbs +25 -0
- package/templates/nodejs-express/pro/clean/tsconfig.json.hbs +27 -0
- package/templates/nodejs-express/pro/hexagonal/.env.example.hbs +19 -0
- package/templates/nodejs-express/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nodejs-express/pro/hexagonal/Dockerfile.hbs +45 -0
- package/templates/nodejs-express/pro/hexagonal/README.md.hbs +42 -0
- package/templates/nodejs-express/pro/hexagonal/docker-compose.yml.hbs +18 -0
- package/templates/nodejs-express/pro/hexagonal/infra/main.tf.hbs +83 -0
- package/templates/nodejs-express/pro/hexagonal/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nodejs-express/pro/hexagonal/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nodejs-express/pro/hexagonal/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nodejs-express/pro/hexagonal/package.json.hbs +55 -0
- package/templates/nodejs-express/pro/hexagonal/src/adapters/inbound/http/AuthController.ts.hbs +48 -0
- package/templates/nodejs-express/pro/hexagonal/src/adapters/outbound/SecurityAdapters.ts.hbs +31 -0
- package/templates/nodejs-express/pro/hexagonal/src/adapters/outbound/persistence/InMemoryUserAdapter.ts.hbs +38 -0
- package/templates/nodejs-express/pro/hexagonal/src/core/AuthService.ts.hbs +51 -0
- package/templates/nodejs-express/pro/hexagonal/src/core/domain/entities/User.ts.hbs +28 -0
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/inbound/IAuthPort.ts.hbs +11 -0
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/outbound/ISecurityPorts.ts.hbs +15 -0
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/outbound/IUserRepositoryPort.ts.hbs +13 -0
- package/templates/nodejs-express/pro/hexagonal/src/index.ts.hbs +41 -0
- package/templates/nodejs-express/pro/hexagonal/tsconfig.json.hbs +27 -0
- package/templates/nodejs-express/pro/mvc/.env.example.hbs +19 -0
- package/templates/nodejs-express/pro/mvc/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/nodejs-express/pro/mvc/Dockerfile.hbs +45 -0
- package/templates/nodejs-express/pro/mvc/README.md.hbs +85 -0
- package/templates/nodejs-express/pro/mvc/docker-compose.yml.hbs +18 -0
- package/templates/nodejs-express/pro/mvc/infra/main.tf.hbs +83 -0
- package/templates/nodejs-express/pro/mvc/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/nodejs-express/pro/mvc/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/nodejs-express/pro/mvc/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/nodejs-express/pro/mvc/package.json.hbs +55 -0
- package/templates/nodejs-express/pro/mvc/src/app.ts.hbs +34 -0
- package/templates/nodejs-express/pro/mvc/src/config/database.ts.hbs +10 -0
- package/templates/nodejs-express/pro/mvc/src/controllers/auth.controller.ts.hbs +91 -0
- package/templates/nodejs-express/pro/mvc/src/controllers/healthController.ts.hbs +20 -0
- package/templates/nodejs-express/pro/mvc/src/controllers/payments.controller.ts.hbs +72 -0
- package/templates/nodejs-express/pro/mvc/src/index.ts.hbs +12 -0
- package/templates/nodejs-express/pro/mvc/src/middleware/errorHandler.ts.hbs +22 -0
- package/templates/nodejs-express/pro/mvc/src/middlewares/auth.middleware.ts.hbs +31 -0
- package/templates/nodejs-express/pro/mvc/src/models/.gitkeep +0 -0
- package/templates/nodejs-express/pro/mvc/src/routes/index.ts.hbs +14 -0
- package/templates/nodejs-express/pro/mvc/src/services/.gitkeep +0 -0
- package/templates/nodejs-express/pro/mvc/src/services/stripe.service.ts.hbs +102 -0
- package/templates/nodejs-express/pro/mvc/template.json +18 -0
- package/templates/nodejs-express/pro/mvc/tsconfig.json.hbs +27 -0
- package/templates/python-fastapi/free/mvc/README.md.hbs +41 -0
- package/templates/python-fastapi/free/mvc/app/controllers/health.py.hbs +7 -0
- package/templates/python-fastapi/free/mvc/app/controllers/items.py.hbs +27 -0
- package/templates/python-fastapi/free/mvc/app/main.py.hbs +26 -0
- package/templates/python-fastapi/free/mvc/app/models/item.py.hbs +11 -0
- package/templates/python-fastapi/free/mvc/app/schemas/item.py.hbs +17 -0
- package/templates/python-fastapi/free/mvc/app/services/item_service.py.hbs +33 -0
- package/templates/python-fastapi/free/mvc/requirements.txt.hbs +4 -0
- package/templates/python-fastapi/pro/clean/.env.example.hbs +17 -0
- package/templates/python-fastapi/pro/clean/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/python-fastapi/pro/clean/Dockerfile.hbs +20 -0
- package/templates/python-fastapi/pro/clean/app/domain/entities/user.py.hbs +23 -0
- package/templates/python-fastapi/pro/clean/app/domain/repositories/user_repository.py.hbs +22 -0
- package/templates/python-fastapi/pro/clean/app/domain/usecases/register_user.py.hbs +30 -0
- package/templates/python-fastapi/pro/clean/app/infrastructure/database/in_memory_repository.py.hbs +26 -0
- package/templates/python-fastapi/pro/clean/app/infrastructure/http/auth_controller.py.hbs +26 -0
- package/templates/python-fastapi/pro/clean/app/infrastructure/security/adapters.py.hbs +23 -0
- package/templates/python-fastapi/pro/clean/app/main.py.hbs +10 -0
- package/templates/python-fastapi/pro/clean/infra/main.tf.hbs +83 -0
- package/templates/python-fastapi/pro/clean/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/python-fastapi/pro/clean/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/python-fastapi/pro/clean/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/python-fastapi/pro/clean/requirements.txt.hbs +12 -0
- package/templates/python-fastapi/pro/hexagonal/.env.example.hbs +17 -0
- package/templates/python-fastapi/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/python-fastapi/pro/hexagonal/Dockerfile.hbs +20 -0
- package/templates/python-fastapi/pro/hexagonal/app/adapters/inbound/http_adapter.py.hbs +29 -0
- package/templates/python-fastapi/pro/hexagonal/app/core/domain/user.py.hbs +15 -0
- package/templates/python-fastapi/pro/hexagonal/app/core/ports.py.hbs +25 -0
- package/templates/python-fastapi/pro/hexagonal/app/core/service.py.hbs +28 -0
- package/templates/python-fastapi/pro/hexagonal/app/main.py.hbs +22 -0
- package/templates/python-fastapi/pro/hexagonal/infra/main.tf.hbs +83 -0
- package/templates/python-fastapi/pro/hexagonal/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/python-fastapi/pro/hexagonal/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/python-fastapi/pro/hexagonal/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/python-fastapi/pro/hexagonal/requirements.txt.hbs +12 -0
- package/templates/python-fastapi/pro/mvc/.env.example.hbs +17 -0
- package/templates/python-fastapi/pro/mvc/.github/workflows/ci-cd.yml.hbs +88 -0
- package/templates/python-fastapi/pro/mvc/Dockerfile.hbs +20 -0
- package/templates/python-fastapi/pro/mvc/README.md.hbs +41 -0
- package/templates/python-fastapi/pro/mvc/app/controllers/auth.py.hbs +46 -0
- package/templates/python-fastapi/pro/mvc/app/controllers/health.py.hbs +7 -0
- package/templates/python-fastapi/pro/mvc/app/controllers/items.py.hbs +21 -0
- package/templates/python-fastapi/pro/mvc/app/controllers/payments.py.hbs +32 -0
- package/templates/python-fastapi/pro/mvc/app/main.py.hbs +20 -0
- package/templates/python-fastapi/pro/mvc/app/middleware/security.py.hbs +39 -0
- package/templates/python-fastapi/pro/mvc/app/models/item.py.hbs +11 -0
- package/templates/python-fastapi/pro/mvc/app/schemas/item.py.hbs +16 -0
- package/templates/python-fastapi/pro/mvc/app/services/item_service.py.hbs +24 -0
- package/templates/python-fastapi/pro/mvc/infra/main.tf.hbs +83 -0
- package/templates/python-fastapi/pro/mvc/infra/modules/ecs/main.tf.hbs +54 -0
- package/templates/python-fastapi/pro/mvc/infra/modules/rds/main.tf.hbs +88 -0
- package/templates/python-fastapi/pro/mvc/infra/modules/vpc/main.tf.hbs +107 -0
- package/templates/python-fastapi/pro/mvc/requirements.txt.hbs +12 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import NextAuth from "next-auth";
|
|
2
|
+
import CredentialsProvider from "next-auth/providers/credentials";
|
|
3
|
+
import GoogleProvider from "next-auth/providers/google";
|
|
4
|
+
|
|
5
|
+
export const authOptions = {
|
|
6
|
+
providers: [
|
|
7
|
+
GoogleProvider({
|
|
8
|
+
clientId: process.env.GOOGLE_CLIENT_ID || "",
|
|
9
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "",
|
|
10
|
+
}),
|
|
11
|
+
CredentialsProvider({
|
|
12
|
+
name: "credentials",
|
|
13
|
+
credentials: {
|
|
14
|
+
email: { label: "Email", type: "email" },
|
|
15
|
+
password: { label: "Password", type: "password" },
|
|
16
|
+
},
|
|
17
|
+
async authorize(credentials) {
|
|
18
|
+
// TODO: Implement your own authentication logic
|
|
19
|
+
// This is a placeholder - replace with your database lookup
|
|
20
|
+
if (
|
|
21
|
+
credentials?.email === "user@example.com" &&
|
|
22
|
+
credentials?.password === "password"
|
|
23
|
+
) {
|
|
24
|
+
return {
|
|
25
|
+
id: "1",
|
|
26
|
+
email: credentials.email,
|
|
27
|
+
name: "Demo User",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
pages: {
|
|
35
|
+
signIn: "/auth/signin",
|
|
36
|
+
signOut: "/auth/signout",
|
|
37
|
+
error: "/auth/error",
|
|
38
|
+
},
|
|
39
|
+
callbacks: {
|
|
40
|
+
async jwt({ token, user }: { token: any; user: any }) {
|
|
41
|
+
if (user) {
|
|
42
|
+
token.id = user.id;
|
|
43
|
+
}
|
|
44
|
+
return token;
|
|
45
|
+
},
|
|
46
|
+
async session({ session, token }: { session: any; token: any }) {
|
|
47
|
+
if (session.user) {
|
|
48
|
+
session.user.id = token.id;
|
|
49
|
+
}
|
|
50
|
+
return session;
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
session: {
|
|
54
|
+
strategy: "jwt" as const,
|
|
55
|
+
},
|
|
56
|
+
secret: process.env.NEXTAUTH_SECRET,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const handler = NextAuth(authOptions);
|
|
60
|
+
|
|
61
|
+
export { handler as GET, handler as POST };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
import Stripe from "stripe";
|
|
3
|
+
|
|
4
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
|
5
|
+
apiVersion: "2024-12-18.acacia",
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export async function POST(request: NextRequest) {
|
|
9
|
+
try {
|
|
10
|
+
const { priceId, customerId } = await request.json();
|
|
11
|
+
|
|
12
|
+
const session = await stripe.checkout.sessions.create({
|
|
13
|
+
mode: "subscription",
|
|
14
|
+
payment_method_types: ["card"],
|
|
15
|
+
line_items: [
|
|
16
|
+
{
|
|
17
|
+
price: priceId || process.env.STRIPE_PRICE_ID,
|
|
18
|
+
quantity: 1,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
customer: customerId || undefined,
|
|
22
|
+
success_url: `${process.env.NEXT_PUBLIC_APP_URL}/success?session_id={CHECKOUT_SESSION_ID}`,
|
|
23
|
+
cancel_url: `${process.env.NEXT_PUBLIC_APP_URL}/pricing`,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return NextResponse.json({ url: session.url });
|
|
27
|
+
} catch (error: any) {
|
|
28
|
+
return NextResponse.json({ error: error.message }, { status: 500 });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
import Stripe from "stripe";
|
|
3
|
+
|
|
4
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
|
5
|
+
apiVersion: "2024-12-18.acacia",
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET || "";
|
|
9
|
+
|
|
10
|
+
export async function POST(request: NextRequest) {
|
|
11
|
+
const body = await request.text();
|
|
12
|
+
const signature = request.headers.get("stripe-signature") || "";
|
|
13
|
+
|
|
14
|
+
let event: Stripe.Event;
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
event = stripe.webhooks.constructEvent(body, signature, webhookSecret);
|
|
18
|
+
} catch (err: any) {
|
|
19
|
+
console.error(`Webhook signature verification failed: ${err.message}`);
|
|
20
|
+
return NextResponse.json({ error: "Invalid signature" }, { status: 400 });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
switch (event.type) {
|
|
24
|
+
case "checkout.session.completed":
|
|
25
|
+
const session = event.data.object as Stripe.Checkout.Session;
|
|
26
|
+
// TODO: Fulfill the purchase
|
|
27
|
+
console.log("Checkout completed:", session.id);
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case "customer.subscription.created":
|
|
31
|
+
case "customer.subscription.updated":
|
|
32
|
+
const subscription = event.data.object as Stripe.Subscription;
|
|
33
|
+
// TODO: Update user subscription status in database
|
|
34
|
+
console.log("Subscription updated:", subscription.id);
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "customer.subscription.deleted":
|
|
38
|
+
const deletedSubscription = event.data.object as Stripe.Subscription;
|
|
39
|
+
// TODO: Handle subscription cancellation
|
|
40
|
+
console.log("Subscription deleted:", deletedSubscription.id);
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case "invoice.payment_failed":
|
|
44
|
+
const invoice = event.data.object as Stripe.Invoice;
|
|
45
|
+
// TODO: Handle failed payment
|
|
46
|
+
console.log("Payment failed:", invoice.id);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return NextResponse.json({ received: true });
|
|
51
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getServerSession } from "next-auth";
|
|
2
|
+
import { redirect } from "next/navigation";
|
|
3
|
+
import { authOptions } from "../api/auth/[...nextauth]/route";
|
|
4
|
+
|
|
5
|
+
export default async function DashboardPage() {
|
|
6
|
+
const session = await getServerSession(authOptions);
|
|
7
|
+
|
|
8
|
+
if (!session) {
|
|
9
|
+
redirect("/api/auth/signin");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className="min-h-screen bg-gray-50 py-12 px-4">
|
|
14
|
+
<div className="max-w-4xl mx-auto">
|
|
15
|
+
<h1 className="text-3xl font-bold text-gray-900 mb-8">Dashboard</h1>
|
|
16
|
+
|
|
17
|
+
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
18
|
+
<h2 className="text-xl font-semibold mb-4">Welcome, {session.user?.name || session.user?.email}!</h2>
|
|
19
|
+
<p className="text-gray-600">
|
|
20
|
+
This is a protected page. Only authenticated users can see this content.
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
25
|
+
<div className="bg-white rounded-lg shadow p-6">
|
|
26
|
+
<h3 className="text-lg font-medium mb-2">Subscription</h3>
|
|
27
|
+
<p className="text-gray-600 mb-4">Manage your subscription</p>
|
|
28
|
+
<a href="/api/portal" className="text-blue-600 hover:underline">
|
|
29
|
+
Manage Billing →
|
|
30
|
+
</a>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div className="bg-white rounded-lg shadow p-6">
|
|
34
|
+
<h3 className="text-lg font-medium mb-2">Profile</h3>
|
|
35
|
+
<p className="text-gray-600 mb-4">Update your profile settings</p>
|
|
36
|
+
<a href="/settings" className="text-blue-600 hover:underline">
|
|
37
|
+
Edit Profile →
|
|
38
|
+
</a>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div className="bg-white rounded-lg shadow p-6">
|
|
42
|
+
<h3 className="text-lg font-medium mb-2">API Keys</h3>
|
|
43
|
+
<p className="text-gray-600 mb-4">Manage your API keys</p>
|
|
44
|
+
<a href="/api-keys" className="text-blue-600 hover:underline">
|
|
45
|
+
View Keys →
|
|
46
|
+
</a>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Metadata } from 'next';
|
|
2
|
+
import { Inter } from 'next/font/google';
|
|
3
|
+
import './globals.css';
|
|
4
|
+
|
|
5
|
+
const inter = Inter({ subsets: ['latin'] });
|
|
6
|
+
|
|
7
|
+
export const metadata: Metadata = {
|
|
8
|
+
title: '{{pascalCase projectName}}',
|
|
9
|
+
description: 'Generated by Kibernus CLI',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function RootLayout({
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}) {
|
|
17
|
+
return (
|
|
18
|
+
<html lang="en">
|
|
19
|
+
<body className={inter.className}>{children}</body>
|
|
20
|
+
</html>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export default function Home() {
|
|
2
|
+
return (
|
|
3
|
+
<main className="flex min-h-screen flex-col items-center justify-center p-24 bg-gradient-to-b from-gray-900 to-gray-800">
|
|
4
|
+
<div className="text-center">
|
|
5
|
+
<h1 className="text-5xl font-bold mb-4 text-white">
|
|
6
|
+
🚀 {{pascalCase projectName}}
|
|
7
|
+
</h1>
|
|
8
|
+
<p className="text-gray-400 mb-8 text-lg">
|
|
9
|
+
Generated by{' '}
|
|
10
|
+
<a
|
|
11
|
+
href="https://kibernus.dev"
|
|
12
|
+
className="text-blue-400 hover:text-blue-300 underline"
|
|
13
|
+
target="_blank"
|
|
14
|
+
rel="noopener noreferrer"
|
|
15
|
+
>
|
|
16
|
+
Kybernus CLI
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
<div className="flex gap-4 justify-center">
|
|
20
|
+
<a
|
|
21
|
+
href="/api/health"
|
|
22
|
+
className="px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-500 transition font-medium"
|
|
23
|
+
>
|
|
24
|
+
Health Check
|
|
25
|
+
</a>
|
|
26
|
+
<a
|
|
27
|
+
href="https://kibernus.dev/docs"
|
|
28
|
+
className="px-6 py-3 bg-gray-700 text-white rounded-lg hover:bg-gray-600 transition font-medium"
|
|
29
|
+
target="_blank"
|
|
30
|
+
rel="noopener noreferrer"
|
|
31
|
+
>
|
|
32
|
+
Documentation
|
|
33
|
+
</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</main>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { signIn, signOut, useSession } from "next-auth/react";
|
|
4
|
+
|
|
5
|
+
export function AuthButton() {
|
|
6
|
+
const { data: session, status } = useSession();
|
|
7
|
+
|
|
8
|
+
if (status === "loading") {
|
|
9
|
+
return <div className="animate-pulse bg-gray-200 h-10 w-24 rounded-md"></div>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (session) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="flex items-center gap-4">
|
|
15
|
+
<span className="text-sm text-gray-600">
|
|
16
|
+
{session.user?.email}
|
|
17
|
+
</span>
|
|
18
|
+
<button onClick={()=> signOut()}
|
|
19
|
+
className="px-4 py-2 bg-gray-800 text-white rounded-md hover:bg-gray-700 transition"
|
|
20
|
+
>
|
|
21
|
+
Sign Out
|
|
22
|
+
</button>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<button onClick={()=> signIn()}
|
|
29
|
+
className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-500 transition"
|
|
30
|
+
>
|
|
31
|
+
Sign In
|
|
32
|
+
</button>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PrismaClient } from '@prisma/client';
|
|
2
|
+
|
|
3
|
+
const globalForPrisma = globalThis as unknown as {
|
|
4
|
+
prisma: PrismaClient | undefined;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const prisma =
|
|
8
|
+
globalForPrisma.prisma ??
|
|
9
|
+
new PrismaClient({
|
|
10
|
+
log: process.env.NODE_ENV === 'development' ? ['query'] : [],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import type { NextRequest } from 'next/server';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Next.js 16 Proxy (formerly middleware)
|
|
6
|
+
*
|
|
7
|
+
* This runs at the Edge, before requests reach your app.
|
|
8
|
+
* Use sparingly - prefer other Next.js APIs when possible.
|
|
9
|
+
*/
|
|
10
|
+
export function proxy(request: NextRequest) {
|
|
11
|
+
// Add your proxy logic here
|
|
12
|
+
// Example: Authentication, redirects, headers, etc.
|
|
13
|
+
return NextResponse.next();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Configure which paths the proxy runs on
|
|
17
|
+
export const config = {
|
|
18
|
+
matcher: [
|
|
19
|
+
// Skip static files and api routes you don't want to process
|
|
20
|
+
'/((?!_next/static|_next/image|favicon.ico).*)',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
content: [
|
|
5
|
+
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
|
6
|
+
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
7
|
+
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
8
|
+
],
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {},
|
|
11
|
+
},
|
|
12
|
+
plugins: [],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Next.js Fullstack",
|
|
3
|
+
"tier": "free",
|
|
4
|
+
"stack": "nextjs",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Next.js 16 with App Router, Prisma, and Tailwind CSS",
|
|
7
|
+
"targetVersions": {
|
|
8
|
+
"node": ">=18.0.0",
|
|
9
|
+
"nextjs": "^16.0.0",
|
|
10
|
+
"prisma": "^5.0.0"
|
|
11
|
+
},
|
|
12
|
+
"requiredConfig": [
|
|
13
|
+
"projectName"
|
|
14
|
+
],
|
|
15
|
+
"optionalConfig": [
|
|
16
|
+
"useAI"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"module": "esnext",
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"isolatedModules": true,
|
|
18
|
+
"jsx": "preserve",
|
|
19
|
+
"incremental": true,
|
|
20
|
+
"plugins": [
|
|
21
|
+
{
|
|
22
|
+
"name": "next"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": [
|
|
27
|
+
"./src/*"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"next-env.d.ts",
|
|
33
|
+
"**/*.ts",
|
|
34
|
+
"**/*.tsx",
|
|
35
|
+
".next/types/**/*.ts"
|
|
36
|
+
],
|
|
37
|
+
"exclude": [
|
|
38
|
+
"node_modules"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# {{pascalCase projectName}}
|
|
2
|
+
|
|
3
|
+
> Generated by [Kybernus CLI](https://kibernus.dev) 🚀
|
|
4
|
+
|
|
5
|
+
REST API built with **Express.js**, **TypeScript**, and **MVC architecture**.
|
|
6
|
+
|
|
7
|
+
## 📋 Prerequisites
|
|
8
|
+
|
|
9
|
+
- **Node.js** >= 18.0.0
|
|
10
|
+
- **npm** or **yarn**
|
|
11
|
+
- **Docker** (opcional, para banco de dados)
|
|
12
|
+
|
|
13
|
+
## 🚀 Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Install Dependencies
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Configure Environment
|
|
22
|
+
|
|
23
|
+
Copy `.env.example` to `.env`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cp .env.example .env
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Edit `.env` with your configuration.
|
|
30
|
+
|
|
31
|
+
### 3. Start Database (Optional)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
docker-compose up -d
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will start a PostgreSQL database on port `5432`.
|
|
38
|
+
|
|
39
|
+
### 4. Run Development Server
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Server will start on **http://localhost:3000**
|
|
46
|
+
|
|
47
|
+
## 📁 Project Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
src/
|
|
51
|
+
├── index.ts # Entry point
|
|
52
|
+
├── app.ts # Express app setup
|
|
53
|
+
├── controllers/ # Request handlers (MVC Controllers)
|
|
54
|
+
├── services/ # Business logic (MVC Services)
|
|
55
|
+
├── models/ # Data models (MVC Models)
|
|
56
|
+
├── routes/ # API route definitions
|
|
57
|
+
├── middleware/ # Custom middleware
|
|
58
|
+
└── config/ # Configuration files
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 🏗️ Architecture
|
|
62
|
+
|
|
63
|
+
This project follows the **MVC (Model-View-Controller)** architecture pattern:
|
|
64
|
+
|
|
65
|
+
- **Models**: Define data structures and database schemas
|
|
66
|
+
- **Controllers**: Handle HTTP requests and responses
|
|
67
|
+
- **Services**: Contain business logic and data processing
|
|
68
|
+
- **Routes**: Map endpoints to controllers
|
|
69
|
+
|
|
70
|
+
## 🧪 API Endpoints
|
|
71
|
+
|
|
72
|
+
### Health Check
|
|
73
|
+
```http
|
|
74
|
+
GET /api/health
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Returns server health status.
|
|
78
|
+
|
|
79
|
+
**Response:**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"status": "ok",
|
|
83
|
+
"timestamp": "2026-01-15T22:00:00.000Z",
|
|
84
|
+
"uptime": 123.45
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 🔧 Available Scripts
|
|
89
|
+
|
|
90
|
+
- `npm run dev` - Start development server with hot reload
|
|
91
|
+
- `npm run build` - Build for production
|
|
92
|
+
- `npm start` - Run production build
|
|
93
|
+
- `npm run lint` - Lint code
|
|
94
|
+
- `npm run format` - Format code with Prettier
|
|
95
|
+
|
|
96
|
+
## 🐳 Docker
|
|
97
|
+
|
|
98
|
+
Start the PostgreSQL database:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
docker-compose up -d
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Stop the database:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
docker-compose down
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 📝 Environment Variables
|
|
111
|
+
|
|
112
|
+
| Variable | Description | Default |
|
|
113
|
+
|----------|-------------|---------|
|
|
114
|
+
| `PORT` | Server port | `3000` |
|
|
115
|
+
| `NODE_ENV` | Environment | `development` |
|
|
116
|
+
| `DATABASE_URL` | PostgreSQL connection string | - |
|
|
117
|
+
|
|
118
|
+
## 🤝 Contributing
|
|
119
|
+
|
|
120
|
+
Contributions are welcome! Feel free to open issues or submit pull requests.
|
|
121
|
+
|
|
122
|
+
## 📄 License
|
|
123
|
+
|
|
124
|
+
MIT
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
**Built with ❤️ using Kybernus CLI** | {{currentYear}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
postgres:
|
|
5
|
+
image: postgres:15-alpine
|
|
6
|
+
container_name: {{kebabCase projectName}}-db
|
|
7
|
+
environment:
|
|
8
|
+
POSTGRES_USER: postgres
|
|
9
|
+
POSTGRES_PASSWORD: postgres
|
|
10
|
+
POSTGRES_DB: {{snakeCase projectName}}
|
|
11
|
+
ports:
|
|
12
|
+
- "5432:5432"
|
|
13
|
+
volumes:
|
|
14
|
+
- postgres_data:/var/lib/postgresql/data
|
|
15
|
+
restart: unless-stopped
|
|
16
|
+
|
|
17
|
+
volumes:
|
|
18
|
+
postgres_data:
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{kebabCase projectName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Generated by Kibernus CLI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "tsx watch src/index.ts",
|
|
8
|
+
"build": "rimraf dist && tsc",
|
|
9
|
+
"start": "node dist/index.js",
|
|
10
|
+
"lint": "eslint src --ext .ts",
|
|
11
|
+
"format": "prettier --write \"src/**/*.ts\""
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["express", "api", "typescript", "mvc"],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"express": "^4.18.2",
|
|
18
|
+
"dotenv": "^16.4.5",
|
|
19
|
+
"cors": "^2.8.5",
|
|
20
|
+
"helmet": "^7.1.0",
|
|
21
|
+
"morgan": "^1.10.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/express": "^4.17.21",
|
|
25
|
+
"@types/node": "^20.11.19",
|
|
26
|
+
"@types/cors": "^2.8.17",
|
|
27
|
+
"@types/morgan": "^1.9.9",
|
|
28
|
+
"typescript": "^5.3.3",
|
|
29
|
+
"tsx": "^4.7.1",
|
|
30
|
+
"rimraf": "^5.0.5",
|
|
31
|
+
"eslint": "^8.56.0",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
33
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
34
|
+
"prettier": "^3.2.5"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import cors from 'cors';
|
|
3
|
+
import helmet from 'helmet';
|
|
4
|
+
import morgan from 'morgan';
|
|
5
|
+
import routes from './routes';
|
|
6
|
+
import { errorHandler } from './middleware/errorHandler';
|
|
7
|
+
|
|
8
|
+
const app = express();
|
|
9
|
+
|
|
10
|
+
// Security middleware
|
|
11
|
+
app.use(helmet());
|
|
12
|
+
|
|
13
|
+
// CORS
|
|
14
|
+
app.use(cors());
|
|
15
|
+
|
|
16
|
+
// Logging
|
|
17
|
+
app.use(morgan('dev'));
|
|
18
|
+
|
|
19
|
+
// Body parsing
|
|
20
|
+
app.use(express.json());
|
|
21
|
+
app.use(express.urlencoded({ extended: true }));
|
|
22
|
+
|
|
23
|
+
// Routes
|
|
24
|
+
app.use('/api', routes);
|
|
25
|
+
|
|
26
|
+
// Error handling (must be last)
|
|
27
|
+
app.use(errorHandler);
|
|
28
|
+
|
|
29
|
+
export default app;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database configuration
|
|
3
|
+
*
|
|
4
|
+
* Add your database connection logic here
|
|
5
|
+
* Example with PostgreSQL / Prisma / TypeORM
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const databaseConfig = {
|
|
9
|
+
url: process.env.DATABASE_URL || 'postgresql://localhost:5432/{{snakeCase projectName}}',
|
|
10
|
+
};
|