kybernus 1.0.1 → 1.1.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/LICENSE +20 -0
- package/README.md +49 -263
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +5 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/prompts/wizard.d.ts +14 -1
- package/dist/cli/prompts/wizard.d.ts.map +1 -1
- package/dist/cli/prompts/wizard.js +45 -9
- package/dist/cli/prompts/wizard.js.map +1 -1
- package/dist/core/generator/project.d.ts +8 -0
- package/dist/core/generator/project.d.ts.map +1 -1
- package/dist/core/generator/project.js +41 -2
- package/dist/core/generator/project.js.map +1 -1
- package/dist/core/templates/downloader.d.ts +32 -0
- package/dist/core/templates/downloader.d.ts.map +1 -0
- package/dist/core/templates/downloader.js +95 -0
- package/dist/core/templates/downloader.js.map +1 -0
- package/dist/models/config.d.ts +1 -0
- package/dist/models/config.d.ts.map +1 -1
- package/package.json +6 -2
- package/templates/java-spring/pro/clean/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/java-spring/pro/clean/Dockerfile.hbs +0 -45
- package/templates/java-spring/pro/clean/README.md.hbs +0 -31
- package/templates/java-spring/pro/clean/docker-compose.yml.hbs +0 -18
- package/templates/java-spring/pro/clean/infra/main.tf.hbs +0 -83
- package/templates/java-spring/pro/clean/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/java-spring/pro/clean/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/java-spring/pro/clean/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/java-spring/pro/clean/pom.xml.hbs +0 -130
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/application/service/AuthService.java.hbs +0 -36
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/entity/User.java.hbs +0 -77
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/repository/UserRepository.java.hbs +0 -15
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/usecase/LoginUserUseCase.java.hbs +0 -36
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/domain/usecase/RegisterUserUseCase.java.hbs +0 -46
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/persistence/InMemoryUserRepository.java.hbs +0 -41
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/security/SecurityAdapters.java.hbs +0 -53
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/infrastructure/web/controller/AuthController.java.hbs +0 -41
- package/templates/java-spring/pro/clean/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +0 -14
- package/templates/java-spring/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/java-spring/pro/hexagonal/Dockerfile.hbs +0 -45
- package/templates/java-spring/pro/hexagonal/README.md.hbs +0 -38
- package/templates/java-spring/pro/hexagonal/docker-compose.yml.hbs +0 -18
- package/templates/java-spring/pro/hexagonal/infra/main.tf.hbs +0 -83
- package/templates/java-spring/pro/hexagonal/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/java-spring/pro/hexagonal/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/java-spring/pro/hexagonal/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/java-spring/pro/hexagonal/pom.xml.hbs +0 -130
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/application/service/AuthService.java.hbs +0 -36
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/entity/User.java.hbs +0 -77
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/repository/UserRepository.java.hbs +0 -15
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/usecase/LoginUserUseCase.java.hbs +0 -36
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/domain/usecase/RegisterUserUseCase.java.hbs +0 -46
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/persistence/InMemoryUserRepository.java.hbs +0 -41
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/security/SecurityAdapters.java.hbs +0 -53
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/infrastructure/web/controller/AuthController.java.hbs +0 -41
- package/templates/java-spring/pro/hexagonal/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +0 -14
- package/templates/java-spring/pro/mvc/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/java-spring/pro/mvc/Dockerfile.hbs +0 -45
- package/templates/java-spring/pro/mvc/README.md.hbs +0 -116
- package/templates/java-spring/pro/mvc/docker-compose.yml.hbs +0 -18
- package/templates/java-spring/pro/mvc/infra/main.tf.hbs +0 -83
- package/templates/java-spring/pro/mvc/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/java-spring/pro/mvc/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/java-spring/pro/mvc/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/java-spring/pro/mvc/pom.xml.hbs +0 -130
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/GlobalExceptionHandler.java.hbs +0 -39
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/SecurityConfig.java.hbs +0 -44
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/config/WebConfig.java.hbs +0 -30
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/AuthController.java.hbs +0 -69
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/HealthController.java.hbs +0 -30
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/controller/PaymentsController.java.hbs +0 -49
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/dto/AuthRequest.java.hbs +0 -3
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/dto/AuthResponse.java.hbs +0 -3
- 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 +0 -56
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/security/JwtTokenProvider.java.hbs +0 -59
- 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 +0 -67
- package/templates/java-spring/pro/mvc/src/main/java/{{packagePath}}/{{projectNamePascalCase}}Application.java.hbs +0 -13
- package/templates/java-spring/pro/mvc/src/main/resources/application.yml.hbs +0 -32
- package/templates/java-spring/pro/mvc/src/test/java/{{packagePath}}/{{projectNamePascalCase}}ApplicationTests.java.hbs +0 -13
- package/templates/java-spring/pro/mvc/src/test/resources/application.yml.hbs +0 -10
- package/templates/java-spring/pro/mvc/template.json +0 -14
- package/templates/nestjs/pro/clean/.env.example.hbs +0 -19
- package/templates/nestjs/pro/clean/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nestjs/pro/clean/Dockerfile.hbs +0 -45
- package/templates/nestjs/pro/clean/infra/main.tf.hbs +0 -83
- package/templates/nestjs/pro/clean/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nestjs/pro/clean/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nestjs/pro/clean/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nestjs/pro/clean/package.json.hbs +0 -37
- package/templates/nestjs/pro/clean/src/auth.module.ts.hbs +0 -17
- package/templates/nestjs/pro/clean/src/domain/entities/user.entity.ts.hbs +0 -12
- package/templates/nestjs/pro/clean/src/domain/repositories/user.repository.ts.hbs +0 -6
- package/templates/nestjs/pro/clean/src/domain/use-cases/register.use-case.ts.hbs +0 -18
- package/templates/nestjs/pro/clean/src/infrastructure/database/in-memory.repository.ts.hbs +0 -17
- package/templates/nestjs/pro/clean/src/infrastructure/http/auth.controller.ts.hbs +0 -16
- package/templates/nestjs/pro/clean/tsconfig.json.hbs +0 -21
- package/templates/nestjs/pro/hexagonal/.env.example.hbs +0 -19
- package/templates/nestjs/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nestjs/pro/hexagonal/Dockerfile.hbs +0 -45
- package/templates/nestjs/pro/hexagonal/infra/main.tf.hbs +0 -83
- package/templates/nestjs/pro/hexagonal/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nestjs/pro/hexagonal/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nestjs/pro/hexagonal/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nestjs/pro/hexagonal/package.json.hbs +0 -37
- package/templates/nestjs/pro/hexagonal/src/adapters/inbound/http.adapter.ts.hbs +0 -12
- package/templates/nestjs/pro/hexagonal/src/adapters/outbound/persistence.adapter.ts.hbs +0 -13
- package/templates/nestjs/pro/hexagonal/src/auth.module.ts.hbs +0 -19
- package/templates/nestjs/pro/hexagonal/src/core/auth.service.ts.hbs +0 -16
- package/templates/nestjs/pro/hexagonal/src/core/domain/user.entity.ts.hbs +0 -8
- package/templates/nestjs/pro/hexagonal/src/core/ports/ports.ts.hbs +0 -9
- package/templates/nestjs/pro/hexagonal/tsconfig.json.hbs +0 -21
- package/templates/nestjs/pro/mvc/.env.example.hbs +0 -19
- package/templates/nestjs/pro/mvc/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nestjs/pro/mvc/Dockerfile.hbs +0 -45
- package/templates/nestjs/pro/mvc/README.md.hbs +0 -28
- package/templates/nestjs/pro/mvc/infra/main.tf.hbs +0 -83
- package/templates/nestjs/pro/mvc/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nestjs/pro/mvc/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nestjs/pro/mvc/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nestjs/pro/mvc/package.json.hbs +0 -37
- package/templates/nestjs/pro/mvc/src/app.module.ts.hbs +0 -17
- package/templates/nestjs/pro/mvc/src/auth/auth.controller.ts.hbs +0 -35
- package/templates/nestjs/pro/mvc/src/auth/auth.module.ts.hbs +0 -25
- package/templates/nestjs/pro/mvc/src/auth/auth.service.ts.hbs +0 -55
- package/templates/nestjs/pro/mvc/src/auth/jwt.strategy.ts.hbs +0 -19
- package/templates/nestjs/pro/mvc/src/controllers/health.controller.ts.hbs +0 -9
- package/templates/nestjs/pro/mvc/src/controllers/items.controller.ts.hbs +0 -32
- package/templates/nestjs/pro/mvc/src/main.ts.hbs +0 -17
- package/templates/nestjs/pro/mvc/src/models/create-item.dto.ts.hbs +0 -10
- package/templates/nestjs/pro/mvc/src/models/item.model.ts.hbs +0 -6
- package/templates/nestjs/pro/mvc/src/modules/items.module.ts.hbs +0 -9
- package/templates/nestjs/pro/mvc/src/payments/payments.controller.ts.hbs +0 -26
- package/templates/nestjs/pro/mvc/src/payments/payments.module.ts.hbs +0 -11
- package/templates/nestjs/pro/mvc/src/payments/payments.service.ts.hbs +0 -43
- package/templates/nestjs/pro/mvc/src/services/items.service.ts.hbs +0 -32
- package/templates/nestjs/pro/mvc/tsconfig.json.hbs +0 -21
- package/templates/nextjs/pro/default/.env.example.hbs +0 -20
- package/templates/nextjs/pro/default/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nextjs/pro/default/Dockerfile.hbs +0 -45
- package/templates/nextjs/pro/default/README.md.hbs +0 -96
- package/templates/nextjs/pro/default/docker-compose.yml.hbs +0 -18
- package/templates/nextjs/pro/default/infra/main.tf.hbs +0 -83
- package/templates/nextjs/pro/default/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nextjs/pro/default/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nextjs/pro/default/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nextjs/pro/default/next.config.js.hbs +0 -4
- package/templates/nextjs/pro/default/package.json.hbs +0 -34
- package/templates/nextjs/pro/default/postcss.config.js.hbs +0 -6
- package/templates/nextjs/pro/default/prisma/schema.prisma.hbs +0 -18
- package/templates/nextjs/pro/default/public/.gitkeep +0 -0
- package/templates/nextjs/pro/default/src/app/api/auth/[...nextauth]/route.ts.hbs +0 -61
- package/templates/nextjs/pro/default/src/app/api/checkout/route.ts.hbs +0 -30
- package/templates/nextjs/pro/default/src/app/api/health/route.ts.hbs +0 -9
- package/templates/nextjs/pro/default/src/app/api/webhook/route.ts.hbs +0 -51
- package/templates/nextjs/pro/default/src/app/dashboard/page.tsx.hbs +0 -52
- package/templates/nextjs/pro/default/src/app/globals.css.hbs +0 -3
- package/templates/nextjs/pro/default/src/app/layout.tsx.hbs +0 -22
- package/templates/nextjs/pro/default/src/app/page.tsx.hbs +0 -38
- package/templates/nextjs/pro/default/src/components/.gitkeep +0 -0
- package/templates/nextjs/pro/default/src/components/AuthButton.tsx.hbs +0 -34
- package/templates/nextjs/pro/default/src/components/Providers.tsx.hbs +0 -7
- package/templates/nextjs/pro/default/src/lib/prisma.ts.hbs +0 -13
- package/templates/nextjs/pro/default/src/proxy.ts.hbs +0 -22
- package/templates/nextjs/pro/default/tailwind.config.ts.hbs +0 -15
- package/templates/nextjs/pro/default/template.json +0 -18
- package/templates/nextjs/pro/default/tsconfig.json.hbs +0 -40
- package/templates/nodejs-express/pro/clean/.env.example.hbs +0 -19
- package/templates/nodejs-express/pro/clean/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nodejs-express/pro/clean/Dockerfile.hbs +0 -45
- package/templates/nodejs-express/pro/clean/README.md.hbs +0 -41
- package/templates/nodejs-express/pro/clean/docker-compose.yml.hbs +0 -18
- package/templates/nodejs-express/pro/clean/infra/main.tf.hbs +0 -83
- package/templates/nodejs-express/pro/clean/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nodejs-express/pro/clean/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nodejs-express/pro/clean/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nodejs-express/pro/clean/package.json.hbs +0 -55
- package/templates/nodejs-express/pro/clean/src/application/services/AuthService.ts.hbs +0 -66
- package/templates/nodejs-express/pro/clean/src/domain/entities/User.ts.hbs +0 -38
- package/templates/nodejs-express/pro/clean/src/domain/repositories/IUserRepository.ts.hbs +0 -13
- package/templates/nodejs-express/pro/clean/src/domain/usecases/LoginUserUseCase.ts.hbs +0 -39
- package/templates/nodejs-express/pro/clean/src/domain/usecases/RegisterUserUseCase.ts.hbs +0 -51
- package/templates/nodejs-express/pro/clean/src/index.ts.hbs +0 -40
- package/templates/nodejs-express/pro/clean/src/infrastructure/database/InMemoryUserRepository.ts.hbs +0 -46
- package/templates/nodejs-express/pro/clean/src/infrastructure/http/controllers/AuthController.ts.hbs +0 -45
- package/templates/nodejs-express/pro/clean/src/infrastructure/http/middlewares/AuthMiddleware.ts.hbs +0 -27
- package/templates/nodejs-express/pro/clean/src/infrastructure/providers/PasswordHasher.ts.hbs +0 -14
- package/templates/nodejs-express/pro/clean/src/infrastructure/providers/TokenGenerator.ts.hbs +0 -25
- package/templates/nodejs-express/pro/clean/tsconfig.json.hbs +0 -27
- package/templates/nodejs-express/pro/hexagonal/.env.example.hbs +0 -19
- package/templates/nodejs-express/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nodejs-express/pro/hexagonal/Dockerfile.hbs +0 -45
- package/templates/nodejs-express/pro/hexagonal/README.md.hbs +0 -42
- package/templates/nodejs-express/pro/hexagonal/docker-compose.yml.hbs +0 -18
- package/templates/nodejs-express/pro/hexagonal/infra/main.tf.hbs +0 -83
- package/templates/nodejs-express/pro/hexagonal/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nodejs-express/pro/hexagonal/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nodejs-express/pro/hexagonal/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nodejs-express/pro/hexagonal/package.json.hbs +0 -55
- package/templates/nodejs-express/pro/hexagonal/src/adapters/inbound/http/AuthController.ts.hbs +0 -48
- package/templates/nodejs-express/pro/hexagonal/src/adapters/outbound/SecurityAdapters.ts.hbs +0 -31
- package/templates/nodejs-express/pro/hexagonal/src/adapters/outbound/persistence/InMemoryUserAdapter.ts.hbs +0 -38
- package/templates/nodejs-express/pro/hexagonal/src/core/AuthService.ts.hbs +0 -51
- package/templates/nodejs-express/pro/hexagonal/src/core/domain/entities/User.ts.hbs +0 -28
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/inbound/IAuthPort.ts.hbs +0 -11
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/outbound/ISecurityPorts.ts.hbs +0 -15
- package/templates/nodejs-express/pro/hexagonal/src/core/ports/outbound/IUserRepositoryPort.ts.hbs +0 -13
- package/templates/nodejs-express/pro/hexagonal/src/index.ts.hbs +0 -41
- package/templates/nodejs-express/pro/hexagonal/tsconfig.json.hbs +0 -27
- package/templates/nodejs-express/pro/mvc/.env.example.hbs +0 -19
- package/templates/nodejs-express/pro/mvc/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/nodejs-express/pro/mvc/Dockerfile.hbs +0 -45
- package/templates/nodejs-express/pro/mvc/README.md.hbs +0 -85
- package/templates/nodejs-express/pro/mvc/docker-compose.yml.hbs +0 -18
- package/templates/nodejs-express/pro/mvc/infra/main.tf.hbs +0 -83
- package/templates/nodejs-express/pro/mvc/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/nodejs-express/pro/mvc/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/nodejs-express/pro/mvc/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/nodejs-express/pro/mvc/package.json.hbs +0 -55
- package/templates/nodejs-express/pro/mvc/src/app.ts.hbs +0 -34
- package/templates/nodejs-express/pro/mvc/src/config/database.ts.hbs +0 -10
- package/templates/nodejs-express/pro/mvc/src/controllers/auth.controller.ts.hbs +0 -91
- package/templates/nodejs-express/pro/mvc/src/controllers/healthController.ts.hbs +0 -20
- package/templates/nodejs-express/pro/mvc/src/controllers/payments.controller.ts.hbs +0 -72
- package/templates/nodejs-express/pro/mvc/src/index.ts.hbs +0 -12
- package/templates/nodejs-express/pro/mvc/src/middleware/errorHandler.ts.hbs +0 -22
- package/templates/nodejs-express/pro/mvc/src/middlewares/auth.middleware.ts.hbs +0 -31
- package/templates/nodejs-express/pro/mvc/src/models/.gitkeep +0 -0
- package/templates/nodejs-express/pro/mvc/src/routes/index.ts.hbs +0 -14
- package/templates/nodejs-express/pro/mvc/src/services/.gitkeep +0 -0
- package/templates/nodejs-express/pro/mvc/src/services/stripe.service.ts.hbs +0 -102
- package/templates/nodejs-express/pro/mvc/template.json +0 -18
- package/templates/nodejs-express/pro/mvc/tsconfig.json.hbs +0 -27
- package/templates/python-fastapi/pro/clean/.env.example.hbs +0 -17
- package/templates/python-fastapi/pro/clean/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/python-fastapi/pro/clean/Dockerfile.hbs +0 -20
- package/templates/python-fastapi/pro/clean/app/domain/entities/user.py.hbs +0 -23
- package/templates/python-fastapi/pro/clean/app/domain/repositories/user_repository.py.hbs +0 -22
- package/templates/python-fastapi/pro/clean/app/domain/usecases/register_user.py.hbs +0 -30
- package/templates/python-fastapi/pro/clean/app/infrastructure/database/in_memory_repository.py.hbs +0 -26
- package/templates/python-fastapi/pro/clean/app/infrastructure/http/auth_controller.py.hbs +0 -26
- package/templates/python-fastapi/pro/clean/app/infrastructure/security/adapters.py.hbs +0 -23
- package/templates/python-fastapi/pro/clean/app/main.py.hbs +0 -10
- package/templates/python-fastapi/pro/clean/infra/main.tf.hbs +0 -83
- package/templates/python-fastapi/pro/clean/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/python-fastapi/pro/clean/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/python-fastapi/pro/clean/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/python-fastapi/pro/clean/requirements.txt.hbs +0 -12
- package/templates/python-fastapi/pro/hexagonal/.env.example.hbs +0 -17
- package/templates/python-fastapi/pro/hexagonal/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/python-fastapi/pro/hexagonal/Dockerfile.hbs +0 -20
- package/templates/python-fastapi/pro/hexagonal/app/adapters/inbound/http_adapter.py.hbs +0 -29
- package/templates/python-fastapi/pro/hexagonal/app/core/domain/user.py.hbs +0 -15
- package/templates/python-fastapi/pro/hexagonal/app/core/ports.py.hbs +0 -25
- package/templates/python-fastapi/pro/hexagonal/app/core/service.py.hbs +0 -28
- package/templates/python-fastapi/pro/hexagonal/app/main.py.hbs +0 -22
- package/templates/python-fastapi/pro/hexagonal/infra/main.tf.hbs +0 -83
- package/templates/python-fastapi/pro/hexagonal/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/python-fastapi/pro/hexagonal/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/python-fastapi/pro/hexagonal/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/python-fastapi/pro/hexagonal/requirements.txt.hbs +0 -12
- package/templates/python-fastapi/pro/mvc/.env.example.hbs +0 -17
- package/templates/python-fastapi/pro/mvc/.github/workflows/ci-cd.yml.hbs +0 -88
- package/templates/python-fastapi/pro/mvc/Dockerfile.hbs +0 -20
- package/templates/python-fastapi/pro/mvc/README.md.hbs +0 -41
- package/templates/python-fastapi/pro/mvc/app/controllers/auth.py.hbs +0 -46
- package/templates/python-fastapi/pro/mvc/app/controllers/health.py.hbs +0 -7
- package/templates/python-fastapi/pro/mvc/app/controllers/items.py.hbs +0 -21
- package/templates/python-fastapi/pro/mvc/app/controllers/payments.py.hbs +0 -32
- package/templates/python-fastapi/pro/mvc/app/main.py.hbs +0 -20
- package/templates/python-fastapi/pro/mvc/app/middleware/security.py.hbs +0 -39
- package/templates/python-fastapi/pro/mvc/app/models/item.py.hbs +0 -11
- package/templates/python-fastapi/pro/mvc/app/schemas/item.py.hbs +0 -16
- package/templates/python-fastapi/pro/mvc/app/services/item_service.py.hbs +0 -24
- package/templates/python-fastapi/pro/mvc/infra/main.tf.hbs +0 -83
- package/templates/python-fastapi/pro/mvc/infra/modules/ecs/main.tf.hbs +0 -54
- package/templates/python-fastapi/pro/mvc/infra/modules/rds/main.tf.hbs +0 -88
- package/templates/python-fastapi/pro/mvc/infra/modules/vpc/main.tf.hbs +0 -107
- package/templates/python-fastapi/pro/mvc/requirements.txt.hbs +0 -12
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.domain.entity;
|
|
2
|
-
|
|
3
|
-
import java.time.LocalDateTime;
|
|
4
|
-
import java.util.UUID;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* User Entity - Domain Layer (Clean Architecture)
|
|
8
|
-
* Pure business object with no framework dependencies
|
|
9
|
-
*/
|
|
10
|
-
public class User {
|
|
11
|
-
private final String id;
|
|
12
|
-
private final String email;
|
|
13
|
-
private final String name;
|
|
14
|
-
private final String password;
|
|
15
|
-
private String stripeCustomerId;
|
|
16
|
-
private final LocalDateTime createdAt;
|
|
17
|
-
|
|
18
|
-
private User(String id, String email, String name, String password, String stripeCustomerId, LocalDateTime createdAt) {
|
|
19
|
-
this.id = id;
|
|
20
|
-
this.email = email;
|
|
21
|
-
this.name = name;
|
|
22
|
-
this.password = password;
|
|
23
|
-
this.stripeCustomerId = stripeCustomerId;
|
|
24
|
-
this.createdAt = createdAt;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public static User create(String email, String name, String password) {
|
|
28
|
-
validateEmail(email);
|
|
29
|
-
validatePassword(password);
|
|
30
|
-
return new User(UUID.randomUUID().toString(), email, name, password, null, LocalDateTime.now());
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public static User restore(String id, String email, String name, String password, String stripeCustomerId, LocalDateTime createdAt) {
|
|
34
|
-
return new User(id, email, name, password, stripeCustomerId, createdAt);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
private static void validateEmail(String email) {
|
|
38
|
-
if (email == null || !email.contains("@")) {
|
|
39
|
-
throw new IllegalArgumentException("Invalid email format");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private static void validatePassword(String password) {
|
|
44
|
-
if (password == null || password.length() < 8) {
|
|
45
|
-
throw new IllegalArgumentException("Password must be at least 8 characters");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Getters
|
|
50
|
-
public String getId() {
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public String getEmail() {
|
|
55
|
-
return email;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public String getName() {
|
|
59
|
-
return name;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public String getPassword() {
|
|
63
|
-
return password;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public String getStripeCustomerId() {
|
|
67
|
-
return stripeCustomerId;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public LocalDateTime getCreatedAt() {
|
|
71
|
-
return createdAt;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public void setStripeCustomerId(String stripeCustomerId) {
|
|
75
|
-
this.stripeCustomerId = stripeCustomerId;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.domain.repository;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.domain.entity.User;
|
|
4
|
-
import java.util.Optional;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* User Repository Interface - Domain Layer
|
|
8
|
-
* Defines the contract for user persistence
|
|
9
|
-
*/
|
|
10
|
-
public interface UserRepository {
|
|
11
|
-
Optional<User> findById(String id);
|
|
12
|
-
Optional<User> findByEmail(String email);
|
|
13
|
-
User save(User user);
|
|
14
|
-
void delete(String id);
|
|
15
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.domain.usecase;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.domain.entity.User;
|
|
4
|
-
import {{packageName}}.domain.repository.UserRepository;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Login User Use Case - Domain Layer
|
|
8
|
-
*/
|
|
9
|
-
public class LoginUserUseCase {
|
|
10
|
-
private final UserRepository userRepository;
|
|
11
|
-
private final RegisterUserUseCase.PasswordEncoder passwordEncoder;
|
|
12
|
-
private final RegisterUserUseCase.TokenGenerator tokenGenerator;
|
|
13
|
-
|
|
14
|
-
public LoginUserUseCase(UserRepository userRepository,
|
|
15
|
-
RegisterUserUseCase.PasswordEncoder passwordEncoder,
|
|
16
|
-
RegisterUserUseCase.TokenGenerator tokenGenerator) {
|
|
17
|
-
this.userRepository = userRepository;
|
|
18
|
-
this.passwordEncoder = passwordEncoder;
|
|
19
|
-
this.tokenGenerator = tokenGenerator;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public record Input(String email, String password) {}
|
|
23
|
-
public record Output(User user, String token) {}
|
|
24
|
-
|
|
25
|
-
public Output execute(Input input) {
|
|
26
|
-
User user = userRepository.findByEmail(input.email())
|
|
27
|
-
.orElseThrow(() -> new IllegalArgumentException("Invalid credentials"));
|
|
28
|
-
|
|
29
|
-
if (!passwordEncoder.matches(input.password(), user.getPassword())) {
|
|
30
|
-
throw new IllegalArgumentException("Invalid credentials");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
String token = tokenGenerator.generate(user.getId(), user.getEmail());
|
|
34
|
-
return new Output(user, token);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.domain.usecase;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.domain.entity.User;
|
|
4
|
-
import {{packageName}}.domain.repository.UserRepository;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Register User Use Case - Domain Layer
|
|
8
|
-
*/
|
|
9
|
-
public class RegisterUserUseCase {
|
|
10
|
-
private final UserRepository userRepository;
|
|
11
|
-
private final PasswordEncoder passwordEncoder;
|
|
12
|
-
private final TokenGenerator tokenGenerator;
|
|
13
|
-
|
|
14
|
-
public RegisterUserUseCase(UserRepository userRepository, PasswordEncoder passwordEncoder, TokenGenerator
|
|
15
|
-
tokenGenerator) {
|
|
16
|
-
this.userRepository = userRepository;
|
|
17
|
-
this.passwordEncoder = passwordEncoder;
|
|
18
|
-
this.tokenGenerator = tokenGenerator;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public record Input(String email, String name, String password) {}
|
|
22
|
-
public record Output(User user, String token) {}
|
|
23
|
-
|
|
24
|
-
public Output execute(Input input) {
|
|
25
|
-
userRepository.findByEmail(input.email()).ifPresent(u -> {
|
|
26
|
-
throw new IllegalStateException("User already exists");
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
String hashedPassword = passwordEncoder.encode(input.password());
|
|
30
|
-
User user = User.create(input.email(), input.name(), hashedPassword);
|
|
31
|
-
User savedUser = userRepository.save(user);
|
|
32
|
-
String token = tokenGenerator.generate(savedUser.getId(), savedUser.getEmail());
|
|
33
|
-
|
|
34
|
-
return new Output(savedUser, token);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Port interfaces
|
|
38
|
-
public interface PasswordEncoder {
|
|
39
|
-
String encode(String rawPassword);
|
|
40
|
-
boolean matches(String rawPassword, String encodedPassword);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public interface TokenGenerator {
|
|
44
|
-
String generate(String userId, String email);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.infrastructure.persistence;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.domain.entity.User;
|
|
4
|
-
import {{packageName}}.domain.repository.UserRepository;
|
|
5
|
-
import org.springframework.stereotype.Repository;
|
|
6
|
-
|
|
7
|
-
import java.util.Map;
|
|
8
|
-
import java.util.Optional;
|
|
9
|
-
import java.util.concurrent.ConcurrentHashMap;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* In-Memory User Repository - Infrastructure Layer
|
|
13
|
-
* Replace with JPA implementation for production
|
|
14
|
-
*/
|
|
15
|
-
@Repository
|
|
16
|
-
public class InMemoryUserRepository implements UserRepository {
|
|
17
|
-
private final Map<String, User> users = new ConcurrentHashMap<>();
|
|
18
|
-
|
|
19
|
-
@Override
|
|
20
|
-
public Optional<User> findById(String id) {
|
|
21
|
-
return Optional.ofNullable(users.get(id));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
public Optional<User> findByEmail(String email) {
|
|
26
|
-
return users.values().stream()
|
|
27
|
-
.filter(user -> user.getEmail().equals(email))
|
|
28
|
-
.findFirst();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@Override
|
|
32
|
-
public User save(User user) {
|
|
33
|
-
users.put(user.getId(), user);
|
|
34
|
-
return user;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@Override
|
|
38
|
-
public void delete(String id) {
|
|
39
|
-
users.remove(id);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.infrastructure.security;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.domain.usecase.RegisterUserUseCase;
|
|
4
|
-
import io.jsonwebtoken.Jwts;
|
|
5
|
-
import io.jsonwebtoken.security.Keys;
|
|
6
|
-
import org.springframework.beans.factory.annotation.Value;
|
|
7
|
-
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
8
|
-
import org.springframework.stereotype.Component;
|
|
9
|
-
|
|
10
|
-
import javax.crypto.SecretKey;
|
|
11
|
-
import java.nio.charset.StandardCharsets;
|
|
12
|
-
import java.util.Date;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Security Adapters - Infrastructure Layer
|
|
16
|
-
* Implements domain port interfaces
|
|
17
|
-
*/
|
|
18
|
-
@Component
|
|
19
|
-
public class SecurityAdapters implements RegisterUserUseCase.PasswordEncoder, RegisterUserUseCase.TokenGenerator {
|
|
20
|
-
|
|
21
|
-
private final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
|
22
|
-
|
|
23
|
-
@Value("${jwt.secret:your-super-secret-jwt-key-change-in-production}")
|
|
24
|
-
private String jwtSecret;
|
|
25
|
-
|
|
26
|
-
@Value("${jwt.expiration:604800000}")
|
|
27
|
-
private long jwtExpiration;
|
|
28
|
-
|
|
29
|
-
private SecretKey getSigningKey() {
|
|
30
|
-
return Keys.hmacShaKeyFor(jwtSecret.getBytes(StandardCharsets.UTF_8));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Override
|
|
34
|
-
public String encode(String rawPassword) {
|
|
35
|
-
return encoder.encode(rawPassword);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@Override
|
|
39
|
-
public boolean matches(String rawPassword, String encodedPassword) {
|
|
40
|
-
return encoder.matches(rawPassword, encodedPassword);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@Override
|
|
44
|
-
public String generate(String userId, String email) {
|
|
45
|
-
return Jwts.builder()
|
|
46
|
-
.subject(userId)
|
|
47
|
-
.claim("email", email)
|
|
48
|
-
.issuedAt(new Date())
|
|
49
|
-
.expiration(new Date(System.currentTimeMillis() + jwtExpiration))
|
|
50
|
-
.signWith(getSigningKey())
|
|
51
|
-
.compact();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
package {{packageName}}.infrastructure.web.controller;
|
|
2
|
-
|
|
3
|
-
import {{packageName}}.application.service.AuthService;
|
|
4
|
-
import org.springframework.http.ResponseEntity;
|
|
5
|
-
import org.springframework.web.bind.annotation.*;
|
|
6
|
-
|
|
7
|
-
import java.util.Map;
|
|
8
|
-
|
|
9
|
-
@RestController
|
|
10
|
-
@RequestMapping("/api/auth")
|
|
11
|
-
public class AuthController {
|
|
12
|
-
|
|
13
|
-
private final AuthService authService;
|
|
14
|
-
|
|
15
|
-
public AuthController(AuthService authService) {
|
|
16
|
-
this.authService = authService;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public record AuthRequest(String email, String name, String password) {}
|
|
20
|
-
|
|
21
|
-
@PostMapping("/register")
|
|
22
|
-
public ResponseEntity
|
|
23
|
-
<?> register(@RequestBody AuthRequest request) {
|
|
24
|
-
try {
|
|
25
|
-
var result = authService.register(request.email(), request.name(), request.password());
|
|
26
|
-
return ResponseEntity.ok(result);
|
|
27
|
-
} catch (Exception e) {
|
|
28
|
-
return ResponseEntity.badRequest().body(Map.of("error", e.getMessage()));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@PostMapping("/login")
|
|
33
|
-
public ResponseEntity<?> login(@RequestBody AuthRequest request) {
|
|
34
|
-
try {
|
|
35
|
-
var result = authService.login(request.email(), request.password());
|
|
36
|
-
return ResponseEntity.ok(result);
|
|
37
|
-
} catch (Exception e) {
|
|
38
|
-
return ResponseEntity.status(401).body(Map.of("error", e.getMessage()));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
System.out.println("🚀 {{projectNamePascalCase}} running!");
|
|
12
|
-
System.out.println("📐 Architecture: Clean Architecture");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
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
|
|
@@ -1,45 +0,0 @@
|
|
|
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"]
|
|
@@ -1,116 +0,0 @@
|
|
|
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}}
|
|
@@ -1,18 +0,0 @@
|
|
|
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:
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Terraform Infrastructure for {{projectName}}
|
|
2
|
-
|
|
3
|
-
terraform {
|
|
4
|
-
required_version = ">= 1.0.0"
|
|
5
|
-
|
|
6
|
-
required_providers {
|
|
7
|
-
aws = {
|
|
8
|
-
source = "hashicorp/aws"
|
|
9
|
-
version = "~> 5.0"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
# Uncomment for remote state (recommended for production)
|
|
14
|
-
# backend "s3" {
|
|
15
|
-
# bucket = "your-terraform-state-bucket"
|
|
16
|
-
# key = "{{projectNameKebabCase}}/terraform.tfstate"
|
|
17
|
-
# region = "us-east-1"
|
|
18
|
-
# encrypt = true
|
|
19
|
-
# dynamodb_table = "terraform-locks"
|
|
20
|
-
# }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
provider "aws" {
|
|
24
|
-
region = var.aws_region
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
# Variables
|
|
28
|
-
variable "aws_region" {
|
|
29
|
-
description = "AWS region"
|
|
30
|
-
type = string
|
|
31
|
-
default = "us-east-1"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
variable "environment" {
|
|
35
|
-
description = "Environment name (dev, staging, prod)"
|
|
36
|
-
type = string
|
|
37
|
-
default = "dev"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
variable "app_name" {
|
|
41
|
-
description = "Application name"
|
|
42
|
-
type = string
|
|
43
|
-
default = "{{projectNameKebabCase}}"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
# VPC
|
|
47
|
-
module "vpc" {
|
|
48
|
-
source = "./modules/vpc"
|
|
49
|
-
|
|
50
|
-
app_name = var.app_name
|
|
51
|
-
environment = var.environment
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
# ECS Cluster
|
|
55
|
-
module "ecs" {
|
|
56
|
-
source = "./modules/ecs"
|
|
57
|
-
|
|
58
|
-
app_name = var.app_name
|
|
59
|
-
environment = var.environment
|
|
60
|
-
vpc_id = module.vpc.vpc_id
|
|
61
|
-
subnet_ids = module.vpc.private_subnet_ids
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
# RDS PostgreSQL
|
|
65
|
-
module "rds" {
|
|
66
|
-
source = "./modules/rds"
|
|
67
|
-
|
|
68
|
-
app_name = var.app_name
|
|
69
|
-
environment = var.environment
|
|
70
|
-
vpc_id = module.vpc.vpc_id
|
|
71
|
-
subnet_ids = module.vpc.private_subnet_ids
|
|
72
|
-
security_group_id = module.vpc.db_security_group_id
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
# Outputs
|
|
76
|
-
output "ecs_cluster_name" {
|
|
77
|
-
value = module.ecs.cluster_name
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
output "rds_endpoint" {
|
|
81
|
-
value = module.rds.endpoint
|
|
82
|
-
sensitive = true
|
|
83
|
-
}
|