kybernus 1.0.0 → 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 +7 -3
- 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,51 +0,0 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
-
import Stripe from "stripe";
|
|
3
|
-
|
|
4
|
-
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
|
5
|
-
apiVersion: "2024-12-18.acacia",
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET || "";
|
|
9
|
-
|
|
10
|
-
export async function POST(request: NextRequest) {
|
|
11
|
-
const body = await request.text();
|
|
12
|
-
const signature = request.headers.get("stripe-signature") || "";
|
|
13
|
-
|
|
14
|
-
let event: Stripe.Event;
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
event = stripe.webhooks.constructEvent(body, signature, webhookSecret);
|
|
18
|
-
} catch (err: any) {
|
|
19
|
-
console.error(`Webhook signature verification failed: ${err.message}`);
|
|
20
|
-
return NextResponse.json({ error: "Invalid signature" }, { status: 400 });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
switch (event.type) {
|
|
24
|
-
case "checkout.session.completed":
|
|
25
|
-
const session = event.data.object as Stripe.Checkout.Session;
|
|
26
|
-
// TODO: Fulfill the purchase
|
|
27
|
-
console.log("Checkout completed:", session.id);
|
|
28
|
-
break;
|
|
29
|
-
|
|
30
|
-
case "customer.subscription.created":
|
|
31
|
-
case "customer.subscription.updated":
|
|
32
|
-
const subscription = event.data.object as Stripe.Subscription;
|
|
33
|
-
// TODO: Update user subscription status in database
|
|
34
|
-
console.log("Subscription updated:", subscription.id);
|
|
35
|
-
break;
|
|
36
|
-
|
|
37
|
-
case "customer.subscription.deleted":
|
|
38
|
-
const deletedSubscription = event.data.object as Stripe.Subscription;
|
|
39
|
-
// TODO: Handle subscription cancellation
|
|
40
|
-
console.log("Subscription deleted:", deletedSubscription.id);
|
|
41
|
-
break;
|
|
42
|
-
|
|
43
|
-
case "invoice.payment_failed":
|
|
44
|
-
const invoice = event.data.object as Stripe.Invoice;
|
|
45
|
-
// TODO: Handle failed payment
|
|
46
|
-
console.log("Payment failed:", invoice.id);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return NextResponse.json({ received: true });
|
|
51
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { getServerSession } from "next-auth";
|
|
2
|
-
import { redirect } from "next/navigation";
|
|
3
|
-
import { authOptions } from "../api/auth/[...nextauth]/route";
|
|
4
|
-
|
|
5
|
-
export default async function DashboardPage() {
|
|
6
|
-
const session = await getServerSession(authOptions);
|
|
7
|
-
|
|
8
|
-
if (!session) {
|
|
9
|
-
redirect("/api/auth/signin");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div className="min-h-screen bg-gray-50 py-12 px-4">
|
|
14
|
-
<div className="max-w-4xl mx-auto">
|
|
15
|
-
<h1 className="text-3xl font-bold text-gray-900 mb-8">Dashboard</h1>
|
|
16
|
-
|
|
17
|
-
<div className="bg-white rounded-lg shadow p-6 mb-6">
|
|
18
|
-
<h2 className="text-xl font-semibold mb-4">Welcome, {session.user?.name || session.user?.email}!</h2>
|
|
19
|
-
<p className="text-gray-600">
|
|
20
|
-
This is a protected page. Only authenticated users can see this content.
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
25
|
-
<div className="bg-white rounded-lg shadow p-6">
|
|
26
|
-
<h3 className="text-lg font-medium mb-2">Subscription</h3>
|
|
27
|
-
<p className="text-gray-600 mb-4">Manage your subscription</p>
|
|
28
|
-
<a href="/api/portal" className="text-blue-600 hover:underline">
|
|
29
|
-
Manage Billing →
|
|
30
|
-
</a>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<div className="bg-white rounded-lg shadow p-6">
|
|
34
|
-
<h3 className="text-lg font-medium mb-2">Profile</h3>
|
|
35
|
-
<p className="text-gray-600 mb-4">Update your profile settings</p>
|
|
36
|
-
<a href="/settings" className="text-blue-600 hover:underline">
|
|
37
|
-
Edit Profile →
|
|
38
|
-
</a>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<div className="bg-white rounded-lg shadow p-6">
|
|
42
|
-
<h3 className="text-lg font-medium mb-2">API Keys</h3>
|
|
43
|
-
<p className="text-gray-600 mb-4">Manage your API keys</p>
|
|
44
|
-
<a href="/api-keys" className="text-blue-600 hover:underline">
|
|
45
|
-
View Keys →
|
|
46
|
-
</a>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { Inter } from 'next/font/google';
|
|
3
|
-
import './globals.css';
|
|
4
|
-
|
|
5
|
-
const inter = Inter({ subsets: ['latin'] });
|
|
6
|
-
|
|
7
|
-
export const metadata: Metadata = {
|
|
8
|
-
title: '{{pascalCase projectName}}',
|
|
9
|
-
description: 'Generated by Kibernus CLI',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default function RootLayout({
|
|
13
|
-
children,
|
|
14
|
-
}: {
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<html lang="en">
|
|
19
|
-
<body className={inter.className}>{children}</body>
|
|
20
|
-
</html>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export default function Home() {
|
|
2
|
-
return (
|
|
3
|
-
<main className="flex min-h-screen flex-col items-center justify-center p-24 bg-gradient-to-b from-gray-900 to-gray-800">
|
|
4
|
-
<div className="text-center">
|
|
5
|
-
<h1 className="text-5xl font-bold mb-4 text-white">
|
|
6
|
-
🚀 {{pascalCase projectName}}
|
|
7
|
-
</h1>
|
|
8
|
-
<p className="text-gray-400 mb-8 text-lg">
|
|
9
|
-
Generated by{' '}
|
|
10
|
-
<a
|
|
11
|
-
href="https://kibernus.dev"
|
|
12
|
-
className="text-blue-400 hover:text-blue-300 underline"
|
|
13
|
-
target="_blank"
|
|
14
|
-
rel="noopener noreferrer"
|
|
15
|
-
>
|
|
16
|
-
Kybernus CLI
|
|
17
|
-
</a>
|
|
18
|
-
</p>
|
|
19
|
-
<div className="flex gap-4 justify-center">
|
|
20
|
-
<a
|
|
21
|
-
href="/api/health"
|
|
22
|
-
className="px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-500 transition font-medium"
|
|
23
|
-
>
|
|
24
|
-
Health Check
|
|
25
|
-
</a>
|
|
26
|
-
<a
|
|
27
|
-
href="https://kibernus.dev/docs"
|
|
28
|
-
className="px-6 py-3 bg-gray-700 text-white rounded-lg hover:bg-gray-600 transition font-medium"
|
|
29
|
-
target="_blank"
|
|
30
|
-
rel="noopener noreferrer"
|
|
31
|
-
>
|
|
32
|
-
Documentation
|
|
33
|
-
</a>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</main>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
File without changes
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { signIn, signOut, useSession } from "next-auth/react";
|
|
4
|
-
|
|
5
|
-
export function AuthButton() {
|
|
6
|
-
const { data: session, status } = useSession();
|
|
7
|
-
|
|
8
|
-
if (status === "loading") {
|
|
9
|
-
return <div className="animate-pulse bg-gray-200 h-10 w-24 rounded-md"></div>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (session) {
|
|
13
|
-
return (
|
|
14
|
-
<div className="flex items-center gap-4">
|
|
15
|
-
<span className="text-sm text-gray-600">
|
|
16
|
-
{session.user?.email}
|
|
17
|
-
</span>
|
|
18
|
-
<button onClick={()=> signOut()}
|
|
19
|
-
className="px-4 py-2 bg-gray-800 text-white rounded-md hover:bg-gray-700 transition"
|
|
20
|
-
>
|
|
21
|
-
Sign Out
|
|
22
|
-
</button>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<button onClick={()=> signIn()}
|
|
29
|
-
className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-500 transition"
|
|
30
|
-
>
|
|
31
|
-
Sign In
|
|
32
|
-
</button>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from '@prisma/client';
|
|
2
|
-
|
|
3
|
-
const globalForPrisma = globalThis as unknown as {
|
|
4
|
-
prisma: PrismaClient | undefined;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const prisma =
|
|
8
|
-
globalForPrisma.prisma ??
|
|
9
|
-
new PrismaClient({
|
|
10
|
-
log: process.env.NODE_ENV === 'development' ? ['query'] : [],
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
import type { NextRequest } from 'next/server';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Next.js 16 Proxy (formerly middleware)
|
|
6
|
-
*
|
|
7
|
-
* This runs at the Edge, before requests reach your app.
|
|
8
|
-
* Use sparingly - prefer other Next.js APIs when possible.
|
|
9
|
-
*/
|
|
10
|
-
export function proxy(request: NextRequest) {
|
|
11
|
-
// Add your proxy logic here
|
|
12
|
-
// Example: Authentication, redirects, headers, etc.
|
|
13
|
-
return NextResponse.next();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Configure which paths the proxy runs on
|
|
17
|
-
export const config = {
|
|
18
|
-
matcher: [
|
|
19
|
-
// Skip static files and api routes you don't want to process
|
|
20
|
-
'/((?!_next/static|_next/image|favicon.ico).*)',
|
|
21
|
-
],
|
|
22
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
const config: Config = {
|
|
4
|
-
content: [
|
|
5
|
-
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
|
6
|
-
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
7
|
-
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
8
|
-
],
|
|
9
|
-
theme: {
|
|
10
|
-
extend: {},
|
|
11
|
-
},
|
|
12
|
-
plugins: [],
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default config;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Next.js Fullstack",
|
|
3
|
-
"tier": "free",
|
|
4
|
-
"stack": "nextjs",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"description": "Next.js 16 with App Router, Prisma, and Tailwind CSS",
|
|
7
|
-
"targetVersions": {
|
|
8
|
-
"node": ">=18.0.0",
|
|
9
|
-
"nextjs": "^16.0.0",
|
|
10
|
-
"prisma": "^5.0.0"
|
|
11
|
-
},
|
|
12
|
-
"requiredConfig": [
|
|
13
|
-
"projectName"
|
|
14
|
-
],
|
|
15
|
-
"optionalConfig": [
|
|
16
|
-
"useAI"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": [
|
|
5
|
-
"dom",
|
|
6
|
-
"dom.iterable",
|
|
7
|
-
"esnext"
|
|
8
|
-
],
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"module": "esnext",
|
|
15
|
-
"moduleResolution": "bundler",
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"isolatedModules": true,
|
|
18
|
-
"jsx": "preserve",
|
|
19
|
-
"incremental": true,
|
|
20
|
-
"plugins": [
|
|
21
|
-
{
|
|
22
|
-
"name": "next"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"paths": {
|
|
26
|
-
"@/*": [
|
|
27
|
-
"./src/*"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"include": [
|
|
32
|
-
"next-env.d.ts",
|
|
33
|
-
"**/*.ts",
|
|
34
|
-
"**/*.tsx",
|
|
35
|
-
".next/types/**/*.ts"
|
|
36
|
-
],
|
|
37
|
-
"exclude": [
|
|
38
|
-
"node_modules"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# {{projectName}} Environment Variables
|
|
2
|
-
|
|
3
|
-
# Server
|
|
4
|
-
NODE_ENV=development
|
|
5
|
-
PORT=3000
|
|
6
|
-
|
|
7
|
-
# Database
|
|
8
|
-
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectNameSnakeCase}}
|
|
9
|
-
|
|
10
|
-
# Authentication
|
|
11
|
-
JWT_SECRET=your-super-secret-jwt-key-change-in-production
|
|
12
|
-
|
|
13
|
-
# Stripe
|
|
14
|
-
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
|
|
15
|
-
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
|
|
16
|
-
STRIPE_PRICE_ID=price_your_price_id
|
|
17
|
-
|
|
18
|
-
# Frontend URL (for redirects)
|
|
19
|
-
FRONTEND_URL=http://localhost:3001
|
|
@@ -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,41 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
> Generated by [Kybernus CLI](https://kybernus.dev) 🚀 (Pro - Clean Architecture)
|
|
4
|
-
|
|
5
|
-
## Architecture
|
|
6
|
-
|
|
7
|
-
This project follows **Clean Architecture** principles:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
src/
|
|
11
|
-
├── domain/ # Business logic (entities, use cases)
|
|
12
|
-
│ ├── entities/ # Domain models
|
|
13
|
-
│ ├── repositories/ # Repository interfaces
|
|
14
|
-
│ └── usecases/ # Business use cases
|
|
15
|
-
├── application/ # Application services
|
|
16
|
-
│ └── services/ # Use case orchestration
|
|
17
|
-
├── infrastructure/ # External concerns
|
|
18
|
-
│ ├── database/ # Repository implementations
|
|
19
|
-
│ ├── http/ # Express controllers
|
|
20
|
-
│ └── providers/ # External services (JWT, bcrypt)
|
|
21
|
-
└── shared/ # Shared utilities
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install
|
|
28
|
-
cp .env.example .env
|
|
29
|
-
npm run dev
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Key Principles
|
|
33
|
-
|
|
34
|
-
1. **Dependency Rule**: Dependencies point inward (infrastructure → application → domain)
|
|
35
|
-
2. **Entities**: Pure business objects with no framework dependencies
|
|
36
|
-
3. **Use Cases**: Application-specific business rules
|
|
37
|
-
4. **Interface Adapters**: Controllers, presenters, gateways
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
Made with ❤️ using [Kybernus Pro](https://kybernus.dev/pro)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
version: '3.8'
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
postgres:
|
|
5
|
-
image: postgres:15-alpine
|
|
6
|
-
container_name: {{kebabCase projectName}}-db
|
|
7
|
-
environment:
|
|
8
|
-
POSTGRES_USER: postgres
|
|
9
|
-
POSTGRES_PASSWORD: postgres
|
|
10
|
-
POSTGRES_DB: {{snakeCase projectName}}
|
|
11
|
-
ports:
|
|
12
|
-
- "5432:5432"
|
|
13
|
-
volumes:
|
|
14
|
-
- postgres_data:/var/lib/postgresql/data
|
|
15
|
-
restart: unless-stopped
|
|
16
|
-
|
|
17
|
-
volumes:
|
|
18
|
-
postgres_data:
|
|
@@ -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
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# ECS Module
|
|
2
|
-
|
|
3
|
-
variable "app_name" {
|
|
4
|
-
type = string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
variable "environment" {
|
|
8
|
-
type = string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
variable "vpc_id" {
|
|
12
|
-
type = string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
variable "subnet_ids" {
|
|
16
|
-
type = list(string)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
# ECS Cluster
|
|
20
|
-
resource "aws_ecs_cluster" "main" {
|
|
21
|
-
name = "${var.app_name}-${var.environment}"
|
|
22
|
-
|
|
23
|
-
setting {
|
|
24
|
-
name = "containerInsights"
|
|
25
|
-
value = "enabled"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
tags = {
|
|
29
|
-
Name = "${var.app_name}-${var.environment}"
|
|
30
|
-
Environment = var.environment
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
# ECS Capacity Provider
|
|
35
|
-
resource "aws_ecs_cluster_capacity_providers" "main" {
|
|
36
|
-
cluster_name = aws_ecs_cluster.main.name
|
|
37
|
-
|
|
38
|
-
capacity_providers = ["FARGATE", "FARGATE_SPOT"]
|
|
39
|
-
|
|
40
|
-
default_capacity_provider_strategy {
|
|
41
|
-
base = 1
|
|
42
|
-
weight = 100
|
|
43
|
-
capacity_provider = "FARGATE"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# Outputs
|
|
48
|
-
output "cluster_name" {
|
|
49
|
-
value = aws_ecs_cluster.main.name
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
output "cluster_arn" {
|
|
53
|
-
value = aws_ecs_cluster.main.arn
|
|
54
|
-
}
|