From 71d5a4b7de1f858a570e620ca4d32f6265a213af Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Sun, 7 Jan 2024 14:03:36 +0100 Subject: [PATCH 1/3] chore(dx): Removed WebStorm workspace from git --- infra/.gitignore | 319 ++++++++++++++++++++++++++++++++--- infra/.idea/workspace.xml | 137 --------------- infra/apps/uier/src/index.ts | 3 + 3 files changed, 298 insertions(+), 161 deletions(-) delete mode 100644 infra/.idea/workspace.xml diff --git a/infra/.gitignore b/infra/.gitignore index 96fab4fed3..9b168cc90f 100644 --- a/infra/.gitignore +++ b/infra/.gitignore @@ -1,38 +1,309 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# Created by https://www.toptal.com/developers/gitignore/api/webstorm,node,visualstudiocode,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=webstorm,node,visualstudiocode,macos -# Dependencies -node_modules -.pnp -.pnp.js +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript -# Local env files +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files .env -.env.local .env.development.local .env.test.local .env.production.local +.env.local -# Testing -coverage +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp -# Turbo -.turbo +# Docusaurus cache and generated files +.docusaurus -# Vercel -.vercel +# Serverless directories +.serverless/ -# Build Outputs -.next/ +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### WebStorm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ out/ -build -dist +# mpeltonen/sbt-idea plugin +.idea_modules/ -# Debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* +# JIRA plugin +atlassian-ide-plugin.xml -# Misc -.DS_Store -*.pem +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### WebStorm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +# End of https://www.toptal.com/developers/gitignore/api/webstorm,node,visualstudiocode,macos \ No newline at end of file diff --git a/infra/.idea/workspace.xml b/infra/.idea/workspace.xml deleted file mode 100644 index 7f2d60d579..0000000000 --- a/infra/.idea/workspace.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1703777968392 - - - - - - \ No newline at end of file diff --git a/infra/apps/uier/src/index.ts b/infra/apps/uier/src/index.ts index 6e4d02be79..091ba5e6af 100644 --- a/infra/apps/uier/src/index.ts +++ b/infra/apps/uier/src/index.ts @@ -6,6 +6,9 @@ import { getStack } from '@pulumi/pulumi'; const up = async () => { const stack = getStack(); + // TODO: Create Static files storage + // TODO: Create CDN for status files storage + const app = nextJsApp('uier', 'uier'); // Configure domain name From 43fd1c00424f35ad2c4b34130a9fa371acd9b2d8 Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Tue, 9 Jan 2024 10:37:28 +0100 Subject: [PATCH 2/3] feat(infra): Added uier static files storage --- infra/.idea/infra.iml | 12 ---------- infra/.idea/modules.xml | 8 ------- infra/.idea/vcs.xml | 6 ----- infra/apps/cloud-primary/src/index.ts | 5 ++-- infra/apps/uier/Pulumi.next.yaml | 2 ++ infra/apps/uier/Pulumi.production.yaml | 2 ++ infra/apps/uier/src/index.ts | 26 ++++++++++++++++++++ infra/infra.code-workspace | 33 ++++++++++++++++++++++++++ 8 files changed, 65 insertions(+), 29 deletions(-) delete mode 100644 infra/.idea/infra.iml delete mode 100644 infra/.idea/modules.xml delete mode 100644 infra/.idea/vcs.xml create mode 100644 infra/infra.code-workspace diff --git a/infra/.idea/infra.iml b/infra/.idea/infra.iml deleted file mode 100644 index 24643cc374..0000000000 --- a/infra/.idea/infra.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/infra/.idea/modules.xml b/infra/.idea/modules.xml deleted file mode 100644 index a785a5366c..0000000000 --- a/infra/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/infra/.idea/vcs.xml b/infra/.idea/vcs.xml deleted file mode 100644 index 6c0b863585..0000000000 --- a/infra/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/infra/apps/cloud-primary/src/index.ts b/infra/apps/cloud-primary/src/index.ts index 2af2f437cf..aab68c8dea 100644 --- a/infra/apps/cloud-primary/src/index.ts +++ b/infra/apps/cloud-primary/src/index.ts @@ -53,14 +53,13 @@ const up = async () => { const shouldProtect = stack === 'production'; const domainName = `${config.require('domain')}`; - const resourceGroupName = `signalco-cloud-${stack}`; const signalrPrefix = 'sr'; const storagePrefix = 'store'; const keyvaultPrefix = 'kv'; const currentStack = new StackReference(`signalco/${getProject()}/${getStack()}`); - const resourceGroup = new ResourceGroup(resourceGroupName); + const resourceGroup = new ResourceGroup(`signalco-cloud-${stack}`); const corsDomains = [`app.${domainName}`, `www.${domainName}`, domainName]; const signalr = createSignalR(resourceGroup, signalrPrefix, corsDomains, stack === 'production' ? 'standard1' : 'free', false); @@ -157,7 +156,7 @@ const up = async () => { const registry = getContainerRegistry(resourceGroupSharedName, containerRegistryName); const appRb = createRemoteBrowser(resourceGroup, 'rb', registry, logWorkspace, false); - // Create general storage and prepare tables + // Create general storage const storage = createStorageAccount(resourceGroup, storagePrefix, shouldProtect); // Create AWS SES service diff --git a/infra/apps/uier/Pulumi.next.yaml b/infra/apps/uier/Pulumi.next.yaml index 8da0b9b45f..35c65a35e7 100644 --- a/infra/apps/uier/Pulumi.next.yaml +++ b/infra/apps/uier/Pulumi.next.yaml @@ -1,4 +1,6 @@ config: + azure-native:location: westeurope + azure-native:subscriptionId: d22db5bd-ca9a-447c-9b1b-dc56aca401d7 cloudflare:apiToken: secure: AAABAAqPzyAV9mvmavpxCxB+Ws+snM4JK8mNiAxa+WqmzniW5gNmJpHXGgXZI69SkL251Lhhrp43BUrvHnTEbAFf3lG8/Wsl uier:zoneid: diff --git a/infra/apps/uier/Pulumi.production.yaml b/infra/apps/uier/Pulumi.production.yaml index 8c7bf97f11..16410439b6 100644 --- a/infra/apps/uier/Pulumi.production.yaml +++ b/infra/apps/uier/Pulumi.production.yaml @@ -1,4 +1,6 @@ config: + azure-native:location: westeurope + azure-native:subscriptionId: d22db5bd-ca9a-447c-9b1b-dc56aca401d7 cloudflare:apiToken: secure: AAABACGEfMwr2aNFBpAz+WdsfG/AgG31Ktvpe0KVGFCpoiCN8wjhe7NJYY4NJT3o/M+q8x85EOwn3Q9CfljxdPEUq4SPuXxo uier:zoneid: diff --git a/infra/apps/uier/src/index.ts b/infra/apps/uier/src/index.ts index 091ba5e6af..285fc3ca12 100644 --- a/infra/apps/uier/src/index.ts +++ b/infra/apps/uier/src/index.ts @@ -2,12 +2,38 @@ import { nextJsApp } from '@infra/pulumi/vercel'; import { dnsRecord } from '@infra/pulumi/cloudflare'; import { ProjectDomain } from '@pulumiverse/vercel'; import { getStack } from '@pulumi/pulumi'; +import { ResourceGroup } from '@pulumi/azure-native/resources/index.js'; +import { createStorageAccount } from '@infra/pulumi/azure'; +import { Profile, Endpoint, SkuName } from '@pulumi/azure-native/cdn/index.js'; const up = async () => { const stack = getStack(); + const shouldProtect = stack === 'production'; + + const resourceGroup = new ResourceGroup(`uier-${stack}`); // TODO: Create Static files storage + const staticFilesStorage = createStorageAccount( + resourceGroup, + 'static', + shouldProtect, + ); + // TODO: Create CDN for status files storage + const cdnProfile = new Profile('uier-staticcndprofile', { + resourceGroupName: resourceGroup.name, + sku: { + name: SkuName.Standard_Microsoft, + }, + profileName: 'uier-staticFiles-cdn', + }); + // new Endpoint('uier-staticFiles', { + // resourceGroupName: resourceGroup.name, + // profileName: cdnProfile.name, + // origins: [ + + // ], + // }); const app = nextJsApp('uier', 'uier'); diff --git a/infra/infra.code-workspace b/infra/infra.code-workspace new file mode 100644 index 0000000000..a6a4d51806 --- /dev/null +++ b/infra/infra.code-workspace @@ -0,0 +1,33 @@ +{ + "folders": [ + { + "name": "✨ infra-monorepo", + "path": "." + }, + { + "name": "☁️ Cloud Primary", + "path": "apps/cloud-primary" + }, + { + "name": "☁️ Remote Browser", + "path": "apps/remote-browser" + }, + { + "name": "☁️ uier", + "path": "apps/uier" + }, + { + "name": "📦 @infra/pulumi", + "path": "packages/pulumi" + }, + { + "name": "⚙️ @infra/eslint-config", + "path": "packages/eslint-config" + }, + { + "name": "⚙️ @infra/typescript-config", + "path": "packages/typescript-config" + }, + ], + "settings": {} +} \ No newline at end of file From 9b0accf5e91f60caec05f91f2f9e1dad7f07ec80 Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Sat, 16 Nov 2024 23:01:47 +0100 Subject: [PATCH 3/3] Update pnpm-lock.yaml --- infra/pnpm-lock.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/infra/pnpm-lock.yaml b/infra/pnpm-lock.yaml index 687fa72d8f..771436c159 100644 --- a/infra/pnpm-lock.yaml +++ b/infra/pnpm-lock.yaml @@ -191,9 +191,6 @@ importers: '@pulumi/command': specifier: 1.0.1 version: 1.0.1(ts-node@7.0.1)(typescript@5.6.3) - '@pulumi/docker': - specifier: 4.5.7 - version: 4.5.7(ts-node@7.0.1)(typescript@5.6.3) '@pulumi/pulumi': specifier: 3.139.0 version: 3.139.0(ts-node@7.0.1)(typescript@5.6.3)