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,20 +0,0 @@
|
|
|
1
|
-
# Production Dockerfile for {{projectName}}
|
|
2
|
-
|
|
3
|
-
FROM python:3.11-slim
|
|
4
|
-
|
|
5
|
-
WORKDIR /app
|
|
6
|
-
|
|
7
|
-
# Install dependencies
|
|
8
|
-
COPY requirements.txt .
|
|
9
|
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
10
|
-
|
|
11
|
-
# Copy source
|
|
12
|
-
COPY . .
|
|
13
|
-
|
|
14
|
-
# Create non-root user
|
|
15
|
-
RUN adduser --disabled-password --gecos "" appuser
|
|
16
|
-
USER appuser
|
|
17
|
-
|
|
18
|
-
EXPOSE 8000
|
|
19
|
-
|
|
20
|
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
> Generated by [Kybernus CLI](https://kybernus.dev) 🚀 (Free)
|
|
4
|
-
|
|
5
|
-
## Stack
|
|
6
|
-
|
|
7
|
-
- **Framework**: FastAPI
|
|
8
|
-
- **Python**: 3.11+
|
|
9
|
-
- **Validation**: Pydantic v2
|
|
10
|
-
|
|
11
|
-
## Quick Start
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Create virtual environment
|
|
15
|
-
python -m venv venv
|
|
16
|
-
source venv/bin/activate # Linux/Mac
|
|
17
|
-
# or: venv\Scripts\activate # Windows
|
|
18
|
-
|
|
19
|
-
# Install dependencies
|
|
20
|
-
pip install -r requirements.txt
|
|
21
|
-
|
|
22
|
-
# Run development server
|
|
23
|
-
uvicorn app.main:app --reload
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## API Endpoints
|
|
27
|
-
|
|
28
|
-
- `GET /api/health` - Health check
|
|
29
|
-
- `GET /api/items` - List items
|
|
30
|
-
- `POST /api/items` - Create item
|
|
31
|
-
- `GET /api/items/{id}` - Get item
|
|
32
|
-
- `DELETE /api/items/{id}` - Delete item
|
|
33
|
-
|
|
34
|
-
## Documentation
|
|
35
|
-
|
|
36
|
-
- Swagger UI: http://localhost:8000/docs
|
|
37
|
-
- ReDoc: http://localhost:8000/redoc
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
Made with ❤️ using [Kybernus](https://kybernus.dev)
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
from fastapi import APIRouter, HTTPException, Depends
|
|
2
|
-
from pydantic import BaseModel, EmailStr
|
|
3
|
-
from app.middleware.security import hash_password, verify_password, create_access_token, get_current_user
|
|
4
|
-
|
|
5
|
-
router = APIRouter()
|
|
6
|
-
|
|
7
|
-
# In-memory user store (replace with database)
|
|
8
|
-
users_db: dict = {}
|
|
9
|
-
|
|
10
|
-
class UserRegister(BaseModel):
|
|
11
|
-
email: EmailStr
|
|
12
|
-
name: str
|
|
13
|
-
password: str
|
|
14
|
-
|
|
15
|
-
class UserLogin(BaseModel):
|
|
16
|
-
email: EmailStr
|
|
17
|
-
password: str
|
|
18
|
-
|
|
19
|
-
class AuthResponse(BaseModel):
|
|
20
|
-
token: str
|
|
21
|
-
user: dict
|
|
22
|
-
|
|
23
|
-
@router.post("/register", response_model=AuthResponse)
|
|
24
|
-
async def register(data: UserRegister):
|
|
25
|
-
if data.email in users_db:
|
|
26
|
-
raise HTTPException(status_code=400, detail="User already exists")
|
|
27
|
-
|
|
28
|
-
hashed = hash_password(data.password)
|
|
29
|
-
user = {"id": str(len(users_db) + 1), "email": data.email, "name": data.name, "password": hashed}
|
|
30
|
-
users_db[data.email] = user
|
|
31
|
-
|
|
32
|
-
token = create_access_token({"sub": user["id"], "email": user["email"]})
|
|
33
|
-
return {"token": token, "user": {"id": user["id"], "email": user["email"], "name": user["name"]}}
|
|
34
|
-
|
|
35
|
-
@router.post("/login", response_model=AuthResponse)
|
|
36
|
-
async def login(data: UserLogin):
|
|
37
|
-
user = users_db.get(data.email)
|
|
38
|
-
if not user or not verify_password(data.password, user["password"]):
|
|
39
|
-
raise HTTPException(status_code=401, detail="Invalid credentials")
|
|
40
|
-
|
|
41
|
-
token = create_access_token({"sub": user["id"], "email": user["email"]})
|
|
42
|
-
return {"token": token, "user": {"id": user["id"], "email": user["email"], "name": user["name"]}}
|
|
43
|
-
|
|
44
|
-
@router.get("/me")
|
|
45
|
-
async def get_me(current_user: dict = Depends(get_current_user)):
|
|
46
|
-
return {"user": current_user}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from fastapi import APIRouter, HTTPException
|
|
2
|
-
from app.services.item_service import ItemService
|
|
3
|
-
from app.schemas.item import ItemCreate, ItemResponse
|
|
4
|
-
|
|
5
|
-
router = APIRouter()
|
|
6
|
-
service = ItemService()
|
|
7
|
-
|
|
8
|
-
@router.get("/", response_model=list[ItemResponse])
|
|
9
|
-
async def list_items():
|
|
10
|
-
return service.list_items()
|
|
11
|
-
|
|
12
|
-
@router.post("/", response_model=ItemResponse, status_code=201)
|
|
13
|
-
async def create_item(item: ItemCreate):
|
|
14
|
-
return service.create_item(item)
|
|
15
|
-
|
|
16
|
-
@router.get("/{item_id}", response_model=ItemResponse)
|
|
17
|
-
async def get_item(item_id: str):
|
|
18
|
-
item = service.get_item(item_id)
|
|
19
|
-
if not item:
|
|
20
|
-
raise HTTPException(status_code=404, detail="Item not found")
|
|
21
|
-
return item
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from fastapi import APIRouter, HTTPException
|
|
2
|
-
from pydantic import BaseModel
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
router = APIRouter()
|
|
6
|
-
|
|
7
|
-
class CheckoutRequest(BaseModel):
|
|
8
|
-
price_id: str
|
|
9
|
-
customer_id: str | None = None
|
|
10
|
-
|
|
11
|
-
@router.post("/checkout")
|
|
12
|
-
async def create_checkout(data: CheckoutRequest):
|
|
13
|
-
# Stripe integration would go here
|
|
14
|
-
# For now, return mock data
|
|
15
|
-
return {
|
|
16
|
-
"checkout_url": f"https://checkout.stripe.com/session_{data.price_id}",
|
|
17
|
-
"session_id": "cs_test_1234567890"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@router.post("/webhook")
|
|
21
|
-
async def stripe_webhook(payload: dict):
|
|
22
|
-
# Handle Stripe webhook events
|
|
23
|
-
event_type = payload.get("type")
|
|
24
|
-
|
|
25
|
-
if event_type == "checkout.session.completed":
|
|
26
|
-
# Handle successful checkout
|
|
27
|
-
pass
|
|
28
|
-
elif event_type == "customer.subscription.updated":
|
|
29
|
-
# Handle subscription update
|
|
30
|
-
pass
|
|
31
|
-
|
|
32
|
-
return {"received": True}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
from fastapi import FastAPI
|
|
2
|
-
from app.controllers import health, auth, items, payments
|
|
3
|
-
|
|
4
|
-
app = FastAPI(title="{{projectName}}")
|
|
5
|
-
|
|
6
|
-
# Health check
|
|
7
|
-
app.include_router(health.router, tags=["Health"])
|
|
8
|
-
|
|
9
|
-
# Auth
|
|
10
|
-
app.include_router(auth.router, prefix="/api/auth", tags=["Authentication"])
|
|
11
|
-
|
|
12
|
-
# Items
|
|
13
|
-
app.include_router(items.router, prefix="/api/items", tags=["Items"])
|
|
14
|
-
|
|
15
|
-
# Payments
|
|
16
|
-
app.include_router(payments.router, prefix="/api/payments", tags=["Payments"])
|
|
17
|
-
|
|
18
|
-
if __name__ == "__main__":
|
|
19
|
-
import uvicorn
|
|
20
|
-
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from passlib.context import CryptContext
|
|
2
|
-
from jose import jwt, JWTError
|
|
3
|
-
from datetime import datetime, timedelta
|
|
4
|
-
from fastapi import HTTPException, Security
|
|
5
|
-
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
|
6
|
-
import os
|
|
7
|
-
|
|
8
|
-
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
9
|
-
security = HTTPBearer()
|
|
10
|
-
|
|
11
|
-
SECRET_KEY = os.getenv("JWT_SECRET", "your-secret-key-change-in-production")
|
|
12
|
-
ALGORITHM = "HS256"
|
|
13
|
-
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 * 7 # 7 days
|
|
14
|
-
|
|
15
|
-
def hash_password(password: str) -> str:
|
|
16
|
-
return pwd_context.hash(password)
|
|
17
|
-
|
|
18
|
-
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
|
19
|
-
return pwd_context.verify(plain_password, hashed_password)
|
|
20
|
-
|
|
21
|
-
def create_access_token(data: dict) -> str:
|
|
22
|
-
to_encode = data.copy()
|
|
23
|
-
expire = datetime.utcnow() + timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
|
|
24
|
-
to_encode.update({"exp": expire})
|
|
25
|
-
return jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
|
|
26
|
-
|
|
27
|
-
def get_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
|
|
28
|
-
try:
|
|
29
|
-
token = credentials.credentials
|
|
30
|
-
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
|
31
|
-
user_id = payload.get("sub")
|
|
32
|
-
email = payload.get("email")
|
|
33
|
-
|
|
34
|
-
if user_id is None:
|
|
35
|
-
raise HTTPException(status_code=401, detail="Invalid authentication credentials")
|
|
36
|
-
|
|
37
|
-
return {"id": user_id, "email": email}
|
|
38
|
-
except JWTError:
|
|
39
|
-
raise HTTPException(status_code=401, detail="Invalid authentication credentials")
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass, field
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
from typing import Optional
|
|
4
|
-
import uuid
|
|
5
|
-
|
|
6
|
-
@dataclass
|
|
7
|
-
class Item:
|
|
8
|
-
id: str = field(default_factory=lambda: str(uuid.uuid4()))
|
|
9
|
-
name: str = ""
|
|
10
|
-
description: Optional[str] = None
|
|
11
|
-
created_at: datetime = field(default_factory=datetime.now)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
class ItemCreate(BaseModel):
|
|
6
|
-
name: str
|
|
7
|
-
description: Optional[str] = None
|
|
8
|
-
|
|
9
|
-
class ItemResponse(BaseModel):
|
|
10
|
-
id: str
|
|
11
|
-
name: str
|
|
12
|
-
description: Optional[str] = None
|
|
13
|
-
created_at: datetime
|
|
14
|
-
|
|
15
|
-
class Config:
|
|
16
|
-
from_attributes = True
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from app.models.item import Item
|
|
2
|
-
from app.schemas.item import ItemCreate
|
|
3
|
-
from typing import List, Optional
|
|
4
|
-
|
|
5
|
-
class ItemService:
|
|
6
|
-
def __init__(self):
|
|
7
|
-
self.items: dict[str, Item] = {}
|
|
8
|
-
|
|
9
|
-
def list_items(self) -> List[Item]:
|
|
10
|
-
return list(self.items.values())
|
|
11
|
-
|
|
12
|
-
def create_item(self, item_data: ItemCreate) -> Item:
|
|
13
|
-
item = Item(name=item_data.name, description=item_data.description)
|
|
14
|
-
self.items[item.id] = item
|
|
15
|
-
return item
|
|
16
|
-
|
|
17
|
-
def get_item(self, item_id: str) -> Optional[Item]:
|
|
18
|
-
return self.items.get(item_id)
|
|
19
|
-
|
|
20
|
-
def delete_item(self, item_id: str) -> bool:
|
|
21
|
-
if item_id in self.items:
|
|
22
|
-
del self.items[item_id]
|
|
23
|
-
return True
|
|
24
|
-
return False
|
|
@@ -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
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# RDS 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
|
-
variable "security_group_id" {
|
|
20
|
-
type = string
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# DB Subnet Group
|
|
24
|
-
resource "aws_db_subnet_group" "main" {
|
|
25
|
-
name = "${var.app_name}-${var.environment}"
|
|
26
|
-
subnet_ids = var.subnet_ids
|
|
27
|
-
|
|
28
|
-
tags = {
|
|
29
|
-
Name = "${var.app_name}-${var.environment}"
|
|
30
|
-
Environment = var.environment
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
# RDS PostgreSQL Instance
|
|
35
|
-
resource "aws_db_instance" "main" {
|
|
36
|
-
identifier = "${var.app_name}-${var.environment}"
|
|
37
|
-
|
|
38
|
-
engine = "postgres"
|
|
39
|
-
engine_version = "16"
|
|
40
|
-
instance_class = "db.t3.micro"
|
|
41
|
-
|
|
42
|
-
allocated_storage = 20
|
|
43
|
-
max_allocated_storage = 100
|
|
44
|
-
storage_type = "gp3"
|
|
45
|
-
storage_encrypted = true
|
|
46
|
-
|
|
47
|
-
db_name = replace(var.app_name, "-", "_")
|
|
48
|
-
username = "postgres"
|
|
49
|
-
password = random_password.db_password.result
|
|
50
|
-
|
|
51
|
-
db_subnet_group_name = aws_db_subnet_group.main.name
|
|
52
|
-
vpc_security_group_ids = [var.security_group_id]
|
|
53
|
-
|
|
54
|
-
backup_retention_period = 7
|
|
55
|
-
skip_final_snapshot = var.environment != "prod"
|
|
56
|
-
|
|
57
|
-
tags = {
|
|
58
|
-
Name = "${var.app_name}-${var.environment}"
|
|
59
|
-
Environment = var.environment
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
# Random password for DB
|
|
64
|
-
resource "random_password" "db_password" {
|
|
65
|
-
length = 32
|
|
66
|
-
special = false
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
# Store password in SSM
|
|
70
|
-
resource "aws_ssm_parameter" "db_password" {
|
|
71
|
-
name = "/${var.app_name}/${var.environment}/db-password"
|
|
72
|
-
description = "Database password for ${var.app_name}"
|
|
73
|
-
type = "SecureString"
|
|
74
|
-
value = random_password.db_password.result
|
|
75
|
-
|
|
76
|
-
tags = {
|
|
77
|
-
Environment = var.environment
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
# Outputs
|
|
82
|
-
output "endpoint" {
|
|
83
|
-
value = aws_db_instance.main.endpoint
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
output "db_name" {
|
|
87
|
-
value = aws_db_instance.main.db_name
|
|
88
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# VPC Module
|
|
2
|
-
|
|
3
|
-
variable "app_name" {
|
|
4
|
-
type = string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
variable "environment" {
|
|
8
|
-
type = string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
# VPC
|
|
12
|
-
resource "aws_vpc" "main" {
|
|
13
|
-
cidr_block = "10.0.0.0/16"
|
|
14
|
-
enable_dns_hostnames = true
|
|
15
|
-
enable_dns_support = true
|
|
16
|
-
|
|
17
|
-
tags = {
|
|
18
|
-
Name = "${var.app_name}-${var.environment}-vpc"
|
|
19
|
-
Environment = var.environment
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# Public Subnets
|
|
24
|
-
resource "aws_subnet" "public" {
|
|
25
|
-
count = 2
|
|
26
|
-
vpc_id = aws_vpc.main.id
|
|
27
|
-
cidr_block = "10.0.${count.index + 1}.0/24"
|
|
28
|
-
availability_zone = data.aws_availability_zones.available.names[count.index]
|
|
29
|
-
|
|
30
|
-
map_public_ip_on_launch = true
|
|
31
|
-
|
|
32
|
-
tags = {
|
|
33
|
-
Name = "${var.app_name}-${var.environment}-public-${count.index + 1}"
|
|
34
|
-
Environment = var.environment
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# Private Subnets
|
|
39
|
-
resource "aws_subnet" "private" {
|
|
40
|
-
count = 2
|
|
41
|
-
vpc_id = aws_vpc.main.id
|
|
42
|
-
cidr_block = "10.0.${count.index + 10}.0/24"
|
|
43
|
-
availability_zone = data.aws_availability_zones.available.names[count.index]
|
|
44
|
-
|
|
45
|
-
tags = {
|
|
46
|
-
Name = "${var.app_name}-${var.environment}-private-${count.index + 1}"
|
|
47
|
-
Environment = var.environment
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
# Internet Gateway
|
|
52
|
-
resource "aws_internet_gateway" "main" {
|
|
53
|
-
vpc_id = aws_vpc.main.id
|
|
54
|
-
|
|
55
|
-
tags = {
|
|
56
|
-
Name = "${var.app_name}-${var.environment}-igw"
|
|
57
|
-
Environment = var.environment
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
# Data source for AZs
|
|
62
|
-
data "aws_availability_zones" "available" {
|
|
63
|
-
state = "available"
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# Security Group for DB
|
|
67
|
-
resource "aws_security_group" "db" {
|
|
68
|
-
name = "${var.app_name}-${var.environment}-db-sg"
|
|
69
|
-
description = "Security group for database"
|
|
70
|
-
vpc_id = aws_vpc.main.id
|
|
71
|
-
|
|
72
|
-
ingress {
|
|
73
|
-
from_port = 5432
|
|
74
|
-
to_port = 5432
|
|
75
|
-
protocol = "tcp"
|
|
76
|
-
cidr_blocks = ["10.0.0.0/16"]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
egress {
|
|
80
|
-
from_port = 0
|
|
81
|
-
to_port = 0
|
|
82
|
-
protocol = "-1"
|
|
83
|
-
cidr_blocks = ["0.0.0.0/0"]
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
tags = {
|
|
87
|
-
Name = "${var.app_name}-${var.environment}-db-sg"
|
|
88
|
-
Environment = var.environment
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
# Outputs
|
|
93
|
-
output "vpc_id" {
|
|
94
|
-
value = aws_vpc.main.id
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
output "public_subnet_ids" {
|
|
98
|
-
value = aws_subnet.public[*].id
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
output "private_subnet_ids" {
|
|
102
|
-
value = aws_subnet.private[*].id
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
output "db_security_group_id" {
|
|
106
|
-
value = aws_security_group.db.id
|
|
107
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
fastapi>=0.109.0
|
|
2
|
-
uvicorn[standard]>=0.27.0
|
|
3
|
-
pydantic>=2.5.0
|
|
4
|
-
python-dotenv>=1.0.0
|
|
5
|
-
python-jose[cryptography]>=3.3.0
|
|
6
|
-
passlib[bcrypt]>=1.7.4
|
|
7
|
-
stripe>=8.0.0
|
|
8
|
-
sqlalchemy>=2.0.0
|
|
9
|
-
alembic>=1.13.0
|
|
10
|
-
psycopg2-binary>=2.9.9
|
|
11
|
-
pytest>=8.0.0
|
|
12
|
-
httpx>=0.26.0
|