-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
3,209 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"root": true, | ||
"ignorePatterns": ["projects/**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@angular-eslint/recommended", | ||
"plugin:@angular-eslint/template/process-inline-templates" | ||
], | ||
"rules": { | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ | ||
"type": "attribute", | ||
"prefix": "app", | ||
"style": "camelCase" | ||
} | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ | ||
"type": "element", | ||
"prefix": "app", | ||
"style": "kebab-case" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.html"], | ||
"extends": [ | ||
"plugin:@angular-eslint/template/recommended", | ||
"plugin:@angular-eslint/template/accessibility" | ||
], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
ENABLE_CORS=true | ||
|
||
AHB_CONTAINER_NAME='uploaded-files' | ||
AZURE_BLOB_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol='http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;' | ||
AZURE_BLOB_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol='http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;' | ||
FORMAT_VERSION_CONTAINER_NAME=format-versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Pull Request" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "20.13" | ||
cache: "npm" | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Prettier | ||
run: npm run format:check | ||
|
||
- name: Lint frontend | ||
run: npm run ng:lint | ||
|
||
- name: Lint server | ||
run: exit 0 # todo: add stuff | ||
|
||
- name: Test frontend | ||
run: exit 0 # todo: add stuff | ||
|
||
- name: Test server | ||
run: exit 0 # todo: add stuff | ||
|
||
- name: Build frontend | ||
run: npm run ng:build | ||
|
||
- name: Build server | ||
run: npm run server:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ testem.log | |
# System files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.nx/cache | ||
.nx/workspace-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/app/core/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,60 @@ | ||
import { BlobServiceClient, ContainerClient } from "@azure/storage-blob"; | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
import { BlobServiceClient, ContainerClient } from '@azure/storage-blob'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
// Function to create a BlobServiceClient | ||
const createBlobServiceClient = () => { | ||
const azureHost = process.env["AZURE_STORAGE_HOST"] || "http://127.0.0.1"; | ||
const connectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=${azureHost}:10000/devstoreaccount1;`; | ||
return BlobServiceClient.fromConnectionString(connectionString); | ||
const azureHost = process.env['AZURE_STORAGE_HOST'] || 'http://127.0.0.1'; | ||
const connectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=${azureHost}:10000/devstoreaccount1;`; | ||
return BlobServiceClient.fromConnectionString(connectionString); | ||
}; | ||
|
||
// Recursive function to upload files | ||
const uploadFiles = async (folderPath: string, containerClient: ContainerClient) => { | ||
const files = fs.readdirSync(folderPath); | ||
|
||
for (const file of files) { | ||
const filePath = path.join(folderPath, file); | ||
const stat = fs.statSync(filePath); | ||
|
||
if (stat.isDirectory()) { | ||
await uploadFiles(filePath, containerClient); | ||
} else { | ||
const blobName = path.relative(process.argv[2], filePath).replace(/\\/g, "/"); | ||
const blockBlobClient = containerClient.getBlockBlobClient(blobName); | ||
console.log(`Uploading ${filePath} as ${blobName}`); | ||
await blockBlobClient.uploadFile(filePath); | ||
} | ||
const uploadFiles = async ( | ||
folderPath: string, | ||
containerClient: ContainerClient, | ||
) => { | ||
const files = fs.readdirSync(folderPath); | ||
|
||
for (const file of files) { | ||
const filePath = path.join(folderPath, file); | ||
const stat = fs.statSync(filePath); | ||
|
||
if (stat.isDirectory()) { | ||
await uploadFiles(filePath, containerClient); | ||
} else { | ||
const blobName = path | ||
.relative(process.argv[2], filePath) | ||
.replace(/\\/g, '/'); | ||
const blockBlobClient = containerClient.getBlockBlobClient(blobName); | ||
console.log(`Uploading ${filePath} as ${blobName}`); | ||
await blockBlobClient.uploadFile(filePath); | ||
} | ||
} | ||
}; | ||
|
||
// Main function to handle the upload process | ||
const main = async () => { | ||
if (process.argv.length < 3) { | ||
console.log("Usage: node dist/uploadFilesToAzurite.js <folderPath>"); | ||
return; | ||
} | ||
|
||
const folderPath = process.argv[2]; | ||
const containerName = "uploaded-files"; | ||
const blobServiceClient = createBlobServiceClient(); | ||
const containerClient = blobServiceClient.getContainerClient(containerName); | ||
|
||
try { | ||
await containerClient.createIfNotExists(); | ||
console.log(`Starting upload of files from ${folderPath} to container '${containerName}'`); | ||
await uploadFiles(folderPath, containerClient); | ||
console.log("All files uploaded successfully."); | ||
} catch (error) { | ||
console.error("Error uploading files:", error); | ||
} | ||
if (process.argv.length < 3) { | ||
console.log('Usage: node dist/uploadFilesToAzurite.js <folderPath>'); | ||
return; | ||
} | ||
|
||
const folderPath = process.argv[2]; | ||
const containerName = 'uploaded-files'; | ||
const blobServiceClient = createBlobServiceClient(); | ||
const containerClient = blobServiceClient.getContainerClient(containerName); | ||
|
||
try { | ||
await containerClient.createIfNotExists(); | ||
console.log( | ||
`Starting upload of files from ${folderPath} to container '${containerName}'`, | ||
); | ||
await uploadFiles(folderPath, containerClient); | ||
console.log('All files uploaded successfully.'); | ||
} catch (error) { | ||
console.error('Error uploading files:', error); | ||
} | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.