Skip to content

Commit

Permalink
chore: rework using comments
Browse files Browse the repository at this point in the history
>
>
Co-authored-by: KonsumGandalf [email protected]
  • Loading branch information
Persists committed Apr 30, 2024
1 parent f2a5ace commit 9f2689f
Show file tree
Hide file tree
Showing 12 changed files with 8,586 additions and 8,532 deletions.
14 changes: 7 additions & 7 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extends:
- stylelint-config-standard-scss
- stylelint-config-recess-order
- stylelint-config-standard-scss
- stylelint-config-recess-order
rules:
at-rule-empty-line-before: null
scss/dollar-variable-empty-line-before: null
color-function-notation: null
property-no-vendor-prefix: null
custom-property-empty-line-before: null
at-rule-empty-line-before: null
scss/dollar-variable-empty-line-before: null
color-function-notation: null
property-no-vendor-prefix: null
custom-property-empty-line-before: null
2 changes: 1 addition & 1 deletion apps/backend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { validateConfig } from './config/validation';
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['.env'],
envFilePath: ['apps/backend/.env'],
validate: validateConfig,
}),
],
Expand Down
37 changes: 37 additions & 0 deletions apps/backend/src/app/config/classes/environment.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,72 @@ import { IEnvironmentVariables } from '../interfaces/environment.interface';
*/
export class EnvironmentVariables implements IEnvironmentVariables {
/* APP */

/**
* Application port for the backend
*
* @example 3000
*/
@IsDefined()
@IsNumber()
APP_PORT: number;

/**
* Application host for the backend
*
* @example 'localhost'
*/
@IsDefined()
@IsString()
@MinLength(1)
APP_HOST: string;

/**
* Application name for the backend
*
* @example 'backend'
*/
@IsDefined()
@IsString()
@MinLength(1)
APP_NAME: string;

/* DATABASE */

/**
* Postgres database host name
*
* @example 'localhost'
*/
@IsDefined()
@IsString()
@MinLength(1)
POSTGRES_HOST: string;

/**
* Postgres database port
*
* @example 5432
*/
@IsDefined()
@IsNumber()
POSTGRES_PORT: number;

/**
* Postgres database user name
*
* @example 'user'
*/
@IsDefined()
@IsString()
@MinLength(1)
POSTGRES_USER: string;

/**
* Postgres passowrd for the user
*
* @example 'password'
*/
@IsDefined()
@IsString()
@MinLength(1)
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ async function bootstrap() {

const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);

const port = configService.get('app', { infer: true }).port;
await app.listen(port);

Logger.log(`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`);
}

Expand Down
154 changes: 77 additions & 77 deletions apps/frontend/project.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{
"name": "frontend",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"prefix": "app",
"sourceRoot": "apps/frontend/src",
"tags": ["tier:frontend", "type:app"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/frontend",
"index": "apps/frontend/src/index.html",
"main": "apps/frontend/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/frontend/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["apps/frontend/src/favicon.ico", "apps/frontend/src/assets"],
"styles": ["apps/frontend/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "frontend:build:production"
},
"development": {
"buildTarget": "frontend:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "frontend:build"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/frontend/jest.config.ts"
}
}
}
"name": "frontend",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"prefix": "app",
"sourceRoot": "apps/frontend/src",
"tags": ["tier:frontend", "type:app"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/frontend",
"index": "apps/frontend/src/index.html",
"main": "apps/frontend/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/frontend/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["apps/frontend/src/favicon.ico", "apps/frontend/src/assets"],
"styles": ["apps/frontend/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "frontend:build:production"
},
"development": {
"buildTarget": "frontend:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "frontend:build"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/frontend/jest.config.ts"
}
}
}
}
108 changes: 54 additions & 54 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,64 @@ version: '3.8'
name: maintenance-automation-compose

services:
postgres:
image: postgres:alpine
volumes:
- postgres:/var/lib/postgresql/data
restart: unless-stopped
ports:
- '5432:5432'
environment:
POSTGRES_USER: amos
POSTGRES_PASSWORD: amos
POSTGRES_DB: amos
networks:
- db_network
- backend_network
postgres:
image: postgres:alpine
volumes:
- postgres:/var/lib/postgresql/data
restart: unless-stopped
ports:
- '5432:5432'
environment:
POSTGRES_USER: amos
POSTGRES_PASSWORD: amos
POSTGRES_DB: amos
networks:
- db_network
- backend_network

cloudbeaver:
image: dbeaver/cloudbeaver
restart: unless-stopped
ports:
- '8978:8978'
networks:
- db_network
cloudbeaver:
image: dbeaver/cloudbeaver
restart: unless-stopped
ports:
- '8978:8978'
networks:
- db_network

backend:
depends_on:
- postgres
image: ghcr.io/amosproj/amos2024ss01-xcelerator-demo-app-backend
build:
context: .
target: production
dockerfile: apps/backend/Dockerfile
restart: unless-stopped
ports:
- '3000:3000'
networks:
- backend_network
env_file:
- .env
backend:
depends_on:
- postgres
image: ghcr.io/amosproj/amos2024ss01-xcelerator-demo-app-backend
build:
context: .
target: production
dockerfile: apps/backend/Dockerfile
restart: unless-stopped
ports:
- '3000:3000'
networks:
- backend_network
env_file:
- apps/backend/.env

frontend:
depends_on:
- backend
image: ghcr.io/amosproj/amos2024ss01-xcelerator-demo-app-frontend
build:
context: .
target: production
dockerfile: apps/frontend/Dockerfile
restart: unless-stopped
ports:
- '4200:80'
networks:
- backend_network
frontend:
depends_on:
- backend
image: ghcr.io/amosproj/amos2024ss01-xcelerator-demo-app-frontend
build:
context: .
target: production
dockerfile: apps/frontend/Dockerfile
restart: unless-stopped
ports:
- '4200:80'
networks:
- backend_network

networks:
backend_network:
driver: bridge
db_network:
driver: bridge
backend_network:
driver: bridge
db_network:
driver: bridge

volumes:
postgres:
postgres:
Loading

0 comments on commit 9f2689f

Please sign in to comment.