initial commit - code moved to separate repo

This commit is contained in:
Dobromir Popov
2024-02-22 04:19:38 +02:00
commit 560d503219
240 changed files with 105125 additions and 0 deletions

75
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,75 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Chrome Debug",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3003",
"webRoot": "${workspaceFolder}/src",
"runtimeExecutable": "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
},
{
"name": "Run npm nodemon",
"command": "npm run debug ", // > _logs/debug.log
"request": "launch",
"type": "node-terminal",
"preLaunchTask": "killInspector", // <-- Add this line
},
{
// "type": "pwa-node",
// "request": "launch",
// "name": "Next: Node",
// "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
"name": "next dev",
"command": "npm run devNext",
"request": "launch",
"type": "node-terminal"
},
{
// "type": "pwa-node",
// "request": "launch",
// "name": "Next: Node",
// "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
"name": "Run npm next start",
"command": "npm run start",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Run conda npm debug",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}",
"command": "conda activate node && npm run debug",
},
{
"name": "Run conda npm TEST",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}",
"command": "conda activate node && npm run test",
"env": {
"NODE_ENV": "test"
}
},
{
"type": "node",
"request": "attach",
"name": "Attach nodemon",
"processId": "${command:PickProcess}",
"restart": true,
// "protocol": "inspector",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
"<node_internals>/**"
]
}
]
}

124
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,124 @@
{
"diffEditor.codeLens": true,
"editor.tabCompletion": "on",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"html.format.wrapAttributes": "force",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
// "source.organizeImports": true
},
"[dotenv]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default"
},
"previewLimit": 50,
"server": "192.168.0.10",
"port": 3306,
"driver": "MariaDB",
"name": "docker",
"database": "mysql",
"username": "root"
},
{
"mssqlOptions": {
"appName": "SQLTools",
"useUTC": true,
"encrypt": true
},
"previewLimit": 50,
"server": "192.168.0.10",
"port": 1433,
"askForPassword": true,
"driver": "MSSQL",
"name": "mssql.d-popov.com",
"database": "master",
"username": "sa"
},
{
"mysqlOptions": {
"authProtocol": "default"
},
"previewLimit": 50,
"server": "172.160.240.73",
"port": 3306,
"driver": "MariaDB",
"name": "Azure cart jwpw",
"database": "jwpwsofia",
"username": "jwpwsofia"
},
{
"mysqlOptions": {
"authProtocol": "default",
"enableSsl": "Disabled"
},
"previewLimit": 50,
"server": "localhost",
"port": 3306,
"driver": "MariaDB",
"name": "local dev cart",
"database": "cart",
"username": "root",
"password": "7isg3FCqP1e9aSFw"
},
{
"mysqlOptions": {
"authProtocol": "default"
},
"previewLimit": 50,
"server": "jwpw.mysql.database.azure.com",
"port": 3306,
"driver": "MariaDB",
"name": "mysql on Azure",
"database": "mysql",
"username": "popov",
"password": "F7%WZE%@1G&Bjm"
}
],
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"vsmqtt.brokerProfiles": [
{
"name": "Home",
"host": "192.168.0.10",
"port": 1883,
"clientId": "vsmqtt_client"
}
],
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"git-blame.gitWebUrl": "",
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[sql]": {
"editor.defaultFormatter": "cweijan.vscode-mysql-client2"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
}

129
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,129 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Install Dependencies conda test",
"type": "shell",
"command": "source activate node && export NODE_ENV=test && npm install",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run Server conda test",
"type": "shell",
"command": "source activate node && export NODE_ENV=test && node server.js",
"dependsOn": [
"Install Dependencies"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run Server conda test",
"type": "shell",
"command": "source activate node && export NODE_ENV=test && node server.js",
"dependsOn": [
"Install Dependencies"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "killInspector",
"type": "shell",
"command": "FOR /F \"tokens=5\" %p IN ('netstat -ano ^| find \"9229\" ^| find \"LISTENING\"') DO taskkill /PID %p",
"problemMatcher": [],
"windows": {
"command": "FOR /F \"tokens=5\" %p IN ('netstat -ano ^| find \"9229\" ^| find \"LISTENING\"') DO taskkill /F /PID %p",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"linux": {
"command": "lsof -t -i:9229 | xargs -r kill -9"
},
},
{
"label": "Remove node_modules",
"type": "shell",
"command": "Remove-Item -Recurse -Force node_modules",
"problemMatcher": [],
"windows": {
"command": "Remove-Item -Recurse -Force node_modules",
"options": {
"shell": {
"executable": "powershell.exe",
"args": [
"-Command"
]
}
}
},
"linux": {
"command": "rm -rf node_modules"
}
},
{
"label": "Build Docker Image",
"type": "shell",
"command": "docker build -t next-cart-app:dev .",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Docker Compose Up",
"type": "shell",
"command": "docker-compose up --build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Deploy to Remote Server",
"type": "shell",
"command": "rsync",
"args": [
"-avz",
".next/",
"public/",
"package.json",
"package-lock.json",
"server.js",
"${env:REMOTE_USER}@${env:REMOTE_SERVER}:${env:REMOTE_DESTINATION}"
],
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"env": {
"REMOTE_USER": "azureuser", // Replace with your remote username
"REMOTE_SERVER": "172.160.240.73", // Replace with your remote server IP or hostname
"REMOTE_DESTINATION": "/mnt/docker_volumes/pw/app/" // Replace with your destination path on the remote server
}
}
}
]
}