From abc105060878383b48fe1ef0828da2637ee75a1a Mon Sep 17 00:00:00 2001 From: saingchildren Date: Thu, 23 Apr 2026 17:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=B0=88=E6=A1=88=E6=AA=94?= =?UTF-8?q?=E6=A1=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 30 ++++++ .../AWS_Practice.Server.csproj | 28 ++++++ AWS_Practice.Server/AWS_Practice.Server.http | 6 ++ AWS_Practice.Server/CHANGELOG.md | 9 ++ .../Controllers/WeatherForecastController.cs | 33 ++++++ AWS_Practice.Server/Dockerfile | 38 +++++++ AWS_Practice.Server/Program.cs | 30 ++++++ .../Properties/launchSettings.json | 55 ++++++++++ AWS_Practice.Server/WeatherForecast.cs | 13 +++ .../appsettings.Development.json | 8 ++ AWS_Practice.Server/appsettings.json | 9 ++ AWS_Practice.sln | 33 ++++++ aws_practice.client/.editorconfig | 8 ++ aws_practice.client/.gitattributes | 1 + aws_practice.client/.gitignore | 39 +++++++ aws_practice.client/.oxlintrc.json | 10 ++ aws_practice.client/.vscode/extensions.json | 8 ++ aws_practice.client/CHANGELOG.md | 15 +++ aws_practice.client/README.md | 44 ++++++++ .../aws_practice.client.esproj | 11 ++ aws_practice.client/eslint.config.js | 27 +++++ aws_practice.client/index.html | 13 +++ aws_practice.client/jsconfig.json | 8 ++ aws_practice.client/package.json | 32 ++++++ aws_practice.client/public/favicon.ico | Bin 0 -> 4286 bytes aws_practice.client/src/App.vue | 47 +++++++++ aws_practice.client/src/assets/base.css | 86 ++++++++++++++++ aws_practice.client/src/assets/logo.svg | 1 + aws_practice.client/src/assets/main.css | 35 +++++++ .../src/components/HelloWorld.vue | 85 ++++++++++++++++ .../src/components/TheWelcome.vue | 95 ++++++++++++++++++ .../src/components/WelcomeItem.vue | 87 ++++++++++++++++ .../src/components/icons/IconCommunity.vue | 7 ++ .../components/icons/IconDocumentation.vue | 7 ++ .../src/components/icons/IconEcosystem.vue | 7 ++ .../src/components/icons/IconSupport.vue | 7 ++ .../src/components/icons/IconTooling.vue | 19 ++++ aws_practice.client/src/main.js | 6 ++ aws_practice.client/vite.config.js | 61 +++++++++++ 39 files changed, 1058 insertions(+) create mode 100644 .dockerignore create mode 100644 AWS_Practice.Server/AWS_Practice.Server.csproj create mode 100644 AWS_Practice.Server/AWS_Practice.Server.http create mode 100644 AWS_Practice.Server/CHANGELOG.md create mode 100644 AWS_Practice.Server/Controllers/WeatherForecastController.cs create mode 100644 AWS_Practice.Server/Dockerfile create mode 100644 AWS_Practice.Server/Program.cs create mode 100644 AWS_Practice.Server/Properties/launchSettings.json create mode 100644 AWS_Practice.Server/WeatherForecast.cs create mode 100644 AWS_Practice.Server/appsettings.Development.json create mode 100644 AWS_Practice.Server/appsettings.json create mode 100644 AWS_Practice.sln create mode 100644 aws_practice.client/.editorconfig create mode 100644 aws_practice.client/.gitattributes create mode 100644 aws_practice.client/.gitignore create mode 100644 aws_practice.client/.oxlintrc.json create mode 100644 aws_practice.client/.vscode/extensions.json create mode 100644 aws_practice.client/CHANGELOG.md create mode 100644 aws_practice.client/README.md create mode 100644 aws_practice.client/aws_practice.client.esproj create mode 100644 aws_practice.client/eslint.config.js create mode 100644 aws_practice.client/index.html create mode 100644 aws_practice.client/jsconfig.json create mode 100644 aws_practice.client/package.json create mode 100644 aws_practice.client/public/favicon.ico create mode 100644 aws_practice.client/src/App.vue create mode 100644 aws_practice.client/src/assets/base.css create mode 100644 aws_practice.client/src/assets/logo.svg create mode 100644 aws_practice.client/src/assets/main.css create mode 100644 aws_practice.client/src/components/HelloWorld.vue create mode 100644 aws_practice.client/src/components/TheWelcome.vue create mode 100644 aws_practice.client/src/components/WelcomeItem.vue create mode 100644 aws_practice.client/src/components/icons/IconCommunity.vue create mode 100644 aws_practice.client/src/components/icons/IconDocumentation.vue create mode 100644 aws_practice.client/src/components/icons/IconEcosystem.vue create mode 100644 aws_practice.client/src/components/icons/IconSupport.vue create mode 100644 aws_practice.client/src/components/icons/IconTooling.vue create mode 100644 aws_practice.client/src/main.js create mode 100644 aws_practice.client/vite.config.js diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/AWS_Practice.Server/AWS_Practice.Server.csproj b/AWS_Practice.Server/AWS_Practice.Server.csproj new file mode 100644 index 0000000..fe7bf86 --- /dev/null +++ b/AWS_Practice.Server/AWS_Practice.Server.csproj @@ -0,0 +1,28 @@ + + + + net8.0 + enable + enable + 09911993-443b-437b-9bf3-399aae2961b9 + Linux + ..\aws_practice.client + npm run dev + https://localhost:9387 + + + + + 8.*-* + + + + + + + + false + + + + diff --git a/AWS_Practice.Server/AWS_Practice.Server.http b/AWS_Practice.Server/AWS_Practice.Server.http new file mode 100644 index 0000000..4aaf8dc --- /dev/null +++ b/AWS_Practice.Server/AWS_Practice.Server.http @@ -0,0 +1,6 @@ +@AWS_Practice.Server_HostAddress = http://localhost:5004 + +GET {{AWS_Practice.Server_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/AWS_Practice.Server/CHANGELOG.md b/AWS_Practice.Server/CHANGELOG.md new file mode 100644 index 0000000..fb42f97 --- /dev/null +++ b/AWS_Practice.Server/CHANGELOG.md @@ -0,0 +1,9 @@ +This file explains how Visual Studio created the project. + +The following steps were used to generate this project: +- Create new ASP\.NET Core Web API project. +- Update project file to add a reference to the frontend project and set SPA properties. +- Update `launchSettings.json` to register the SPA proxy as a startup assembly. +- Add `dockerfile` to set up docker build. +- Add project to the startup projects list. +- Write this file. diff --git a/AWS_Practice.Server/Controllers/WeatherForecastController.cs b/AWS_Practice.Server/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..f979387 --- /dev/null +++ b/AWS_Practice.Server/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace AWS_Practice.Server.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/AWS_Practice.Server/Dockerfile b/AWS_Practice.Server/Dockerfile new file mode 100644 index 0000000..5398a26 --- /dev/null +++ b/AWS_Practice.Server/Dockerfile @@ -0,0 +1,38 @@ +# 請參閱 https://aka.ms/customizecontainer 了解如何自訂您的偵錯容器,以及 Visual Studio 如何使用此 Dockerfile 來組建您的映像,以加快偵錯速度。 + +# 此階段用於以快速模式從 VS 執行時 (偵錯設定的預設值) +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + + +# 此階段是用來組建服務專案 +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS with-node +RUN apt-get update +RUN apt-get install curl +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash +RUN apt-get -y install nodejs + + +FROM with-node AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["AWS_Practice.Server/AWS_Practice.Server.csproj", "AWS_Practice.Server/"] +COPY ["aws_practice.client/aws_practice.client.esproj", "aws_practice.client/"] +RUN dotnet restore "./AWS_Practice.Server/AWS_Practice.Server.csproj" +COPY . . +WORKDIR "/src/AWS_Practice.Server" +RUN dotnet build "./AWS_Practice.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# 此階段可用來發佈要複製到最終階段的服務專案 +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./AWS_Practice.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# 此階段用於生產環境,或以一般模式從 VS 執行時 (未使用偵錯設定時的預設值) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "AWS_Practice.Server.dll"] diff --git a/AWS_Practice.Server/Program.cs b/AWS_Practice.Server/Program.cs new file mode 100644 index 0000000..1da74a0 --- /dev/null +++ b/AWS_Practice.Server/Program.cs @@ -0,0 +1,30 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +app.UseDefaultFiles(); +app.UseStaticFiles(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.MapFallbackToFile("/index.html"); + +app.Run(); diff --git a/AWS_Practice.Server/Properties/launchSettings.json b/AWS_Practice.Server/Properties/launchSettings.json new file mode 100644 index 0000000..4f75119 --- /dev/null +++ b/AWS_Practice.Server/Properties/launchSettings.json @@ -0,0 +1,55 @@ +{ + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5004" + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7099;http://localhost:5004" + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" + } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60217", + "sslPort": 44309 + } + } +} diff --git a/AWS_Practice.Server/WeatherForecast.cs b/AWS_Practice.Server/WeatherForecast.cs new file mode 100644 index 0000000..95c060a --- /dev/null +++ b/AWS_Practice.Server/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace AWS_Practice.Server +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/AWS_Practice.Server/appsettings.Development.json b/AWS_Practice.Server/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/AWS_Practice.Server/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/AWS_Practice.Server/appsettings.json b/AWS_Practice.Server/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/AWS_Practice.Server/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/AWS_Practice.sln b/AWS_Practice.sln new file mode 100644 index 0000000..17ae471 --- /dev/null +++ b/AWS_Practice.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36623.8 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{54A90642-561A-4BB1-A94E-469ADEE60C69}") = "aws_practice.client", "aws_practice.client\aws_practice.client.esproj", "{D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS_Practice.Server", "AWS_Practice.Server\AWS_Practice.Server.csproj", "{E83CCE86-5A5C-4DC9-BAEB-439328E1FB3C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Release|Any CPU.Build.0 = Release|Any CPU + {D2C13CFB-B04F-66FE-50DA-EC2C19D0AA2C}.Release|Any CPU.Deploy.0 = Release|Any CPU + {E83CCE86-5A5C-4DC9-BAEB-439328E1FB3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E83CCE86-5A5C-4DC9-BAEB-439328E1FB3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E83CCE86-5A5C-4DC9-BAEB-439328E1FB3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E83CCE86-5A5C-4DC9-BAEB-439328E1FB3C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {506D104B-0535-4980-A14E-3DAE96A0B09A} + EndGlobalSection +EndGlobal diff --git a/aws_practice.client/.editorconfig b/aws_practice.client/.editorconfig new file mode 100644 index 0000000..3b510aa --- /dev/null +++ b/aws_practice.client/.editorconfig @@ -0,0 +1,8 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +max_line_length = 100 diff --git a/aws_practice.client/.gitattributes b/aws_practice.client/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/aws_practice.client/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/aws_practice.client/.gitignore b/aws_practice.client/.gitignore new file mode 100644 index 0000000..cd68f14 --- /dev/null +++ b/aws_practice.client/.gitignore @@ -0,0 +1,39 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo + +.eslintcache + +# Cypress +/cypress/videos/ +/cypress/screenshots/ + +# Vitest +__screenshots__/ + +# Vite +*.timestamp-*-*.mjs diff --git a/aws_practice.client/.oxlintrc.json b/aws_practice.client/.oxlintrc.json new file mode 100644 index 0000000..1c0980f --- /dev/null +++ b/aws_practice.client/.oxlintrc.json @@ -0,0 +1,10 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["eslint", "unicorn", "oxc", "vue"], + "env": { + "browser": true + }, + "categories": { + "correctness": "error" + } +} diff --git a/aws_practice.client/.vscode/extensions.json b/aws_practice.client/.vscode/extensions.json new file mode 100644 index 0000000..55ad03c --- /dev/null +++ b/aws_practice.client/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "Vue.volar", + "dbaeumer.vscode-eslint", + "EditorConfig.EditorConfig", + "oxc.oxc-vscode" + ] +} diff --git a/aws_practice.client/CHANGELOG.md b/aws_practice.client/CHANGELOG.md new file mode 100644 index 0000000..e87302b --- /dev/null +++ b/aws_practice.client/CHANGELOG.md @@ -0,0 +1,15 @@ +This file explains how Visual Studio created the project. + +The following tools were used to generate this project: +- create-vite + +The following steps were used to generate this project: +- Create vue project with create-vite: `npm init --yes vue@latest aws_practice.client -- --eslint `. +- Update `vite.config.js` to set up proxying and certs. +- Update `HelloWorld` component to fetch and display weather information. +- Create project file (`aws_practice.client.esproj`). +- Create `launch.json` to enable debugging. +- Add project to solution. +- Update proxy endpoint to be the backend server endpoint. +- Add project to the startup projects list. +- Write this file. diff --git a/aws_practice.client/README.md b/aws_practice.client/README.md new file mode 100644 index 0000000..3e43bf3 --- /dev/null +++ b/aws_practice.client/README.md @@ -0,0 +1,44 @@ +# aws_practice.client + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). + +## Recommended Browser Setup + +- Chromium-based browsers (Chrome, Edge, Brave, etc.): + - [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) + - [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters) +- Firefox: + - [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/) + - [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/) + +## Customize configuration + +See [Vite Configuration Reference](https://vite.dev/config/). + +## Project Setup + +```sh +npm install +``` + +### Compile and Hot-Reload for Development + +```sh +npm run dev +``` + +### Compile and Minify for Production + +```sh +npm run build +``` + +### Lint with [ESLint](https://eslint.org/) + +```sh +npm run lint +``` diff --git a/aws_practice.client/aws_practice.client.esproj b/aws_practice.client/aws_practice.client.esproj new file mode 100644 index 0000000..b10ea72 --- /dev/null +++ b/aws_practice.client/aws_practice.client.esproj @@ -0,0 +1,11 @@ + + + npm run dev + .\ + Vitest + + false + + $(MSBuildProjectDirectory)\dist + + \ No newline at end of file diff --git a/aws_practice.client/eslint.config.js b/aws_practice.client/eslint.config.js new file mode 100644 index 0000000..a31fa26 --- /dev/null +++ b/aws_practice.client/eslint.config.js @@ -0,0 +1,27 @@ +import { defineConfig, globalIgnores } from 'eslint/config' +import globals from 'globals' +import js from '@eslint/js' +import pluginVue from 'eslint-plugin-vue' +import pluginOxlint from 'eslint-plugin-oxlint' + +export default defineConfig([ + { + name: 'app/files-to-lint', + files: ['**/*.{vue,js,mjs,jsx}'], + }, + + globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), + + { + languageOptions: { + globals: { + ...globals.browser, + }, + }, + }, + + js.configs.recommended, + ...pluginVue.configs['flat/essential'], + + ...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'), +]) diff --git a/aws_practice.client/index.html b/aws_practice.client/index.html new file mode 100644 index 0000000..b19040a --- /dev/null +++ b/aws_practice.client/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/aws_practice.client/jsconfig.json b/aws_practice.client/jsconfig.json new file mode 100644 index 0000000..5a1f2d2 --- /dev/null +++ b/aws_practice.client/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/aws_practice.client/package.json b/aws_practice.client/package.json new file mode 100644 index 0000000..ad417c9 --- /dev/null +++ b/aws_practice.client/package.json @@ -0,0 +1,32 @@ +{ + "name": "aws_practice.client", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "run-s lint:*", + "lint:oxlint": "oxlint . --fix", + "lint:eslint": "eslint . --fix --cache" + }, + "dependencies": { + "vue": "^3.5.32" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@vitejs/plugin-vue": "^6.0.6", + "eslint": "^10.2.1", + "eslint-plugin-oxlint": "~1.60.0", + "eslint-plugin-vue": "~10.8.0", + "globals": "^17.5.0", + "npm-run-all2": "^8.0.4", + "oxlint": "~1.60.0", + "vite": "^8.0.8", + "vite-plugin-vue-devtools": "^8.1.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } +} diff --git a/aws_practice.client/public/favicon.ico b/aws_practice.client/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 0 HcmV?d00001 diff --git a/aws_practice.client/src/App.vue b/aws_practice.client/src/App.vue new file mode 100644 index 0000000..633a5df --- /dev/null +++ b/aws_practice.client/src/App.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/aws_practice.client/src/assets/base.css b/aws_practice.client/src/assets/base.css new file mode 100644 index 0000000..8816868 --- /dev/null +++ b/aws_practice.client/src/assets/base.css @@ -0,0 +1,86 @@ +/* color palette from */ +:root { + --vt-c-white: #ffffff; + --vt-c-white-soft: #f8f8f8; + --vt-c-white-mute: #f2f2f2; + + --vt-c-black: #181818; + --vt-c-black-soft: #222222; + --vt-c-black-mute: #282828; + + --vt-c-indigo: #2c3e50; + + --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); + --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); + --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); + --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + + --vt-c-text-light-1: var(--vt-c-indigo); + --vt-c-text-light-2: rgba(60, 60, 60, 0.66); + --vt-c-text-dark-1: var(--vt-c-white); + --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); +} + +/* semantic color variables for this project */ +:root { + --color-background: var(--vt-c-white); + --color-background-soft: var(--vt-c-white-soft); + --color-background-mute: var(--vt-c-white-mute); + + --color-border: var(--vt-c-divider-light-2); + --color-border-hover: var(--vt-c-divider-light-1); + + --color-heading: var(--vt-c-text-light-1); + --color-text: var(--vt-c-text-light-1); + + --section-gap: 160px; +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--vt-c-black); + --color-background-soft: var(--vt-c-black-soft); + --color-background-mute: var(--vt-c-black-mute); + + --color-border: var(--vt-c-divider-dark-2); + --color-border-hover: var(--vt-c-divider-dark-1); + + --color-heading: var(--vt-c-text-dark-1); + --color-text: var(--vt-c-text-dark-2); + } +} + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + font-weight: normal; +} + +body { + min-height: 100vh; + color: var(--color-text); + background: var(--color-background); + transition: + color 0.5s, + background-color 0.5s; + line-height: 1.6; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen, + Ubuntu, + Cantarell, + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/aws_practice.client/src/assets/logo.svg b/aws_practice.client/src/assets/logo.svg new file mode 100644 index 0000000..7565660 --- /dev/null +++ b/aws_practice.client/src/assets/logo.svg @@ -0,0 +1 @@ + diff --git a/aws_practice.client/src/assets/main.css b/aws_practice.client/src/assets/main.css new file mode 100644 index 0000000..36fb845 --- /dev/null +++ b/aws_practice.client/src/assets/main.css @@ -0,0 +1,35 @@ +@import './base.css'; + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; + padding: 3px; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} + +@media (min-width: 1024px) { + body { + display: flex; + place-items: center; + } + + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } +} diff --git a/aws_practice.client/src/components/HelloWorld.vue b/aws_practice.client/src/components/HelloWorld.vue new file mode 100644 index 0000000..1476a13 --- /dev/null +++ b/aws_practice.client/src/components/HelloWorld.vue @@ -0,0 +1,85 @@ + + + + + \ No newline at end of file diff --git a/aws_practice.client/src/components/TheWelcome.vue b/aws_practice.client/src/components/TheWelcome.vue new file mode 100644 index 0000000..68a970a --- /dev/null +++ b/aws_practice.client/src/components/TheWelcome.vue @@ -0,0 +1,95 @@ + + + diff --git a/aws_practice.client/src/components/WelcomeItem.vue b/aws_practice.client/src/components/WelcomeItem.vue new file mode 100644 index 0000000..6d7086a --- /dev/null +++ b/aws_practice.client/src/components/WelcomeItem.vue @@ -0,0 +1,87 @@ + + + diff --git a/aws_practice.client/src/components/icons/IconCommunity.vue b/aws_practice.client/src/components/icons/IconCommunity.vue new file mode 100644 index 0000000..2dc8b05 --- /dev/null +++ b/aws_practice.client/src/components/icons/IconCommunity.vue @@ -0,0 +1,7 @@ + diff --git a/aws_practice.client/src/components/icons/IconDocumentation.vue b/aws_practice.client/src/components/icons/IconDocumentation.vue new file mode 100644 index 0000000..6d4791c --- /dev/null +++ b/aws_practice.client/src/components/icons/IconDocumentation.vue @@ -0,0 +1,7 @@ + diff --git a/aws_practice.client/src/components/icons/IconEcosystem.vue b/aws_practice.client/src/components/icons/IconEcosystem.vue new file mode 100644 index 0000000..c3a4f07 --- /dev/null +++ b/aws_practice.client/src/components/icons/IconEcosystem.vue @@ -0,0 +1,7 @@ + diff --git a/aws_practice.client/src/components/icons/IconSupport.vue b/aws_practice.client/src/components/icons/IconSupport.vue new file mode 100644 index 0000000..7452834 --- /dev/null +++ b/aws_practice.client/src/components/icons/IconSupport.vue @@ -0,0 +1,7 @@ + diff --git a/aws_practice.client/src/components/icons/IconTooling.vue b/aws_practice.client/src/components/icons/IconTooling.vue new file mode 100644 index 0000000..660598d --- /dev/null +++ b/aws_practice.client/src/components/icons/IconTooling.vue @@ -0,0 +1,19 @@ + + diff --git a/aws_practice.client/src/main.js b/aws_practice.client/src/main.js new file mode 100644 index 0000000..0ac3a5f --- /dev/null +++ b/aws_practice.client/src/main.js @@ -0,0 +1,6 @@ +import './assets/main.css' + +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/aws_practice.client/vite.config.js b/aws_practice.client/vite.config.js new file mode 100644 index 0000000..0499df3 --- /dev/null +++ b/aws_practice.client/vite.config.js @@ -0,0 +1,61 @@ +import { fileURLToPath, URL } from 'node:url'; + +import { defineConfig } from 'vite'; +import plugin from '@vitejs/plugin-vue'; +import fs from 'fs'; +import path from 'path'; +import child_process from 'child_process'; +import { env } from 'process'; + +const baseFolder = + env.APPDATA !== undefined && env.APPDATA !== '' + ? `${env.APPDATA}/ASP.NET/https` + : `${env.HOME}/.aspnet/https`; + +const certificateName = "aws_practice.client"; +const certFilePath = path.join(baseFolder, `${certificateName}.pem`); +const keyFilePath = path.join(baseFolder, `${certificateName}.key`); + +if (!fs.existsSync(baseFolder)) { + fs.mkdirSync(baseFolder, { recursive: true }); +} + +if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) { + if (0 !== child_process.spawnSync('dotnet', [ + 'dev-certs', + 'https', + '--export-path', + certFilePath, + '--format', + 'Pem', + '--no-password', + ], { stdio: 'inherit', }).status) { + throw new Error("Could not create certificate."); + } +} + +const target = env.ASPNETCORE_HTTPS_PORT ? `https://localhost:${env.ASPNETCORE_HTTPS_PORT}` : + env.ASPNETCORE_URLS ? env.ASPNETCORE_URLS.split(';')[0] : 'https://localhost:7099'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [plugin()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, + server: { + proxy: { + '^/weatherforecast': { + target, + secure: false + } + }, + port: parseInt(env.DEV_SERVER_PORT || '9387'), + https: { + key: fs.readFileSync(keyFilePath), + cert: fs.readFileSync(certFilePath), + } + } +})