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
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kybernus",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The Ultimate Scaffolding CLI for Modern Developers",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"kybernus": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf dist && tsc",
|
|
12
|
+
"dev": "tsx src/index.ts",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"validate:templates": "tsx scripts/validate-templates.ts",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"cli",
|
|
21
|
+
"scaffolding",
|
|
22
|
+
"boilerplate",
|
|
23
|
+
"generator",
|
|
24
|
+
"nextjs",
|
|
25
|
+
"java",
|
|
26
|
+
"spring-boot",
|
|
27
|
+
"nodejs",
|
|
28
|
+
"fastapi",
|
|
29
|
+
"nestjs",
|
|
30
|
+
"clean-architecture",
|
|
31
|
+
"hexagonal-architecture",
|
|
32
|
+
"devops",
|
|
33
|
+
"infrastructure"
|
|
34
|
+
],
|
|
35
|
+
"author": "Vinit Revisan",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/vinitrevisan/kybernus"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"templates",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@clack/prompts": "^0.11.0",
|
|
52
|
+
"@google/genai": "^1.37.0",
|
|
53
|
+
"commander": "^14.0.2",
|
|
54
|
+
"conf": "^15.0.2",
|
|
55
|
+
"fs-extra": "^11.3.3",
|
|
56
|
+
"handlebars": "^4.7.8"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/fs-extra": "^11.0.4",
|
|
60
|
+
"@types/node": "^25.0.9",
|
|
61
|
+
"rimraf": "^6.1.2",
|
|
62
|
+
"tsx": "^4.21.0",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vitest": "^4.0.17"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
HELP.md
|
|
2
|
+
target/
|
|
3
|
+
!.mvn/wrapper/maven-wrapper.jar
|
|
4
|
+
!**/src/main/**/target/
|
|
5
|
+
!**/src/test/**/target/
|
|
6
|
+
|
|
7
|
+
### STS ###
|
|
8
|
+
.apt_generated
|
|
9
|
+
.classpath
|
|
10
|
+
.factorypath
|
|
11
|
+
.project
|
|
12
|
+
.settings
|
|
13
|
+
.springBeans
|
|
14
|
+
.sts4-cache
|
|
15
|
+
|
|
16
|
+
### IntelliJ IDEA ###
|
|
17
|
+
.idea
|
|
18
|
+
*.iws
|
|
19
|
+
*.iml
|
|
20
|
+
*.ipr
|
|
21
|
+
|
|
22
|
+
### NetBeans ###
|
|
23
|
+
/nbproject/private/
|
|
24
|
+
/nbbuild/
|
|
25
|
+
/dist/
|
|
26
|
+
/nbdist/
|
|
27
|
+
/.nb-gradle/
|
|
28
|
+
build/
|
|
29
|
+
!**/src/main/**/build/
|
|
30
|
+
!**/src/test/**/build/
|
|
31
|
+
|
|
32
|
+
### VS Code ###
|
|
33
|
+
.vscode/
|
|
34
|
+
|
|
35
|
+
### Logs ###
|
|
36
|
+
*.log
|
|
37
|
+
|
|
38
|
+
### Environment ###
|
|
39
|
+
.env
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# {{pascalCase projectName}}
|
|
2
|
+
|
|
3
|
+
> Generated by [Kybernus CLI](https://kibernus.dev) 🚀
|
|
4
|
+
|
|
5
|
+
REST API built with **Spring Boot 3.4**, **Java 21**, and **MVC architecture**.
|
|
6
|
+
|
|
7
|
+
## 📋 Prerequisites
|
|
8
|
+
|
|
9
|
+
- **Java** 21+
|
|
10
|
+
- **Maven** 3.9+
|
|
11
|
+
- **Docker** (optional, for database)
|
|
12
|
+
|
|
13
|
+
## 🚀 Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Start Database (Optional)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
docker-compose up -d
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This will start a PostgreSQL database on port `5432`.
|
|
22
|
+
|
|
23
|
+
### 2. Run the Application
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
./mvnw spring-boot:run
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or with Maven:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mvn spring-boot:run
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Server will start on **http://localhost:8080**
|
|
36
|
+
|
|
37
|
+
## 📁 Project Structure
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
src/main/java/{{packagePath}}/
|
|
41
|
+
├── {{pascalCase projectName}}Application.java # Entry point
|
|
42
|
+
├── controller/ # REST Controllers
|
|
43
|
+
│ └── HealthController.java
|
|
44
|
+
├── service/ # Business logic
|
|
45
|
+
├── model/ # JPA Entities
|
|
46
|
+
├── repository/ # Data access
|
|
47
|
+
└── config/ # Configuration
|
|
48
|
+
├── WebConfig.java
|
|
49
|
+
└── GlobalExceptionHandler.java
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 🏗️ Architecture
|
|
53
|
+
|
|
54
|
+
This project follows the **MVC (Model-View-Controller)** architecture:
|
|
55
|
+
|
|
56
|
+
- **Model**: JPA entities in `model/` package
|
|
57
|
+
- **Controller**: REST endpoints in `controller/` package
|
|
58
|
+
- **Service**: Business logic in `service/` package
|
|
59
|
+
- **Repository**: Data access with Spring Data JPA
|
|
60
|
+
|
|
61
|
+
## 🧪 API Endpoints
|
|
62
|
+
|
|
63
|
+
### Health Check
|
|
64
|
+
```http
|
|
65
|
+
GET /api/health
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Response:**
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"status": "ok",
|
|
72
|
+
"message": "{{pascalCase projectName}} API is running",
|
|
73
|
+
"timestamp": "2026-01-15T22:00:00Z",
|
|
74
|
+
"uptime": 123
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### H2 Console (Development)
|
|
79
|
+
```http
|
|
80
|
+
GET /h2-console
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 🔧 Available Commands
|
|
84
|
+
|
|
85
|
+
- `./mvnw spring-boot:run` - Run in development mode
|
|
86
|
+
- `./mvnw clean package` - Build JAR
|
|
87
|
+
- `./mvnw test` - Run tests
|
|
88
|
+
- `java -jar target/*.jar` - Run production JAR
|
|
89
|
+
|
|
90
|
+
## 🐳 Docker
|
|
91
|
+
|
|
92
|
+
Start the PostgreSQL database:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
docker-compose up -d
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Stop the database:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
docker-compose down
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 📝 Configuration
|
|
105
|
+
|
|
106
|
+
Edit `src/main/resources/application.yml`:
|
|
107
|
+
|
|
108
|
+
| Property | Description | Default |
|
|
109
|
+
|----------|-------------|---------|
|
|
110
|
+
| `server.port` | Server port | `8080` |
|
|
111
|
+
| `spring.datasource.url` | Database URL | PostgreSQL |
|
|
112
|
+
| `spring.jpa.hibernate.ddl-auto` | DDL mode | `update` |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
**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: {{projectNameKebabCase}}-db
|
|
7
|
+
environment:
|
|
8
|
+
POSTGRES_USER: postgres
|
|
9
|
+
POSTGRES_PASSWORD: postgres
|
|
10
|
+
POSTGRES_DB: {{projectNameSnakeCase}}
|
|
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,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
5
|
+
https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
6
|
+
<modelVersion>4.0.0</modelVersion>
|
|
7
|
+
|
|
8
|
+
<parent>
|
|
9
|
+
<groupId>org.springframework.boot</groupId>
|
|
10
|
+
<artifactId>spring-boot-starter-parent</artifactId>
|
|
11
|
+
<version>3.4.1</version>
|
|
12
|
+
<relativePath/>
|
|
13
|
+
</parent>
|
|
14
|
+
|
|
15
|
+
<groupId>{{packageName}}</groupId>
|
|
16
|
+
<artifactId>{{projectNameKebabCase}}</artifactId>
|
|
17
|
+
<version>0.0.1-SNAPSHOT</version>
|
|
18
|
+
<name>{{projectNamePascalCase}}</name>
|
|
19
|
+
<description>Generated by Kibernus CLI</description>
|
|
20
|
+
|
|
21
|
+
<properties>
|
|
22
|
+
<java.version>21</java.version>
|
|
23
|
+
</properties>
|
|
24
|
+
|
|
25
|
+
<dependencies>
|
|
26
|
+
<!-- Spring Boot Starters -->
|
|
27
|
+
<dependency>
|
|
28
|
+
<groupId>org.springframework.boot</groupId>
|
|
29
|
+
<artifactId>spring-boot-starter-web</artifactId>
|
|
30
|
+
</dependency>
|
|
31
|
+
<dependency>
|
|
32
|
+
<groupId>org.springframework.boot</groupId>
|
|
33
|
+
<artifactId>spring-boot-starter-validation</artifactId>
|
|
34
|
+
</dependency>
|
|
35
|
+
<dependency>
|
|
36
|
+
<groupId>org.springframework.boot</groupId>
|
|
37
|
+
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
38
|
+
</dependency>
|
|
39
|
+
|
|
40
|
+
<!-- Database -->
|
|
41
|
+
<dependency>
|
|
42
|
+
<groupId>org.postgresql</groupId>
|
|
43
|
+
<artifactId>postgresql</artifactId>
|
|
44
|
+
<scope>runtime</scope>
|
|
45
|
+
</dependency>
|
|
46
|
+
<dependency>
|
|
47
|
+
<groupId>com.h2database</groupId>
|
|
48
|
+
<artifactId>h2</artifactId>
|
|
49
|
+
<scope>runtime</scope>
|
|
50
|
+
</dependency>
|
|
51
|
+
|
|
52
|
+
<!-- Lombok -->
|
|
53
|
+
<dependency>
|
|
54
|
+
<groupId>org.projectlombok</groupId>
|
|
55
|
+
<artifactId>lombok</artifactId>
|
|
56
|
+
<optional>true</optional>
|
|
57
|
+
</dependency>
|
|
58
|
+
|
|
59
|
+
<!-- DevTools -->
|
|
60
|
+
<dependency>
|
|
61
|
+
<groupId>org.springframework.boot</groupId>
|
|
62
|
+
<artifactId>spring-boot-devtools</artifactId>
|
|
63
|
+
<scope>runtime</scope>
|
|
64
|
+
<optional>true</optional>
|
|
65
|
+
</dependency>
|
|
66
|
+
|
|
67
|
+
<!-- Testing -->
|
|
68
|
+
<dependency>
|
|
69
|
+
<groupId>org.springframework.boot</groupId>
|
|
70
|
+
<artifactId>spring-boot-starter-test</artifactId>
|
|
71
|
+
<scope>test</scope>
|
|
72
|
+
</dependency>
|
|
73
|
+
</dependencies>
|
|
74
|
+
|
|
75
|
+
<build>
|
|
76
|
+
<plugins>
|
|
77
|
+
<plugin>
|
|
78
|
+
<groupId>org.springframework.boot</groupId>
|
|
79
|
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
80
|
+
<configuration>
|
|
81
|
+
<excludes>
|
|
82
|
+
<exclude>
|
|
83
|
+
<groupId>org.projectlombok</groupId>
|
|
84
|
+
<artifactId>lombok</artifactId>
|
|
85
|
+
</exclude>
|
|
86
|
+
</excludes>
|
|
87
|
+
</configuration>
|
|
88
|
+
</plugin>
|
|
89
|
+
</plugins>
|
|
90
|
+
</build>
|
|
91
|
+
|
|
92
|
+
</project>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package {{packageName}}.config;
|
|
2
|
+
|
|
3
|
+
import org.springframework.http.HttpStatus;
|
|
4
|
+
import org.springframework.http.ResponseEntity;
|
|
5
|
+
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
6
|
+
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
7
|
+
|
|
8
|
+
import java.time.Instant;
|
|
9
|
+
import java.util.HashMap;
|
|
10
|
+
import java.util.Map;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Global exception handler for REST API
|
|
14
|
+
*/
|
|
15
|
+
@RestControllerAdvice
|
|
16
|
+
public class GlobalExceptionHandler {
|
|
17
|
+
|
|
18
|
+
@ExceptionHandler(Exception.class)
|
|
19
|
+
public ResponseEntity<Map<String, Object>> handleException(Exception ex) {
|
|
20
|
+
Map<String, Object> error = new HashMap<>();
|
|
21
|
+
error.put("timestamp", Instant.now().toString());
|
|
22
|
+
error.put("status", HttpStatus.INTERNAL_SERVER_ERROR.value());
|
|
23
|
+
error.put("error", "Internal Server Error");
|
|
24
|
+
error.put("message", ex.getMessage());
|
|
25
|
+
|
|
26
|
+
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@ExceptionHandler(IllegalArgumentException.class)
|
|
30
|
+
public ResponseEntity<Map<String, Object>> handleBadRequest(IllegalArgumentException ex) {
|
|
31
|
+
Map<String, Object> error = new HashMap<>();
|
|
32
|
+
error.put("timestamp", Instant.now().toString());
|
|
33
|
+
error.put("status", HttpStatus.BAD_REQUEST.value());
|
|
34
|
+
error.put("error", "Bad Request");
|
|
35
|
+
error.put("message", ex.getMessage());
|
|
36
|
+
|
|
37
|
+
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(error);
|
|
38
|
+
}
|
|
39
|
+
}
|
package/templates/java-spring/free/mvc/src/main/java/{{packagePath}}/config/WebConfig.java.hbs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package {{packageName}}.config;
|
|
2
|
+
|
|
3
|
+
import org.springframework.context.annotation.Bean;
|
|
4
|
+
import org.springframework.context.annotation.Configuration;
|
|
5
|
+
import org.springframework.web.cors.CorsConfiguration;
|
|
6
|
+
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
|
7
|
+
import org.springframework.web.filter.CorsFilter;
|
|
8
|
+
|
|
9
|
+
import java.util.Arrays;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Web configuration for CORS and other settings
|
|
13
|
+
*/
|
|
14
|
+
@Configuration
|
|
15
|
+
public class WebConfig {
|
|
16
|
+
|
|
17
|
+
@Bean
|
|
18
|
+
public CorsFilter corsFilter() {
|
|
19
|
+
CorsConfiguration config = new CorsConfiguration();
|
|
20
|
+
config.setAllowCredentials(true);
|
|
21
|
+
config.setAllowedOriginPatterns(Arrays.asList("*"));
|
|
22
|
+
config.setAllowedHeaders(Arrays.asList("*"));
|
|
23
|
+
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
|
|
24
|
+
|
|
25
|
+
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
26
|
+
source.registerCorsConfiguration("/**", config);
|
|
27
|
+
|
|
28
|
+
return new CorsFilter(source);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package {{packageName}}.controller;
|
|
2
|
+
|
|
3
|
+
import org.springframework.http.ResponseEntity;
|
|
4
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
|
5
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
|
6
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
7
|
+
|
|
8
|
+
import java.time.Instant;
|
|
9
|
+
import java.util.HashMap;
|
|
10
|
+
import java.util.Map;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Health check controller
|
|
14
|
+
*/
|
|
15
|
+
@RestController
|
|
16
|
+
@RequestMapping("/api")
|
|
17
|
+
public class HealthController {
|
|
18
|
+
|
|
19
|
+
private final Instant startTime = Instant.now();
|
|
20
|
+
|
|
21
|
+
@GetMapping("/health")
|
|
22
|
+
public ResponseEntity<Map<String, Object>> health() {
|
|
23
|
+
Map<String, Object> response = new HashMap<>();
|
|
24
|
+
response.put("status", "ok");
|
|
25
|
+
response.put("message", "{{projectNamePascalCase}} API is running");
|
|
26
|
+
response.put("timestamp", Instant.now().toString());
|
|
27
|
+
response.put("uptime", java.time.Duration.between(startTime, Instant.now()).getSeconds());
|
|
28
|
+
return ResponseEntity.ok(response);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package {{packageName}};
|
|
2
|
+
|
|
3
|
+
import org.springframework.boot.SpringApplication;
|
|
4
|
+
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
5
|
+
|
|
6
|
+
@SpringBootApplication
|
|
7
|
+
public class {{projectNamePascalCase}}Application {
|
|
8
|
+
|
|
9
|
+
public static void main(String[] args) {
|
|
10
|
+
SpringApplication.run({{projectNamePascalCase}}Application.class, args);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
spring:
|
|
2
|
+
application:
|
|
3
|
+
name: {{projectNameKebabCase}}
|
|
4
|
+
|
|
5
|
+
datasource:
|
|
6
|
+
url: jdbc:postgresql://localhost:5432/{{projectNameSnakeCase}}
|
|
7
|
+
username: postgres
|
|
8
|
+
password: postgres
|
|
9
|
+
driver-class-name: org.postgresql.Driver
|
|
10
|
+
|
|
11
|
+
jpa:
|
|
12
|
+
hibernate:
|
|
13
|
+
ddl-auto: update
|
|
14
|
+
show-sql: true
|
|
15
|
+
properties:
|
|
16
|
+
hibernate:
|
|
17
|
+
format_sql: true
|
|
18
|
+
dialect: org.hibernate.dialect.PostgreSQLDialect
|
|
19
|
+
|
|
20
|
+
# H2 Console (for development)
|
|
21
|
+
h2:
|
|
22
|
+
console:
|
|
23
|
+
enabled: true
|
|
24
|
+
path: /h2-console
|
|
25
|
+
|
|
26
|
+
server:
|
|
27
|
+
port: 8080
|
|
28
|
+
|
|
29
|
+
logging:
|
|
30
|
+
level:
|
|
31
|
+
root: INFO
|
|
32
|
+
{{packageName}}: DEBUG
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Java Spring Boot MVC",
|
|
3
|
+
"tier": "free",
|
|
4
|
+
"stack": "java-spring",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Spring Boot 4 REST API with Java 21 and MVC architecture",
|
|
7
|
+
"targetVersions": {
|
|
8
|
+
"java": "21",
|
|
9
|
+
"springBoot": "^4.0.0",
|
|
10
|
+
"maven": "^3.9.0"
|
|
11
|
+
},
|
|
12
|
+
"requiredConfig": ["projectName", "packageName"],
|
|
13
|
+
"optionalConfig": ["useAI", "buildTool"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: CI/CD Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
NODE_VERSION: '20'
|
|
11
|
+
AWS_REGION: 'us-east-1'
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: $\{{ env.NODE_VERSION }}
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Run linter
|
|
30
|
+
run: npm run lint --if-present
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: npm test --if-present
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
run: npm run build
|
|
37
|
+
|
|
38
|
+
build-and-push:
|
|
39
|
+
needs: test
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
if: github.ref == 'refs/heads/main'
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Configure AWS credentials
|
|
47
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
48
|
+
with:
|
|
49
|
+
aws-access-key-id: $\{{ secrets.AWS_ACCESS_KEY_ID }}
|
|
50
|
+
aws-secret-access-key: $\{{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
51
|
+
aws-region: $\{{ env.AWS_REGION }}
|
|
52
|
+
|
|
53
|
+
- name: Login to Amazon ECR
|
|
54
|
+
id: login-ecr
|
|
55
|
+
uses: aws-actions/amazon-ecr-login@v2
|
|
56
|
+
|
|
57
|
+
- name: Build, tag, and push image to Amazon ECR
|
|
58
|
+
env:
|
|
59
|
+
ECR_REGISTRY: $\{{ steps.login-ecr.outputs.registry }}
|
|
60
|
+
ECR_REPOSITORY: {{projectNameKebabCase}}
|
|
61
|
+
IMAGE_TAG: $\{{ github.sha }}
|
|
62
|
+
run: |
|
|
63
|
+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
|
64
|
+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
|
|
65
|
+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
|
66
|
+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
|
67
|
+
|
|
68
|
+
deploy:
|
|
69
|
+
needs: build-and-push
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
if: github.ref == 'refs/heads/main'
|
|
72
|
+
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v4
|
|
75
|
+
|
|
76
|
+
- name: Configure AWS credentials
|
|
77
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
78
|
+
with:
|
|
79
|
+
aws-access-key-id: $\{{ secrets.AWS_ACCESS_KEY_ID }}
|
|
80
|
+
aws-secret-access-key: $\{{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
81
|
+
aws-region: $\{{ env.AWS_REGION }}
|
|
82
|
+
|
|
83
|
+
- name: Deploy to ECS
|
|
84
|
+
run: |
|
|
85
|
+
aws ecs update-service \
|
|
86
|
+
--cluster {{projectNameKebabCase}}-prod \
|
|
87
|
+
--service {{projectNameKebabCase}}-api \
|
|
88
|
+
--force-new-deployment
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Production Dockerfile for {{projectName}}
|
|
2
|
+
|
|
3
|
+
# Build stage
|
|
4
|
+
FROM node:20-alpine AS builder
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
# Copy package files
|
|
9
|
+
COPY package*.json ./
|
|
10
|
+
|
|
11
|
+
# Install dependencies
|
|
12
|
+
RUN npm ci --only=production
|
|
13
|
+
|
|
14
|
+
# Copy source code
|
|
15
|
+
COPY . .
|
|
16
|
+
|
|
17
|
+
# Build TypeScript
|
|
18
|
+
RUN npm run build
|
|
19
|
+
|
|
20
|
+
# Production stage
|
|
21
|
+
FROM node:20-alpine AS production
|
|
22
|
+
|
|
23
|
+
WORKDIR /app
|
|
24
|
+
|
|
25
|
+
# Create non-root user
|
|
26
|
+
RUN addgroup -g 1001 -S nodejs && \
|
|
27
|
+
adduser -S nodejs -u 1001
|
|
28
|
+
|
|
29
|
+
# Copy built application
|
|
30
|
+
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
|
|
31
|
+
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
|
|
32
|
+
COPY --from=builder --chown=nodejs:nodejs /app/package.json ./
|
|
33
|
+
|
|
34
|
+
# Switch to non-root user
|
|
35
|
+
USER nodejs
|
|
36
|
+
|
|
37
|
+
# Expose port
|
|
38
|
+
EXPOSE 3000
|
|
39
|
+
|
|
40
|
+
# Health check
|
|
41
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
42
|
+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
43
|
+
|
|
44
|
+
# Start application
|
|
45
|
+
CMD ["node", "dist/index.js"]
|