@phila/cli 0.0.1
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/dist/commands/config.d.ts +30 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +135 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +224 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/destroy.d.ts +3 -0
- package/dist/commands/destroy.d.ts.map +1 -0
- package/dist/commands/destroy.js +110 -0
- package/dist/commands/destroy.js.map +1 -0
- package/dist/commands/init.d.ts +25 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +513 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/map.d.ts +8 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +186 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/ship.d.ts +20 -0
- package/dist/commands/ship.d.ts.map +1 -0
- package/dist/commands/ship.js +445 -0
- package/dist/commands/ship.js.map +1 -0
- package/dist/commands/templates.d.ts +3 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +120 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/_shared/city.config.json.tmpl +24 -0
- package/dist/templates/_shared/dotnet-api/Api.csproj +17 -0
- package/dist/templates/_shared/dotnet-api/Program.cs +58 -0
- package/dist/templates/_shared/dotnet-api/aws-lambda-tools-defaults.json +10 -0
- package/dist/templates/_shared/dotnet-api/obj/Api.csproj.nuget.dgspec.json +80 -0
- package/dist/templates/_shared/dotnet-api/obj/Api.csproj.nuget.g.props +15 -0
- package/dist/templates/_shared/dotnet-api/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/_shared/dotnet-api/obj/Debug/net8.0/Api.csproj.AssemblyReference.cache +0 -0
- package/dist/templates/_shared/dotnet-api/obj/project.assets.json +708 -0
- package/dist/templates/_shared/dotnet-api/obj/project.nuget.cache +35 -0
- package/dist/templates/_shared/dotnet-api-postgres/Api.csproj +19 -0
- package/dist/templates/_shared/dotnet-api-postgres/Program.cs +167 -0
- package/dist/templates/_shared/dotnet-api-postgres/aws-lambda-tools-defaults.json +10 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Api.csproj.nuget.dgspec.json +88 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Api.csproj.nuget.g.props +15 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/project.assets.json +106 -0
- package/dist/templates/_shared/dotnet-api-postgres/obj/project.nuget.cache +15 -0
- package/dist/templates/_shared/nuxt-frontend/app.vue +3 -0
- package/dist/templates/_shared/nuxt-frontend/nuxt.config.ts +25 -0
- package/dist/templates/_shared/nuxt-frontend/package.json.tmpl +19 -0
- package/dist/templates/_shared/nuxt-frontend/pages/index.vue +6 -0
- package/dist/templates/_shared/nuxt-frontend/public/.gitkeep +0 -0
- package/dist/templates/_shared/nuxt-frontend/tsconfig.json +3 -0
- package/dist/templates/_shared/webapp-cdk-package.json.tmpl +23 -0
- package/dist/templates/_shared/webapp-frontend/app.vue +3 -0
- package/dist/templates/_shared/webapp-frontend/nuxt.config.ts +25 -0
- package/dist/templates/_shared/webapp-frontend/package.json.tmpl +19 -0
- package/dist/templates/_shared/webapp-frontend/pages/index.vue +7 -0
- package/dist/templates/_shared/webapp-frontend/public/.gitkeep +0 -0
- package/dist/templates/_shared/webapp-frontend/tsconfig.json +3 -0
- package/dist/templates/lambda-api-nodejs/README.md.tmpl +203 -0
- package/dist/templates/lambda-api-nodejs/apps/__lambdaName__/index.ts +89 -0
- package/dist/templates/lambda-api-nodejs/apps/__lambdaName__/package.json +17 -0
- package/dist/templates/lambda-api-nodejs/apps/__lambdaName__/tsconfig.json +8 -0
- package/dist/templates/lambda-api-nodejs/cdk/app.ts.tmpl +53 -0
- package/dist/templates/lambda-api-nodejs/cdk/cdk.json +68 -0
- package/dist/templates/lambda-api-nodejs/cdk/package.json +23 -0
- package/dist/templates/lambda-api-nodejs/cdk/tsconfig.json +9 -0
- package/dist/templates/lambda-api-nodejs/package.json.tmpl +20 -0
- package/dist/templates/lambda-api-nodejs/tsconfig.json +27 -0
- package/dist/templates/lambda-dynamo-api/README.md.tmpl +184 -0
- package/dist/templates/lambda-dynamo-api/apps/__lambdaName__/index.ts +109 -0
- package/dist/templates/lambda-dynamo-api/apps/__lambdaName__/package.json +19 -0
- package/dist/templates/lambda-dynamo-api/apps/__lambdaName__/tsconfig.json +24 -0
- package/dist/templates/lambda-dynamo-api/cdk/app.ts.tmpl +59 -0
- package/dist/templates/lambda-dynamo-api/cdk/cdk.json +73 -0
- package/dist/templates/lambda-dynamo-api/cdk/package.json +23 -0
- package/dist/templates/lambda-dynamo-api/cdk/tsconfig.json +14 -0
- package/dist/templates/lambda-dynamo-api/package.json.tmpl +20 -0
- package/dist/templates/lambda-dynamo-api/tsconfig.json +27 -0
- package/dist/templates/lambda-postgres-api/README.md.tmpl +234 -0
- package/dist/templates/lambda-postgres-api/apps/__lambdaName__/index.ts +76 -0
- package/dist/templates/lambda-postgres-api/apps/__lambdaName__/package.json +18 -0
- package/dist/templates/lambda-postgres-api/apps/__lambdaName__/tsconfig.json +26 -0
- package/dist/templates/lambda-postgres-api/cdk/app.ts.tmpl +55 -0
- package/dist/templates/lambda-postgres-api/cdk/cdk.json +4 -0
- package/dist/templates/lambda-postgres-api/cdk/package.json +23 -0
- package/dist/templates/lambda-postgres-api/cdk/tsconfig.json +25 -0
- package/dist/templates/lambda-postgres-api/package.json.tmpl +20 -0
- package/dist/templates/lambda-postgres-api/tsconfig.json +11 -0
- package/dist/templates/static-site/README.md.tmpl +72 -0
- package/dist/templates/static-site/cdk/app.ts.tmpl +50 -0
- package/dist/templates/static-site/cdk/cdk.json +68 -0
- package/dist/templates/static-site/cdk/package.json +23 -0
- package/dist/templates/static-site/cdk/tsconfig.json +9 -0
- package/dist/templates/static-site/frontend/.gitkeep +0 -0
- package/dist/templates/static-site/frontend/README.md +41 -0
- package/dist/templates/static-site/frontend/package.json +9 -0
- package/dist/templates/static-site/package.json.tmpl +19 -0
- package/dist/templates/static-site/tsconfig.json +27 -0
- package/dist/templates/webapp-ecs-dotnet/README.md.tmpl +213 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/Api.csproj +12 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/Dockerfile +30 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/Program.cs +85 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Api.csproj.nuget.dgspec.json +70 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Api.csproj.nuget.g.props +15 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/project.assets.json +75 -0
- package/dist/templates/webapp-ecs-dotnet/apps/api/obj/project.nuget.cache +8 -0
- package/dist/templates/webapp-ecs-dotnet/cdk/app.ts.tmpl +60 -0
- package/dist/templates/webapp-ecs-dotnet/cdk/cdk.json +38 -0
- package/dist/templates/webapp-ecs-dotnet/cdk/tsconfig.json +25 -0
- package/dist/templates/webapp-ecs-dotnet/package.json.tmpl +23 -0
- package/dist/templates/webapp-ecs-dotnet/tsconfig.json +26 -0
- package/dist/templates/webapp-ecs-node/README.md.tmpl +207 -0
- package/dist/templates/webapp-ecs-node/apps/api/Dockerfile +33 -0
- package/dist/templates/webapp-ecs-node/apps/api/index.ts +74 -0
- package/dist/templates/webapp-ecs-node/apps/api/package.json +22 -0
- package/dist/templates/webapp-ecs-node/apps/api/tsconfig.json +18 -0
- package/dist/templates/webapp-ecs-node/cdk/app.ts.tmpl +60 -0
- package/dist/templates/webapp-ecs-node/cdk/cdk.json +38 -0
- package/dist/templates/webapp-ecs-node/cdk/tsconfig.json +25 -0
- package/dist/templates/webapp-ecs-node/package.json.tmpl +25 -0
- package/dist/templates/webapp-ecs-node/tsconfig.json +26 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/README.md.tmpl +271 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/Api.csproj +17 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/Dockerfile +30 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/Program.cs +194 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Api.csproj.nuget.dgspec.json +80 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Api.csproj.nuget.g.props +19 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Api.csproj.nuget.g.targets +6 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.csproj.AssemblyReference.cache +0 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/project.assets.json +395 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/apps/api/obj/project.nuget.cache +49 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/cdk/app.ts.tmpl +62 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/cdk/cdk.json +38 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/cdk/tsconfig.json +25 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/package.json.tmpl +23 -0
- package/dist/templates/webapp-ecs-postgres-dotnet/tsconfig.json +26 -0
- package/dist/templates/webapp-ecs-postgres-node/README.md.tmpl +261 -0
- package/dist/templates/webapp-ecs-postgres-node/apps/api/Dockerfile +33 -0
- package/dist/templates/webapp-ecs-postgres-node/apps/api/index.ts +160 -0
- package/dist/templates/webapp-ecs-postgres-node/apps/api/package.json +25 -0
- package/dist/templates/webapp-ecs-postgres-node/apps/api/tsconfig.json +18 -0
- package/dist/templates/webapp-ecs-postgres-node/cdk/app.ts.tmpl +62 -0
- package/dist/templates/webapp-ecs-postgres-node/cdk/cdk.json +38 -0
- package/dist/templates/webapp-ecs-postgres-node/cdk/tsconfig.json +25 -0
- package/dist/templates/webapp-ecs-postgres-node/package.json.tmpl +25 -0
- package/dist/templates/webapp-ecs-postgres-node/tsconfig.json +26 -0
- package/dist/templates/webapp-lambda-dotnet/README.md.tmpl +188 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/Api.csproj +17 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/Program.cs +58 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/aws-lambda-tools-defaults.json +10 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Api.csproj.nuget.dgspec.json +80 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Api.csproj.nuget.g.props +15 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/Debug/net8.0/Api.csproj.AssemblyReference.cache +0 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/project.assets.json +708 -0
- package/dist/templates/webapp-lambda-dotnet/apps/api/obj/project.nuget.cache +35 -0
- package/dist/templates/webapp-lambda-dotnet/cdk/app.ts.tmpl +59 -0
- package/dist/templates/webapp-lambda-dotnet/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-dotnet/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-dotnet/package.json.tmpl +23 -0
- package/dist/templates/webapp-lambda-dotnet/tsconfig.json +27 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/README.md.tmpl +223 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/Api.csproj +18 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/Program.cs +155 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/aws-lambda-tools-defaults.json +10 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Api.csproj.nuget.dgspec.json +84 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Api.csproj.nuget.g.props +19 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/Debug/net8.0/Api.csproj.AssemblyReference.cache +0 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/project.assets.json +989 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/apps/api/obj/project.nuget.cache +223 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/cdk/app.ts.tmpl +65 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/package.json.tmpl +23 -0
- package/dist/templates/webapp-lambda-dynamo-dotnet/tsconfig.json +27 -0
- package/dist/templates/webapp-lambda-dynamo-node/README.md.tmpl +189 -0
- package/dist/templates/webapp-lambda-dynamo-node/apps/api/index.ts +109 -0
- package/dist/templates/webapp-lambda-dynamo-node/apps/api/package.json +19 -0
- package/dist/templates/webapp-lambda-dynamo-node/apps/api/tsconfig.json +8 -0
- package/dist/templates/webapp-lambda-dynamo-node/cdk/app.ts.tmpl +65 -0
- package/dist/templates/webapp-lambda-dynamo-node/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-dynamo-node/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-dynamo-node/package.json.tmpl +24 -0
- package/dist/templates/webapp-lambda-dynamo-node/tsconfig.json +27 -0
- package/dist/templates/webapp-lambda-node/README.md.tmpl +179 -0
- package/dist/templates/webapp-lambda-node/apps/api/index.ts +100 -0
- package/dist/templates/webapp-lambda-node/apps/api/package.json +17 -0
- package/dist/templates/webapp-lambda-node/apps/api/tsconfig.json +8 -0
- package/dist/templates/webapp-lambda-node/cdk/app.ts.tmpl +59 -0
- package/dist/templates/webapp-lambda-node/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-node/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-node/package.json.tmpl +24 -0
- package/dist/templates/webapp-lambda-node/tsconfig.json +27 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/README.md.tmpl +240 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/Api.csproj +19 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/Program.cs +167 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/aws-lambda-tools-defaults.json +10 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Api.csproj.nuget.dgspec.json +88 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Api.csproj.nuget.g.props +15 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Api.csproj.nuget.g.targets +2 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfo.cs +22 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache +1 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.GeneratedMSBuildEditorConfig.editorconfig +19 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.GlobalUsings.g.cs +17 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/Debug/net8.0/Api.assets.cache +0 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/project.assets.json +106 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/apps/api/obj/project.nuget.cache +15 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/cdk/app.ts.tmpl +61 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/package.json.tmpl +23 -0
- package/dist/templates/webapp-lambda-postgres-dotnet/tsconfig.json +27 -0
- package/dist/templates/webapp-lambda-postgres-node/README.md.tmpl +190 -0
- package/dist/templates/webapp-lambda-postgres-node/apps/api/index.ts +76 -0
- package/dist/templates/webapp-lambda-postgres-node/apps/api/package.json +18 -0
- package/dist/templates/webapp-lambda-postgres-node/apps/api/tsconfig.json +8 -0
- package/dist/templates/webapp-lambda-postgres-node/cdk/app.ts.tmpl +61 -0
- package/dist/templates/webapp-lambda-postgres-node/cdk/cdk.json +68 -0
- package/dist/templates/webapp-lambda-postgres-node/cdk/tsconfig.json +9 -0
- package/dist/templates/webapp-lambda-postgres-node/package.json.tmpl +24 -0
- package/dist/templates/webapp-lambda-postgres-node/tsconfig.json +27 -0
- package/dist/utils/aws.d.ts +4 -0
- package/dist/utils/aws.d.ts.map +1 -0
- package/dist/utils/aws.js +90 -0
- package/dist/utils/aws.js.map +1 -0
- package/dist/utils/dependencies.d.ts +27 -0
- package/dist/utils/dependencies.d.ts.map +1 -0
- package/dist/utils/dependencies.js +267 -0
- package/dist/utils/dependencies.js.map +1 -0
- package/dist/utils/template.d.ts +23 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +115 -0
- package/dist/utils/template.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": "npx ts-node --prefer-ts-exts app.ts",
|
|
3
|
+
"watch": {
|
|
4
|
+
"include": ["**"],
|
|
5
|
+
"exclude": [
|
|
6
|
+
"README.md",
|
|
7
|
+
"cdk*.json",
|
|
8
|
+
"**/*.d.ts",
|
|
9
|
+
"**/*.js",
|
|
10
|
+
"tsconfig.json",
|
|
11
|
+
"package*.json",
|
|
12
|
+
"yarn.lock",
|
|
13
|
+
"node_modules",
|
|
14
|
+
"test"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"context": {
|
|
18
|
+
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
|
|
19
|
+
"@aws-cdk/core:checkSecretUsage": true,
|
|
20
|
+
"@aws-cdk/core:target-partitions": ["aws", "aws-cn"],
|
|
21
|
+
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
|
|
22
|
+
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
|
|
23
|
+
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
|
|
24
|
+
"@aws-cdk/aws-iam:minimizePolicies": true,
|
|
25
|
+
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
|
|
26
|
+
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
|
|
27
|
+
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
|
|
28
|
+
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
|
|
29
|
+
"@aws-cdk/aws-apigateway:disableCloudWatchRole": false,
|
|
30
|
+
"@aws-cdk/core:enablePartitionLiterals": true,
|
|
31
|
+
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
|
|
32
|
+
"@aws-cdk/aws-iam:standardizedServicePrincipals": true,
|
|
33
|
+
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
|
|
34
|
+
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
|
|
35
|
+
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
|
|
36
|
+
"@aws-cdk/aws-route53-patters:useCertificate": true,
|
|
37
|
+
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
|
|
38
|
+
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
|
|
39
|
+
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
|
|
40
|
+
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
|
|
41
|
+
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
|
|
42
|
+
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
|
|
43
|
+
"@aws-cdk/aws-redshift:columnId": true,
|
|
44
|
+
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
|
|
45
|
+
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
|
|
46
|
+
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
|
|
47
|
+
"@aws-cdk/aws-kms:aliasNameRef": true,
|
|
48
|
+
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
|
|
49
|
+
"@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
|
|
50
|
+
"@aws-cdk/aws-efs:denyAnonymousAccess": true,
|
|
51
|
+
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
|
|
52
|
+
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
|
|
53
|
+
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
|
|
54
|
+
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
|
|
55
|
+
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
|
|
56
|
+
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
|
|
57
|
+
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
|
|
58
|
+
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
|
|
59
|
+
"@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true,
|
|
60
|
+
"@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true,
|
|
61
|
+
"@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true,
|
|
62
|
+
"@aws-cdk/aws-eks:nodegroupNameAttribute": true,
|
|
63
|
+
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true,
|
|
64
|
+
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true,
|
|
65
|
+
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false,
|
|
66
|
+
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc",
|
|
7
|
+
"watch": "tsc -w",
|
|
8
|
+
"cdk": "cdk"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@phila/constructs": "file:{{constructsPath}}",
|
|
12
|
+
"aws-cdk-lib": "^2.100.0",
|
|
13
|
+
"cdk-nag": "^2.28.0",
|
|
14
|
+
"constructs": "^10.0.0",
|
|
15
|
+
"source-map-support": "^0.5.21"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^20.10.0",
|
|
19
|
+
"aws-cdk": "^2.100.0",
|
|
20
|
+
"ts-node": "^10.9.0",
|
|
21
|
+
"typescript": "^5.3.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Frontend
|
|
2
|
+
|
|
3
|
+
This directory should contain a Nuxt 3 project configured for Static Site Generation (SSG).
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Replace this placeholder with a Nuxt project:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Remove this placeholder
|
|
11
|
+
rm -rf frontend/*
|
|
12
|
+
|
|
13
|
+
# Create Nuxt project
|
|
14
|
+
npx nuxi@latest init frontend
|
|
15
|
+
|
|
16
|
+
# Configure for SSG in nuxt.config.ts:
|
|
17
|
+
# export default defineNuxtConfig({
|
|
18
|
+
# ssr: true,
|
|
19
|
+
# nitro: {
|
|
20
|
+
# preset: 'static'
|
|
21
|
+
# }
|
|
22
|
+
# })
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Build
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd frontend
|
|
29
|
+
npm install
|
|
30
|
+
npm run generate # Outputs to .output/public/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Deploy
|
|
34
|
+
|
|
35
|
+
The `city ship --web` command will:
|
|
36
|
+
1. Run `pnpm build` in this directory
|
|
37
|
+
2. Sync `dist/` to the S3 bucket
|
|
38
|
+
3. Invalidate the CloudFront cache
|
|
39
|
+
|
|
40
|
+
Note: You may need to adjust the build output directory in your Nuxt config
|
|
41
|
+
or update the ship command to use `.output/public/` instead of `dist/`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{appName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Static site application using Philadelphia constructs",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "npm run build --workspaces",
|
|
8
|
+
"synth": "cd cdk && cdk synth",
|
|
9
|
+
"deploy": "cd cdk && cdk deploy",
|
|
10
|
+
"diff": "cd cdk && cdk diff"
|
|
11
|
+
},
|
|
12
|
+
"workspaces": [
|
|
13
|
+
"cdk",
|
|
14
|
+
"frontend"
|
|
15
|
+
],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^5.3.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"strictNullChecks": true,
|
|
10
|
+
"noImplicitThis": true,
|
|
11
|
+
"alwaysStrict": true,
|
|
12
|
+
"noUnusedLocals": false,
|
|
13
|
+
"noUnusedParameters": false,
|
|
14
|
+
"noImplicitReturns": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": false,
|
|
16
|
+
"inlineSourceMap": true,
|
|
17
|
+
"inlineSources": true,
|
|
18
|
+
"experimentalDecorators": true,
|
|
19
|
+
"strictPropertyInitialization": false,
|
|
20
|
+
"typeRoots": ["./node_modules/@types"],
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"resolveJsonModule": true
|
|
25
|
+
},
|
|
26
|
+
"exclude": ["node_modules", "cdk.out"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# {{appName}}
|
|
2
|
+
|
|
3
|
+
Web application with Nuxt SSG frontend and ECS containerized .NET API backend using Philadelphia constructs.
|
|
4
|
+
|
|
5
|
+
Generated on {{timestamp}}
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/blob/main/packages/constructs/docs/diagrams/webapp-ecs.drawio) in draw.io or VS Code with the Draw.io extension.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### Prerequisites
|
|
16
|
+
|
|
17
|
+
- Node.js 20+
|
|
18
|
+
- .NET 8 SDK
|
|
19
|
+
- Docker (for building container images)
|
|
20
|
+
- AWS CLI configured with SSO
|
|
21
|
+
- AWS profile named `phila-{{appName}}`
|
|
22
|
+
|
|
23
|
+
### Setup
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install frontend and CDK dependencies
|
|
27
|
+
npm install
|
|
28
|
+
|
|
29
|
+
# Restore .NET dependencies
|
|
30
|
+
cd apps/api && dotnet restore && cd ../..
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Development
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Run frontend dev server
|
|
37
|
+
npm run dev
|
|
38
|
+
|
|
39
|
+
# Run API locally
|
|
40
|
+
cd apps/api && dotnet run
|
|
41
|
+
|
|
42
|
+
# Build frontend for production
|
|
43
|
+
npm run build:frontend
|
|
44
|
+
|
|
45
|
+
# Build API Docker image
|
|
46
|
+
npm run build:api
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Deployment
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Configure AWS profile
|
|
53
|
+
export AWS_PROFILE=phila-{{appName}}
|
|
54
|
+
|
|
55
|
+
# Deploy to dev environment
|
|
56
|
+
city deploy dev
|
|
57
|
+
|
|
58
|
+
# Deploy to test environment
|
|
59
|
+
city deploy test
|
|
60
|
+
|
|
61
|
+
# Deploy to production (requires confirmation)
|
|
62
|
+
city deploy prod
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Shipping Updates
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Ship frontend changes to S3/CloudFront
|
|
69
|
+
city ship dev --web
|
|
70
|
+
|
|
71
|
+
# Ship API changes (rebuilds and deploys ECS container)
|
|
72
|
+
city ship dev --ecs api
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Project Structure
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
.
|
|
79
|
+
├── cdk/ # CDK infrastructure code
|
|
80
|
+
│ └── app.ts # Main CDK application
|
|
81
|
+
├── frontend/ # Nuxt 3 SSG frontend
|
|
82
|
+
│ ├── pages/ # File-based routing
|
|
83
|
+
│ ├── app.vue # Root component
|
|
84
|
+
│ └── nuxt.config.ts # Nuxt configuration
|
|
85
|
+
├── apps/ # Backend code
|
|
86
|
+
│ └── api/ # .NET Minimal API container
|
|
87
|
+
│ ├── Program.cs # API entry point and routes
|
|
88
|
+
│ ├── Api.csproj # Project file
|
|
89
|
+
│ └── Dockerfile # Container build file
|
|
90
|
+
└── city.config.json # City CLI configuration
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Frontend
|
|
94
|
+
|
|
95
|
+
The frontend uses [Nuxt 3](https://nuxt.com) with Static Site Generation (SSG):
|
|
96
|
+
|
|
97
|
+
- Pre-renders to static HTML for S3/CloudFront
|
|
98
|
+
- File-based routing in `pages/` directory
|
|
99
|
+
- TypeScript support enabled
|
|
100
|
+
|
|
101
|
+
### Adding Pages
|
|
102
|
+
|
|
103
|
+
Create Vue files in `frontend/pages/`:
|
|
104
|
+
|
|
105
|
+
```vue
|
|
106
|
+
<!-- frontend/pages/about.vue -->
|
|
107
|
+
<template>
|
|
108
|
+
<div>
|
|
109
|
+
<h1>About</h1>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This automatically creates a route at `/about`.
|
|
115
|
+
|
|
116
|
+
## API
|
|
117
|
+
|
|
118
|
+
The API uses [.NET Minimal API](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis) running in an ECS Fargate container behind an Application Load Balancer.
|
|
119
|
+
|
|
120
|
+
### Adding Endpoints
|
|
121
|
+
|
|
122
|
+
Edit `apps/api/Program.cs`:
|
|
123
|
+
|
|
124
|
+
```csharp
|
|
125
|
+
app.MapGet("/users", () => Results.Ok(new { users = new List<object>() }));
|
|
126
|
+
|
|
127
|
+
app.MapPost("/users", (UserRequest request) =>
|
|
128
|
+
{
|
|
129
|
+
// Handle user creation
|
|
130
|
+
return Results.Created($"/users/{Guid.NewGuid()}", request);
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Environment Variables
|
|
135
|
+
|
|
136
|
+
ECS containers automatically receive:
|
|
137
|
+
- `APP_NAME` - Application name ({{appName}})
|
|
138
|
+
- `ENVIRONMENT` - Current environment (dev/test/prod)
|
|
139
|
+
|
|
140
|
+
### Local Development
|
|
141
|
+
|
|
142
|
+
Run the API locally:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cd apps/api
|
|
146
|
+
dotnet run
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Or build and run the Docker container:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
cd apps/api
|
|
153
|
+
docker build -t {{appName}}-api .
|
|
154
|
+
docker run -p 80:80 -e APP_NAME={{appName}} -e ENVIRONMENT=dev {{appName}}-api
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Resources Created
|
|
158
|
+
|
|
159
|
+
This application creates:
|
|
160
|
+
|
|
161
|
+
**Frontend:**
|
|
162
|
+
- **S3 Bucket** - Static asset storage
|
|
163
|
+
- **CloudFront Distribution** - CDN with HTTPS
|
|
164
|
+
- **Origin Access Control** - Secure S3 access
|
|
165
|
+
|
|
166
|
+
**API:**
|
|
167
|
+
- **ECS Fargate Service** - Containerized compute
|
|
168
|
+
- **Application Load Balancer** - HTTP/HTTPS ingress
|
|
169
|
+
- **ECS Cluster** - Container orchestration
|
|
170
|
+
- **ECR Repository** - Docker image storage
|
|
171
|
+
- **VPC Security Groups** - Network security
|
|
172
|
+
- **IAM Roles** - Task execution permissions
|
|
173
|
+
|
|
174
|
+
**Shared:**
|
|
175
|
+
- **SSM Parameters** - Resource discovery
|
|
176
|
+
- **CloudWatch Logs** - Application logs
|
|
177
|
+
- **KMS Keys** - Encryption
|
|
178
|
+
|
|
179
|
+
## URLs
|
|
180
|
+
|
|
181
|
+
After deployment, URLs are available via:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Frontend URL
|
|
185
|
+
city config list --env dev | grep cloudfront
|
|
186
|
+
|
|
187
|
+
# API URL (ALB endpoint)
|
|
188
|
+
city config list --env dev | grep ecs-api
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Adding a Database
|
|
192
|
+
|
|
193
|
+
To add a database, use one of these templates instead:
|
|
194
|
+
- `webapp-ecs-postgres-dotnet` - For PostgreSQL
|
|
195
|
+
|
|
196
|
+
## Scaling
|
|
197
|
+
|
|
198
|
+
ECS automatically adjusts:
|
|
199
|
+
- **Dev**: 1 container instance
|
|
200
|
+
- **Test/Prod**: 2+ container instances with auto-scaling
|
|
201
|
+
|
|
202
|
+
Container resources default to:
|
|
203
|
+
- CPU: 256 units (0.25 vCPU)
|
|
204
|
+
- Memory: 512 MB
|
|
205
|
+
|
|
206
|
+
Adjust in `cdk/app.ts` by passing `cpu` and `memoryLimitMiB` props to `EcsApi`.
|
|
207
|
+
|
|
208
|
+
## Support
|
|
209
|
+
|
|
210
|
+
For issues or questions:
|
|
211
|
+
- [Philadelphia Infrastructure Library Documentation](https://github.com/CityOfPhiladelphia/phila-ctl)
|
|
212
|
+
- [.NET Minimal APIs Documentation](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis)
|
|
213
|
+
- [Nuxt Documentation](https://nuxt.com/docs)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- ABOUTME: .NET 8 Minimal API project for ECS container deployment -->
|
|
2
|
+
<!-- ABOUTME: Standard web application hosted on Kestrel server -->
|
|
3
|
+
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
4
|
+
<PropertyGroup>
|
|
5
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
6
|
+
<Nullable>enable</Nullable>
|
|
7
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
8
|
+
<OutputType>Exe</OutputType>
|
|
9
|
+
<AssemblyName>Api</AssemblyName>
|
|
10
|
+
<RootNamespace>Api</RootNamespace>
|
|
11
|
+
</PropertyGroup>
|
|
12
|
+
</Project>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ABOUTME: Multi-stage Docker build for .NET Minimal API
|
|
2
|
+
# ABOUTME: Creates minimal production image with compiled application
|
|
3
|
+
|
|
4
|
+
# Build stage
|
|
5
|
+
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS builder
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
# Copy project file and restore dependencies
|
|
10
|
+
COPY *.csproj ./
|
|
11
|
+
RUN dotnet restore
|
|
12
|
+
|
|
13
|
+
# Copy source and build
|
|
14
|
+
COPY . ./
|
|
15
|
+
RUN dotnet publish -c Release -o publish --no-restore
|
|
16
|
+
|
|
17
|
+
# Production stage
|
|
18
|
+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
|
|
19
|
+
|
|
20
|
+
WORKDIR /app
|
|
21
|
+
|
|
22
|
+
# Copy published output from builder
|
|
23
|
+
COPY --from=builder /app/publish ./
|
|
24
|
+
|
|
25
|
+
# Run as non-root user for security
|
|
26
|
+
USER app
|
|
27
|
+
|
|
28
|
+
EXPOSE 80
|
|
29
|
+
|
|
30
|
+
ENTRYPOINT ["dotnet", "Api.dll"]
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// ABOUTME: ASP.NET Core Minimal API for ECS container deployment
|
|
2
|
+
// ABOUTME: Provides REST endpoints for the web application backend
|
|
3
|
+
|
|
4
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
5
|
+
|
|
6
|
+
// Configure Kestrel to listen on port 80
|
|
7
|
+
builder.WebHost.ConfigureKestrel(options =>
|
|
8
|
+
{
|
|
9
|
+
options.ListenAnyIP(80);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// Add CORS
|
|
13
|
+
builder.Services.AddCors(options =>
|
|
14
|
+
{
|
|
15
|
+
options.AddDefaultPolicy(policy =>
|
|
16
|
+
{
|
|
17
|
+
policy.AllowAnyOrigin()
|
|
18
|
+
.AllowAnyMethod()
|
|
19
|
+
.AllowAnyHeader();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
var app = builder.Build();
|
|
24
|
+
|
|
25
|
+
app.UseCors();
|
|
26
|
+
|
|
27
|
+
// Request logging middleware
|
|
28
|
+
app.Use(async (context, next) =>
|
|
29
|
+
{
|
|
30
|
+
Console.WriteLine($"{DateTime.UtcNow:o} {context.Request.Method} {context.Request.Path}");
|
|
31
|
+
await next();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Health check endpoint (required for ALB health checks)
|
|
35
|
+
app.MapGet("/health", () => Results.Ok(new
|
|
36
|
+
{
|
|
37
|
+
Status = "healthy",
|
|
38
|
+
Timestamp = DateTime.UtcNow.ToString("o")
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
// Hello world endpoint
|
|
42
|
+
app.MapGet("/hello", (HttpContext context) =>
|
|
43
|
+
{
|
|
44
|
+
var name = context.Request.Query["name"].FirstOrDefault() ?? "World";
|
|
45
|
+
return Results.Ok(new
|
|
46
|
+
{
|
|
47
|
+
Message = $"Hello, {name}!",
|
|
48
|
+
AppName = Environment.GetEnvironmentVariable("APP_NAME"),
|
|
49
|
+
Environment = Environment.GetEnvironmentVariable("ENVIRONMENT"),
|
|
50
|
+
Timestamp = DateTime.UtcNow.ToString("o")
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Example: Create item
|
|
55
|
+
app.MapPost("/items", (ItemRequest request) =>
|
|
56
|
+
{
|
|
57
|
+
Console.WriteLine($"Creating item: {request.Name}");
|
|
58
|
+
|
|
59
|
+
return Results.Created($"/items/{Guid.NewGuid()}", new
|
|
60
|
+
{
|
|
61
|
+
Message = "Item created",
|
|
62
|
+
Item = request
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Example: Get item by ID
|
|
67
|
+
app.MapGet("/items/{id}", (string id) =>
|
|
68
|
+
{
|
|
69
|
+
return Results.Ok(new
|
|
70
|
+
{
|
|
71
|
+
Id = id,
|
|
72
|
+
Message = $"Retrieved item {id}"
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
Console.WriteLine($"Server starting on port 80");
|
|
77
|
+
Console.WriteLine($"APP_NAME: {Environment.GetEnvironmentVariable("APP_NAME")}");
|
|
78
|
+
Console.WriteLine($"ENVIRONMENT: {Environment.GetEnvironmentVariable("ENVIRONMENT")}");
|
|
79
|
+
|
|
80
|
+
app.Run();
|
|
81
|
+
|
|
82
|
+
/// <summary>
|
|
83
|
+
/// Request model for creating items
|
|
84
|
+
/// </summary>
|
|
85
|
+
public record ItemRequest(string Name, string? Description);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"restore": {
|
|
4
|
+
"/Users/alejandro.lopez/code/phila-ctl/templates/webapp-ecs-dotnet/apps/api/Api.csproj": {}
|
|
5
|
+
},
|
|
6
|
+
"projects": {
|
|
7
|
+
"/Users/alejandro.lopez/code/phila-ctl/templates/webapp-ecs-dotnet/apps/api/Api.csproj": {
|
|
8
|
+
"version": "1.0.0",
|
|
9
|
+
"restore": {
|
|
10
|
+
"projectUniqueName": "/Users/alejandro.lopez/code/phila-ctl/templates/webapp-ecs-dotnet/apps/api/Api.csproj",
|
|
11
|
+
"projectName": "Api",
|
|
12
|
+
"projectPath": "/Users/alejandro.lopez/code/phila-ctl/templates/webapp-ecs-dotnet/apps/api/Api.csproj",
|
|
13
|
+
"packagesPath": "/Users/alejandro.lopez/.nuget/packages/",
|
|
14
|
+
"outputPath": "/Users/alejandro.lopez/code/phila-ctl/templates/webapp-ecs-dotnet/apps/api/obj/",
|
|
15
|
+
"projectStyle": "PackageReference",
|
|
16
|
+
"configFilePaths": [
|
|
17
|
+
"/Users/alejandro.lopez/.nuget/NuGet/NuGet.Config"
|
|
18
|
+
],
|
|
19
|
+
"originalTargetFrameworks": [
|
|
20
|
+
"net8.0"
|
|
21
|
+
],
|
|
22
|
+
"sources": {
|
|
23
|
+
"https://api.nuget.org/v3/index.json": {},
|
|
24
|
+
"https://philagov-102658671810.d.codeartifact.us-east-1.amazonaws.com/nuget/se-team/v3/index.json": {}
|
|
25
|
+
},
|
|
26
|
+
"frameworks": {
|
|
27
|
+
"net8.0": {
|
|
28
|
+
"targetAlias": "net8.0",
|
|
29
|
+
"projectReferences": {}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"warningProperties": {
|
|
33
|
+
"warnAsError": [
|
|
34
|
+
"NU1605"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"restoreAuditProperties": {
|
|
38
|
+
"enableAudit": "true",
|
|
39
|
+
"auditLevel": "low",
|
|
40
|
+
"auditMode": "direct"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"frameworks": {
|
|
44
|
+
"net8.0": {
|
|
45
|
+
"targetAlias": "net8.0",
|
|
46
|
+
"imports": [
|
|
47
|
+
"net461",
|
|
48
|
+
"net462",
|
|
49
|
+
"net47",
|
|
50
|
+
"net471",
|
|
51
|
+
"net472",
|
|
52
|
+
"net48",
|
|
53
|
+
"net481"
|
|
54
|
+
],
|
|
55
|
+
"assetTargetFallback": true,
|
|
56
|
+
"warn": true,
|
|
57
|
+
"frameworkReferences": {
|
|
58
|
+
"Microsoft.AspNetCore.App": {
|
|
59
|
+
"privateAssets": "none"
|
|
60
|
+
},
|
|
61
|
+
"Microsoft.NETCore.App": {
|
|
62
|
+
"privateAssets": "all"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.403/PortableRuntimeIdentifierGraph.json"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
|
2
|
+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
|
4
|
+
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
|
5
|
+
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
|
6
|
+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
|
7
|
+
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/alejandro.lopez/.nuget/packages/</NuGetPackageRoot>
|
|
8
|
+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/alejandro.lopez/.nuget/packages/</NuGetPackageFolders>
|
|
9
|
+
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
|
10
|
+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.1</NuGetToolVersion>
|
|
11
|
+
</PropertyGroup>
|
|
12
|
+
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
|
13
|
+
<SourceRoot Include="/Users/alejandro.lopez/.nuget/packages/" />
|
|
14
|
+
</ItemGroup>
|
|
15
|
+
</Project>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//------------------------------------------------------------------------------
|
|
2
|
+
// <auto-generated>
|
|
3
|
+
// This code was generated by a tool.
|
|
4
|
+
//
|
|
5
|
+
// Changes to this file may cause incorrect behavior and will be lost if
|
|
6
|
+
// the code is regenerated.
|
|
7
|
+
// </auto-generated>
|
|
8
|
+
//------------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
using System;
|
|
11
|
+
using System.Reflection;
|
|
12
|
+
|
|
13
|
+
[assembly: System.Reflection.AssemblyCompanyAttribute("Api")]
|
|
14
|
+
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
|
15
|
+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
|
16
|
+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f4db1eb14515a4157a4850a57c0b8c85baa6740e")]
|
|
17
|
+
[assembly: System.Reflection.AssemblyProductAttribute("Api")]
|
|
18
|
+
[assembly: System.Reflection.AssemblyTitleAttribute("Api")]
|
|
19
|
+
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
|
20
|
+
|
|
21
|
+
// Generated by the MSBuild WriteCodeFragment class.
|
|
22
|
+
|
package/dist/templates/webapp-ecs-dotnet/apps/api/obj/Debug/net8.0/Api.AssemblyInfoInputs.cache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1799ac38bbc38f0c289f5500dbe232d0d25d9ca54a2558cbd39eded73fb8a4ca
|