├── apps ├── .gitkeep ├── express-api │ ├── src │ │ ├── app │ │ │ └── .gitkeep │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.ts │ │ │ └── environment.prod.ts │ │ └── main.ts │ ├── .eslintrc.json │ ├── .local.env │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── tsconfig.json │ └── jest.config.js ├── myapp │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── test-setup.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.scss │ │ ├── favicon.ico │ │ ├── app │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.scss │ │ │ └── app.component.html │ │ ├── index.html │ │ ├── main.ts │ │ └── polyfills.ts │ ├── tsconfig.editor.json │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── tslint.json │ ├── tsconfig.json │ ├── jest.config.js │ └── .browserslistrc ├── nest-api │ ├── src │ │ ├── app │ │ │ ├── .gitkeep │ │ │ ├── app.service.ts │ │ │ ├── app.module.ts │ │ │ ├── app.controller.ts │ │ │ ├── app.service.spec.ts │ │ │ └── app.controller.spec.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.ts │ │ │ └── environment.prod.ts │ │ └── main.ts │ ├── .eslintrc.json │ ├── .local.env │ ├── tsconfig.spec.json │ ├── tsconfig.json │ ├── tsconfig.app.json │ └── jest.config.js ├── react-app │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── polyfills.ts │ │ ├── main.tsx │ │ ├── index.html │ │ └── app │ │ │ ├── star.svg │ │ │ ├── app.spec.tsx │ │ │ ├── logo.svg │ │ │ └── app.tsx │ ├── .babelrc │ ├── babel-jest.config.json │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── jest.config.js │ ├── tsconfig.spec.json │ ├── .browserslistrc │ └── .eslintrc.json ├── myapp-e2e │ ├── src │ │ ├── support │ │ │ ├── app.po.ts │ │ │ ├── index.ts │ │ │ └── commands.ts │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── app.spec.ts │ │ └── plugins │ │ │ └── index.js │ ├── tslint.json │ ├── tsconfig.json │ ├── tsconfig.e2e.json │ └── cypress.json └── react-app-e2e │ ├── src │ ├── support │ │ ├── app.po.ts │ │ ├── index.ts │ │ └── commands.ts │ ├── fixtures │ │ └── example.json │ ├── integration │ │ └── app.spec.ts │ └── plugins │ │ └── index.js │ ├── tsconfig.json │ ├── tsconfig.e2e.json │ ├── .eslintrc.json │ └── cypress.json ├── libs └── .gitkeep ├── dev-stack ├── traefik │ ├── acme.json │ ├── Dockerfile │ ├── traefik.config.toml │ └── traefik.toml ├── .gitignore ├── README.md ├── certs │ └── .gitignore ├── database │ └── initdb.d │ │ └── 0-create-auth-api-database.sql ├── minio │ └── Dockerfile ├── scripts │ ├── get-ip.sh │ └── manage-hosts.sh ├── mkdocs │ └── Dockerfile ├── .env ├── Makefile └── docker-compose.yml ├── tools ├── schematics │ └── .gitkeep └── tsconfig.tools.json ├── docs └── index.md ├── .prettierrc ├── babel.config.json ├── .prettierignore ├── jest.preset.js ├── .vscode └── extensions.json ├── jest.config.js ├── .editorconfig ├── tsconfig.base.json ├── .gitignore ├── nx.json ├── .eslintrc.json ├── mkdocs.yml ├── tslint.json ├── README.md ├── package.json └── workspace.json /apps/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dev-stack/traefik/acme.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/schematics/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/express-api/src/app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/myapp/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/nest-api/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dev-stack/.gitignore: -------------------------------------------------------------------------------- 1 | .data 2 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Hello world 2 | -------------------------------------------------------------------------------- /apps/express-api/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/react-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dev-stack/README.md: -------------------------------------------------------------------------------- 1 | # Dev-Stack 2 | -------------------------------------------------------------------------------- /dev-stack/certs/.gitignore: -------------------------------------------------------------------------------- 1 | *.pem 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /apps/myapp/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | export const getGreeting = () => cy.get('h1'); 2 | -------------------------------------------------------------------------------- /dev-stack/database/initdb.d/0-create-auth-api-database.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE auth_db; 2 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | export const getGreeting = () => cy.get('h1'); 2 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@nrwl/web/babel"], 3 | "babelrcRoots": ["*"] 4 | } 5 | -------------------------------------------------------------------------------- /dev-stack/minio/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM minio/minio 2 | 3 | ENTRYPOINT ["minio", "server", "/export"] 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | -------------------------------------------------------------------------------- /jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nrwl/jest/preset'); 2 | 3 | module.exports = { ...nxPreset }; 4 | -------------------------------------------------------------------------------- /apps/express-api/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/myapp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/myapp/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /apps/nest-api/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "rules": {} } 2 | -------------------------------------------------------------------------------- /apps/nest-api/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/express-api/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "rules": {} } 2 | -------------------------------------------------------------------------------- /apps/express-api/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/nest-api/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/react-app/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/myapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nightbr/full-https-development-environment/HEAD/apps/myapp/src/favicon.ico -------------------------------------------------------------------------------- /apps/react-app/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@nrwl/react/babel", "@emotion/babel-preset-css-prop"], 3 | "plugins": [] 4 | } 5 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /apps/react-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nightbr/full-https-development-environment/HEAD/apps/react-app/src/favicon.ico -------------------------------------------------------------------------------- /apps/myapp-e2e/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "linterOptions": { "exclude": ["!**/*"] }, 4 | "rules": {} 5 | } 6 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /dev-stack/traefik/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM traefik:2.3 2 | 3 | COPY traefik.toml acme.json traefik.config.toml / 4 | 5 | RUN chmod 600 /acme.json 6 | -------------------------------------------------------------------------------- /apps/myapp/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["**/*.ts"], 4 | "compilerOptions": { 5 | "types": ["jest", "node"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/nest-api/.local.env: -------------------------------------------------------------------------------- 1 | PORT=3334 2 | HOSTNAME=dev.local 3 | SSL=true 4 | SSL_KEY_PATH="../../../dev-stack/certs/local-key.pem" 5 | SSL_CERT_PATH="../../../dev-stack/certs/local-cert.pem" 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.vscode-typescript-tslint-plugin", 4 | "esbenp.prettier-vscode", 5 | "firsttris.vscode-jest-runner" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/express-api/.local.env: -------------------------------------------------------------------------------- 1 | PORT=3333 2 | HOSTNAME=dev.local 3 | SSL=true 4 | SSL_KEY_PATH="../../../dev-stack/certs/local-key.pem" 5 | SSL_CERT_PATH="../../../dev-stack/certs/local-cert.pem" 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | projects: [ 3 | '/apps/myapp', 4 | '/apps/react-app', 5 | '/apps/express-api', 6 | '/apps/nest-api', 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /apps/myapp/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts", "src/polyfills.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /apps/myapp-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.e2e.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apps/react-app-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.e2e.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | 3 | @Injectable() 4 | export class AppService { 5 | getData(): { message: string } { 6 | return { message: 'Welcome to nest-api!' }; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /dev-stack/scripts/get-ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get host IP address 4 | 5 | if [ "$(uname)" = "Darwin" ];then 6 | ifconfig en0 | grep "inet "| cut -d ' ' -f 2 7 | else 8 | ip route get 1.2.3.4 | awk '{print $7}' 9 | fi 10 | -------------------------------------------------------------------------------- /dev-stack/traefik/traefik.config.toml: -------------------------------------------------------------------------------- 1 | [http.middlewares] 2 | [http.middlewares.redirect.redirectscheme] 3 | scheme = "https" 4 | 5 | [tls] 6 | [[tls.certificates]] 7 | certFile = "/etc/certs/local-cert.pem" 8 | keyFile = "/etc/certs/local-key.pem" 9 | -------------------------------------------------------------------------------- /apps/express-api/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node", "express"] 6 | }, 7 | "exclude": ["**/*.spec.ts"], 8 | "include": ["**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/nest-api/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/react-app/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Polyfill stable language features. These imports will be optimized by `@babel/preset-env`. 3 | * 4 | * See: https://github.com/zloirock/core-js#babel 5 | */ 6 | import 'core-js/stable'; 7 | import 'regenerator-runtime/runtime'; 8 | -------------------------------------------------------------------------------- /dev-stack/mkdocs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM squidfunk/mkdocs-material 2 | # see https://github.com/squidfunk/mkdocs-material/blob/master/Dockerfile 3 | 4 | ## Install plugin https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin 5 | RUN pip install mkdocs-awesome-pages-plugin 6 | -------------------------------------------------------------------------------- /apps/express-api/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/react-app/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // When building for production, this file is replaced with `environment.prod.ts`. 3 | 4 | export const environment = { 5 | production: false, 6 | }; 7 | -------------------------------------------------------------------------------- /apps/express-api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /apps/nest-api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /apps/myapp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'myorg-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'], 7 | }) 8 | export class AppComponent { 9 | title = 'myapp'; 10 | } 11 | -------------------------------------------------------------------------------- /apps/myapp-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc", 6 | "allowJs": true, 7 | "types": ["cypress", "node"] 8 | }, 9 | "include": ["src/**/*.ts", "src/**/*.js"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/react-app/babel-jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | } 9 | } 10 | ], 11 | "@babel/preset-typescript", 12 | "@babel/preset-react" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["node"] 9 | }, 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /apps/myapp/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/react-app-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc", 6 | "allowJs": true, 7 | "types": ["cypress", "node"] 8 | }, 9 | "include": ["src/**/*.ts", "src/**/*.js"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/myapp/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "myorg", "camelCase"], 5 | "component-selector": [true, "element", "myorg", "kebab-case"] 6 | }, 7 | "linterOptions": { 8 | "exclude": ["!**/*"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /apps/nest-api/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node"], 6 | "emitDecoratorMetadata": true, 7 | "target": "es2015" 8 | }, 9 | "exclude": ["**/*.spec.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | 3 | import { AppController } from './app.controller'; 4 | import { AppService } from './app.service'; 5 | 6 | @Module({ 7 | imports: [], 8 | controllers: [AppController], 9 | providers: [AppService], 10 | }) 11 | export class AppModule {} 12 | -------------------------------------------------------------------------------- /apps/myapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | }, 12 | { 13 | "path": "./tsconfig.editor.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller, Get } from '@nestjs/common'; 2 | 3 | import { AppService } from './app.service'; 4 | 5 | @Controller() 6 | export class AppController { 7 | constructor(private readonly appService: AppService) {} 8 | 9 | @Get() 10 | getData() { 11 | return this.appService.getData(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apps/react-app-e2e/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["src/plugins/index.js"], 7 | "rules": { 8 | "@typescript-eslint/no-var-requires": "off", 9 | "no-undef": "off" 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /apps/react-app/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | import { BrowserRouter } from 'react-router-dom'; 5 | 6 | import App from './app/app'; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | 12 | 13 | , 14 | document.getElementById('root') 15 | ); 16 | -------------------------------------------------------------------------------- /apps/myapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Myapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /apps/nest-api/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'nest-api', 3 | preset: '../../jest.preset.js', 4 | globals: { 5 | 'ts-jest': { 6 | tsConfig: '/tsconfig.spec.json', 7 | }, 8 | }, 9 | transform: { 10 | '^.+\\.[tj]s$': 'ts-jest', 11 | }, 12 | moduleFileExtensions: ['ts', 'js', 'html'], 13 | coverageDirectory: '../../coverage/apps/nest-api', 14 | }; 15 | -------------------------------------------------------------------------------- /apps/react-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ReactApp 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /apps/express-api/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'express-api', 3 | preset: '../../jest.preset.js', 4 | globals: { 5 | 'ts-jest': { 6 | tsConfig: '/tsconfig.spec.json', 7 | }, 8 | }, 9 | transform: { 10 | '^.+\\.[tj]s$': 'ts-jest', 11 | }, 12 | moduleFileExtensions: ['ts', 'js', 'html'], 13 | coverageDirectory: '../../coverage/apps/express-api', 14 | }; 15 | -------------------------------------------------------------------------------- /apps/react-app/src/app/star.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /apps/react-app/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": [ 8 | "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", 9 | "../../node_modules/@nrwl/react/typings/image.d.ts" 10 | ], 11 | "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], 12 | "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] 13 | } 14 | -------------------------------------------------------------------------------- /apps/react-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "jsx": "react", 5 | "allowJs": true, 6 | "esModuleInterop": true, 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "files": [], 10 | "include": [], 11 | "references": [ 12 | { 13 | "path": "./tsconfig.app.json" 14 | }, 15 | { 16 | "path": "./tsconfig.spec.json" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /apps/myapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /apps/react-app/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'react-app', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', 6 | '^.+\\.[tj]sx?$': [ 7 | 'babel-jest', 8 | { cwd: __dirname, configFile: './babel-jest.config.json' }, 9 | ], 10 | }, 11 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 12 | coverageDirectory: '../../coverage/apps/react-app', 13 | }; 14 | -------------------------------------------------------------------------------- /apps/myapp-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": ".", 3 | "fixturesFolder": "./src/fixtures", 4 | "integrationFolder": "./src/integration", 5 | "modifyObstructiveCode": false, 6 | "pluginsFile": "./src/plugins/index", 7 | "supportFile": "./src/support/index.ts", 8 | "video": true, 9 | "videosFolder": "../../dist/cypress/apps/myapp-e2e/videos", 10 | "screenshotsFolder": "../../dist/cypress/apps/myapp-e2e/screenshots", 11 | "chromeWebSecurity": false 12 | } 13 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('myapp', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | // Custom command example, see `../support/commands.ts` file 8 | cy.login('my-email@something.com', 'myPassword'); 9 | 10 | // Function helper example, see `../support/app.po.ts` file 11 | getGreeting().contains('Welcome to myapp!'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/react-app-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": ".", 3 | "fixturesFolder": "./src/fixtures", 4 | "integrationFolder": "./src/integration", 5 | "modifyObstructiveCode": false, 6 | "pluginsFile": "./src/plugins/index", 7 | "supportFile": "./src/support/index.ts", 8 | "video": true, 9 | "videosFolder": "../../dist/cypress/apps/react-app-e2e/videos", 10 | "screenshotsFolder": "../../dist/cypress/apps/react-app-e2e/screenshots", 11 | "chromeWebSecurity": false 12 | } 13 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('react-app', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | // Custom command example, see `../support/commands.ts` file 8 | cy.login('my-email@something.com', 'myPassword'); 9 | 10 | // Function helper example, see `../support/app.po.ts` file 11 | getGreeting().contains('Welcome to react-app!'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/myapp/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { RouterModule } from '@angular/router'; 6 | 7 | @NgModule({ 8 | declarations: [AppComponent], 9 | imports: [ 10 | BrowserModule, 11 | RouterModule.forRoot([], { initialNavigation: 'enabled' }), 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent], 15 | }) 16 | export class AppModule {} 17 | -------------------------------------------------------------------------------- /apps/react-app/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ], 15 | "files": [ 16 | "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", 17 | "../../node_modules/@nrwl/react/typings/image.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2015", 12 | "module": "esnext", 13 | "typeRoots": ["node_modules/@types"], 14 | "lib": ["es2017", "dom"], 15 | "skipLibCheck": true, 16 | "skipDefaultLibCheck": true, 17 | "baseUrl": ".", 18 | "paths": {} 19 | }, 20 | "exclude": ["node_modules", "tmp"] 21 | } 22 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/app.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test } from '@nestjs/testing'; 2 | 3 | import { AppService } from './app.service'; 4 | 5 | describe('AppService', () => { 6 | let service: AppService; 7 | 8 | beforeAll(async () => { 9 | const app = await Test.createTestingModule({ 10 | providers: [AppService], 11 | }).compile(); 12 | 13 | service = app.get(AppService); 14 | }); 15 | 16 | describe('getData', () => { 17 | it('should return "Welcome to nest-api!"', () => { 18 | expect(service.getData()).toEqual({ message: 'Welcome to nest-api!' }); 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /apps/react-app/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by: 2 | # 1. autoprefixer to adjust CSS to support the below specified browsers 3 | # 2. babel preset-env to adjust included polyfills 4 | # 5 | # For additional information regarding the format and rule options, please see: 6 | # https://github.com/browserslist/browserslist#queries 7 | # 8 | # If you need to support different browsers in production, you may tweak the list below. 9 | 10 | last 1 Chrome version 11 | last 1 Firefox version 12 | last 2 Edge major versions 13 | last 2 Safari major version 14 | last 2 iOS major versions 15 | Firefox ESR 16 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/react-app/src/app/app.spec.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | 4 | import { BrowserRouter } from 'react-router-dom'; 5 | 6 | import App from './app'; 7 | 8 | describe('App', () => { 9 | it('should render successfully', () => { 10 | const { baseElement } = render( 11 | 12 | 13 | 14 | ); 15 | 16 | expect(baseElement).toBeTruthy(); 17 | }); 18 | 19 | it('should have a greeting as the title', () => { 20 | const { getByText } = render( 21 | 22 | 23 | 24 | ); 25 | 26 | expect(getByText('Welcome to react-app!')).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /apps/myapp/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /apps/nest-api/src/app/app.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | 3 | import { AppController } from './app.controller'; 4 | import { AppService } from './app.service'; 5 | 6 | describe('AppController', () => { 7 | let app: TestingModule; 8 | 9 | beforeAll(async () => { 10 | app = await Test.createTestingModule({ 11 | controllers: [AppController], 12 | providers: [AppService], 13 | }).compile(); 14 | }); 15 | 16 | describe('getData', () => { 17 | it('should return "Welcome to nest-api!"', () => { 18 | const appController = app.get(AppController); 19 | expect(appController.getData()).toEqual({ 20 | message: 'Welcome to nest-api!', 21 | }); 22 | }); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /apps/myapp/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'myapp', 3 | preset: '../../jest.preset.js', 4 | setupFilesAfterEnv: ['/src/test-setup.ts'], 5 | globals: { 6 | 'ts-jest': { 7 | tsConfig: '/tsconfig.spec.json', 8 | stringifyContentPathRegex: '\\.(html|svg)$', 9 | astTransformers: { 10 | before: [ 11 | 'jest-preset-angular/build/InlineFilesTransformer', 12 | 'jest-preset-angular/build/StripStylesTransformer', 13 | ], 14 | }, 15 | }, 16 | }, 17 | coverageDirectory: '../../coverage/apps/myapp', 18 | snapshotSerializers: [ 19 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', 20 | 'jest-preset-angular/build/AngularSnapshotSerializer.js', 21 | 'jest-preset-angular/build/HTMLCommentSerializer.js', 22 | ], 23 | }; 24 | -------------------------------------------------------------------------------- /dev-stack/traefik/traefik.toml: -------------------------------------------------------------------------------- 1 | # defaultEntryPoints must be at the top because it should not be in any table below 2 | defaultEntryPoints = ["http", "https"] 3 | 4 | [log] 5 | level = "DEBUG" #DEBUG, INFO, WARN, ERROR, FATAL, PANIC 6 | format = "common" 7 | 8 | [api] 9 | dashboard = true 10 | insecure = true 11 | 12 | [entryPoints.http] 13 | address = ":80" 14 | [entryPoints.http.http.redirections.entryPoint] 15 | to = "https" 16 | scheme = "https" 17 | 18 | [entryPoints.https] 19 | address = ":443" 20 | 21 | 22 | [providers] 23 | [providers.file] 24 | filename = "/etc/traefik/traefik.config.toml" 25 | watch = true 26 | 27 | [providers.docker] 28 | endpoint = "unix:///var/run/docker.sock" 29 | watch = true 30 | exposedbydefault = false 31 | [docker.tls] 32 | cert = "/etc/certs/local-cert.pem" 33 | key = "/etc/certs/local-key.pem" 34 | -------------------------------------------------------------------------------- /apps/myapp/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line. 18 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 19 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); 15 | 16 | module.exports = (on, config) => { 17 | // `on` is used to hook into various events Cypress emits 18 | // `config` is the resolved Cypress config 19 | 20 | // Preprocess Typescript file using Nx helper 21 | on('file:preprocessor', preprocessTypescript(config)); 22 | }; 23 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); 15 | 16 | module.exports = (on, config) => { 17 | // `on` is used to hook into various events Cypress emits 18 | // `config` is the resolved Cypress config 19 | 20 | // Preprocess Typescript file using Nx helper 21 | on('file:preprocessor', preprocessTypescript(config)); 22 | }; 23 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "myorg", 3 | "affected": { 4 | "defaultBase": "master" 5 | }, 6 | "implicitDependencies": { 7 | "workspace.json": "*", 8 | "package.json": { 9 | "dependencies": "*", 10 | "devDependencies": "*" 11 | }, 12 | "tsconfig.base.json": "*", 13 | "tslint.json": "*", 14 | ".eslintrc.json": "*", 15 | "nx.json": "*" 16 | }, 17 | "tasksRunnerOptions": { 18 | "default": { 19 | "runner": "@nrwl/workspace/tasks-runners/default", 20 | "options": { 21 | "cacheableOperations": ["build", "lint", "test", "e2e"] 22 | } 23 | } 24 | }, 25 | "projects": { 26 | "myapp": { 27 | "tags": [] 28 | }, 29 | "myapp-e2e": { 30 | "tags": [], 31 | "implicitDependencies": ["myapp"] 32 | }, 33 | "react-app": { 34 | "tags": [] 35 | }, 36 | "react-app-e2e": { 37 | "tags": [], 38 | "implicitDependencies": ["react-app"] 39 | }, 40 | "express-api": { 41 | "tags": [] 42 | }, 43 | "nest-api": { 44 | "tags": [] 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /apps/myapp-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | 11 | declare namespace Cypress { 12 | interface Chainable { 13 | login(email: string, password: string): void; 14 | } 15 | } 16 | // 17 | // -- This is a parent command -- 18 | Cypress.Commands.add('login', (email, password) => { 19 | console.log('Custom command example: Login', email, password); 20 | }); 21 | // 22 | // -- This is a child command -- 23 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 24 | // 25 | // 26 | // -- This is a dual command -- 27 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 28 | // 29 | // 30 | // -- This will overwrite an existing command -- 31 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 32 | -------------------------------------------------------------------------------- /apps/myapp/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import { RouterTestingModule } from '@angular/router/testing'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [RouterTestingModule], 9 | declarations: [AppComponent], 10 | }).compileComponents(); 11 | }); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'myapp'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.componentInstance; 22 | expect(app.title).toEqual('myapp'); 23 | }); 24 | 25 | it('should render title', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain( 30 | 'Welcome to myapp!' 31 | ); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /apps/nest-api/src/main.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is not a production server yet! 3 | * This is only a minimal backend to get started. 4 | */ 5 | 6 | import { Logger } from '@nestjs/common'; 7 | import { NestFactory } from '@nestjs/core'; 8 | import * as fs from 'fs'; 9 | import * as path from 'path'; 10 | 11 | import { AppModule } from './app/app.module'; 12 | 13 | async function bootstrap() { 14 | const ssl = process.env.SSL === 'true' ? true : false; 15 | let httpsOptions = null; 16 | if (ssl) { 17 | const keyPath = process.env.SSL_KEY_PATH || ''; 18 | const certPath = process.env.SSL_CERT_PATH || ''; 19 | httpsOptions = { 20 | key: fs.readFileSync(path.join(__dirname, keyPath)), 21 | cert: fs.readFileSync(path.join(__dirname, certPath)), 22 | }; 23 | } 24 | const app = await NestFactory.create(AppModule, { httpsOptions }); 25 | const port = Number(process.env.PORT) || 3333; 26 | const hostname = process.env.HOSTNAME || 'localhost'; 27 | await app.listen(port, hostname, () => { 28 | const address = 29 | 'http' + (ssl ? 's' : '') + '://' + hostname + ':' + port + '/'; 30 | Logger.log('Listening at ' + address); 31 | }); 32 | } 33 | 34 | bootstrap(); 35 | -------------------------------------------------------------------------------- /apps/express-api/src/main.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is not a production server yet! 3 | * This is only a minimal backend to get started. 4 | */ 5 | 6 | import * as express from 'express'; 7 | import * as https from 'https'; 8 | import * as fs from 'fs'; 9 | import * as path from 'path'; 10 | 11 | const app = express(); 12 | 13 | app.get('/api', (req, res) => { 14 | res.send({ message: 'Welcome to express-api!' }); 15 | }); 16 | 17 | const port = Number(process.env.PORT) || 3333; 18 | const hostname = process.env.HOSTNAME || 'localhost'; 19 | const ssl = process.env.SSL === 'true' ? true : false; 20 | let server = null; 21 | 22 | if (ssl) { 23 | const keyPath = process.env.SSL_KEY_PATH || ''; 24 | const certPath = process.env.SSL_CERT_PATH || ''; 25 | const httpsOptions = { 26 | key: fs.readFileSync(path.join(__dirname, keyPath)), 27 | cert: fs.readFileSync(path.join(__dirname, certPath)), 28 | }; 29 | server = https.createServer(httpsOptions, app).listen(port, () => { 30 | console.log(`Listening at https://${hostname}:${port}/api`); 31 | }); 32 | } else { 33 | server = app.listen(port, () => { 34 | console.log(`Listening at http://${hostname}:${port}/api`); 35 | }); 36 | } 37 | 38 | server.on('error', console.error); 39 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 2018, 6 | "sourceType": "module", 7 | "project": "./tsconfig.*?.json" 8 | }, 9 | "ignorePatterns": ["**/*"], 10 | "plugins": ["@typescript-eslint", "@nrwl/nx"], 11 | "extends": [ 12 | "eslint:recommended", 13 | "plugin:@typescript-eslint/eslint-recommended", 14 | "plugin:@typescript-eslint/recommended", 15 | "prettier", 16 | "prettier/@typescript-eslint" 17 | ], 18 | "rules": { 19 | "@typescript-eslint/explicit-member-accessibility": "off", 20 | "@typescript-eslint/explicit-module-boundary-types": "off", 21 | "@typescript-eslint/explicit-function-return-type": "off", 22 | "@typescript-eslint/no-parameter-properties": "off", 23 | "@nrwl/nx/enforce-module-boundaries": [ 24 | "error", 25 | { 26 | "enforceBuildableLibDependency": true, 27 | "allow": [], 28 | "depConstraints": [ 29 | { "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] } 30 | ] 31 | } 32 | ] 33 | }, 34 | "overrides": [ 35 | { 36 | "files": ["*.tsx"], 37 | "rules": { 38 | "@typescript-eslint/no-unused-vars": "off" 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Dev Docs 2 | 3 | # Repository 4 | repo_name: ' Nightbr/full-https-development-environment' 5 | repo_url: https://github.com/Nightbr/full-https-development-environment 6 | 7 | copyright: '© MyOrg - 2020 and beyond' 8 | 9 | docs_dir: 'docs' 10 | dev_addr: 0.0.0.0:8000 11 | 12 | site_dir: 'public' 13 | 14 | theme: 15 | name: 'material' 16 | language: 'en' 17 | #logo: 'assets/icon-square.png' 18 | #favicon: 'assets/icon-square.png' 19 | palette: 20 | primary: 'blue' 21 | accent: 'orange' 22 | markdown_extensions: 23 | - admonition 24 | - codehilite 25 | - pymdownx.arithmatex 26 | - pymdownx.betterem: 27 | smart_enable: all 28 | - pymdownx.caret 29 | - pymdownx.critic 30 | - pymdownx.details 31 | - pymdownx.emoji: 32 | emoji_generator: !!python/name:pymdownx.emoji.to_svg 33 | - pymdownx.inlinehilite 34 | - pymdownx.magiclink 35 | - pymdownx.mark 36 | - pymdownx.smartsymbols 37 | - pymdownx.superfences 38 | - pymdownx.tasklist: 39 | custom_checkbox: true 40 | - pymdownx.tilde 41 | - toc: 42 | permalink: true 43 | 44 | extra_javascript: 45 | - 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML' 46 | 47 | plugins: 48 | - search 49 | - awesome-pages 50 | -------------------------------------------------------------------------------- /apps/react-app-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-namespace 12 | declare namespace Cypress { 13 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 14 | interface Chainable { 15 | login(email: string, password: string): void; 16 | } 17 | } 18 | // 19 | // -- This is a parent command -- 20 | Cypress.Commands.add('login', (email, password) => { 21 | console.log('Custom command example: Login', email, password); 22 | }); 23 | // 24 | // -- This is a child command -- 25 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 26 | // 27 | // 28 | // -- This is a dual command -- 29 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 30 | // 31 | // 32 | // -- This will overwrite an existing command -- 33 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 34 | -------------------------------------------------------------------------------- /dev-stack/scripts/manage-hosts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # copy from https://gist.github.com/irazasyed/a7b0a079e7727a4315b9 4 | 5 | # PATH TO YOUR HOSTS FILE 6 | ETC_HOSTS=/etc/hosts 7 | 8 | # DEFAULT IP FOR HOSTNAME 9 | IP="127.0.0.1" 10 | 11 | # Hostname to add/remove. 12 | HOSTNAME=$2 13 | 14 | removehost() { 15 | echo "removing host"; 16 | if [ -n "$(grep $HOSTNAME /etc/hosts)" ] 17 | then 18 | echo "$HOSTNAME Found in your $ETC_HOSTS, Removing now..."; 19 | sudo sed -i".bak" "/$HOSTNAME/d" $ETC_HOSTS 20 | else 21 | echo "$HOSTNAME was not found in your $ETC_HOSTS"; 22 | fi 23 | } 24 | 25 | addhost() { 26 | echo "adding host"; 27 | HOSTS_LINE="$IP\t$HOSTNAME" 28 | if [ -n "$(grep $HOSTNAME /etc/hosts)" ] 29 | then 30 | echo "$HOSTNAME already exists : $(grep $HOSTNAME $ETC_HOSTS)" 31 | else 32 | echo "Adding $HOSTNAME to your $ETC_HOSTS"; 33 | sudo -- sh -c -e "echo '$HOSTS_LINE' >> /etc/hosts"; 34 | 35 | if [ -n "$(grep $HOSTNAME /etc/hosts)" ] 36 | then 37 | echo "$HOSTNAME was added succesfully \n $(grep $HOSTNAME /etc/hosts)"; 38 | else 39 | echo "Failed to Add $HOSTNAME, Try again!"; 40 | fi 41 | fi 42 | } 43 | 44 | $@ 45 | -------------------------------------------------------------------------------- /dev-stack/.env: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | ###################### General Setup ###################### 3 | ########################################################### 4 | 5 | ### Paths ################################################# 6 | 7 | # You may add flags to the path `:cached`, `:delegated`. When using Docker Sync add `:nocopy` 8 | APP_CODE_CONTAINER_FLAG=:cached 9 | 10 | # Choose storage path on your machine. For all storage systems 11 | DATA_PATH_HOST=.data 12 | 13 | ### Hostname ################################ 14 | 15 | HOSTNAME=dev.local 16 | 17 | ### Drivers ################################################ 18 | 19 | # All volumes driver 20 | VOLUMES_DRIVER=local 21 | 22 | # All Networks driver 23 | NETWORKS_DRIVER=bridge 24 | 25 | ### Docker compose files ################################## 26 | 27 | # Select which docker-compose files to include. If using docker-sync append `:docker-compose.sync.yml` at the end 28 | COMPOSE_FILE=docker-compose.yml 29 | 30 | # Change the separator from : to ; on Windows 31 | COMPOSE_PATH_SEPARATOR=: 32 | 33 | # Define the prefix of container names. This is useful if you have multiple projects that use laradock to have seperate containers per project. 34 | COMPOSE_PROJECT_NAME=myorg 35 | 36 | ### Docker Host IP ######################################## 37 | 38 | # Enter your Docker Host IP (will be appended to /etc/hosts). Default is `10.0.75.1` 39 | DOCKER_HOST_IP=10.0.75.1 40 | 41 | ### Docker Sync ########################################### 42 | 43 | # If you are using Docker Sync. For `osx` use 'native_osx', for `windows` use 'unison', for `linux` docker-sync is not required 44 | DOCKER_SYNC_STRATEGY=native_osx 45 | 46 | ########################################################### 47 | ################ Containers Customization ################# 48 | ########################################################### 49 | 50 | ### MINIO ################################################# 51 | 52 | MINIO_PORT=9000 53 | MINIO_ACCESS_KEY=access 54 | MINIO_SECRET_KEY=secretkey 55 | 56 | ### MAILDEV ############################################### 57 | 58 | MAILDEV_HTTP_PORT=1080 59 | MAILDEV_SMTP_PORT=25 60 | 61 | ### TRAEFIK ################################################# 62 | 63 | TRAEFIK_HOST_HTTP_PORT=80 64 | TRAEFIK_HOST_HTTPS_PORT=443 65 | 66 | -------------------------------------------------------------------------------- /dev-stack/Makefile: -------------------------------------------------------------------------------- 1 | ifndef DEV_STACK_DIR 2 | DEV_STACK_DIR = $(CURDIR) 3 | endif 4 | SCRIPTS_DIR=${DEV_STACK_DIR}/scripts 5 | 6 | ifndef HOSTNAME 7 | HOSTNAME = dev.local 8 | endif 9 | ifndef SUBDOMAINS 10 | SUBDOMAINS = docs \ 11 | traefik \ 12 | mail \ 13 | media \ 14 | portainer \ 15 | graphql 16 | endif 17 | ifndef DATABASE 18 | DATABASE = postgres 19 | endif 20 | ifndef INFRA 21 | INFRA = traefik \ 22 | maildev \ 23 | minio \ 24 | mkdocs \ 25 | portainer \ 26 | ${DATABASE} \ 27 | graphql-engine 28 | endif 29 | 30 | 31 | export HOST_IP := $(shell ${SCRIPTS_DIR}/get-ip.sh) 32 | 33 | # HELP 34 | .PHONY: help 35 | 36 | help: ## List of the command available, make {command} 37 | @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) 38 | 39 | .DEFAULT_GOAL := help 40 | 41 | start: ## Start the docker stack 42 | docker-compose up -d ${INFRA} 43 | 44 | up: ## Start the docker stack 45 | docker-compose up ${INFRA} 46 | 47 | stop: ## Stop the docker stack 48 | docker-compose stop 49 | 50 | restart: ## Restart the docker stack 51 | docker-compose restart 52 | 53 | down: ## Down the docker stack and remove all containers and networks 54 | docker-compose down 55 | 56 | build: ## Build or rebuild all docker container 57 | docker-compose build 58 | 59 | pull: ## Pull latest image 60 | docker-compose pull 61 | 62 | add-hosts: ## Add Hosts entries for Dev stack 63 | ${SCRIPTS_DIR}/manage-hosts.sh addhost ${HOSTNAME} 64 | $(foreach subdomain, $(SUBDOMAINS), ${SCRIPTS_DIR}/manage-hosts.sh addhost $(subdomain).$(HOSTNAME);) 65 | 66 | remove-hosts: ## Remove Hosts entries for Dev stack 67 | ${SCRIPTS_DIR}/manage-hosts.sh removehost ${HOSTNAME} 68 | $(foreach subdomain, $(SUBDOMAINS), ${SCRIPTS_DIR}/manage-hosts.sh removehost $(subdomain).$(HOSTNAME);) 69 | 70 | certs-generate: ## Generate certs for all our domains 71 | mkcert -install 72 | mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem $(HOSTNAME) *.$(HOSTNAME) 73 | 74 | certs-uninstall: ## Uninstall the local CA (but do not delete it) 75 | mkcert -uninstall 76 | 77 | # DATABASE 78 | run-sql: ## database command (/!\ work only with psql so far) 79 | docker-compose exec $(DATABASE) psql -U root -d main_db 80 | 81 | create-db: ## create a new database: make create-db DB_NAME=plop (/!\ work only with psql so far) 82 | docker-compose exec $(DATABASE) psql -U root -d main_db -c "CREATE DATABASE $(DB_NAME)" 83 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/@nrwl/workspace/src/tslint", 4 | "node_modules/codelyzer" 5 | ], 6 | "linterOptions": { 7 | "exclude": ["**/*"] 8 | }, 9 | "rules": { 10 | "arrow-return-shorthand": true, 11 | "callable-types": true, 12 | "class-name": true, 13 | "deprecation": { 14 | "severity": "warn" 15 | }, 16 | "forin": true, 17 | "import-blacklist": [true, "rxjs/Rx"], 18 | "interface-over-type-literal": true, 19 | "member-access": false, 20 | "member-ordering": [ 21 | true, 22 | { 23 | "order": [ 24 | "static-field", 25 | "instance-field", 26 | "static-method", 27 | "instance-method" 28 | ] 29 | } 30 | ], 31 | "no-arg": true, 32 | "no-bitwise": true, 33 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], 34 | "no-construct": true, 35 | "no-debugger": true, 36 | "no-duplicate-super": true, 37 | "no-empty": false, 38 | "no-empty-interface": true, 39 | "no-eval": true, 40 | "no-inferrable-types": [true, "ignore-params"], 41 | "no-misused-new": true, 42 | "no-non-null-assertion": true, 43 | "no-shadowed-variable": true, 44 | "no-string-literal": false, 45 | "no-string-throw": true, 46 | "no-switch-case-fall-through": true, 47 | "no-unnecessary-initializer": true, 48 | "no-unused-expression": true, 49 | "no-var-keyword": true, 50 | "object-literal-sort-keys": false, 51 | "prefer-const": true, 52 | "radix": true, 53 | "triple-equals": [true, "allow-null-check"], 54 | "unified-signatures": true, 55 | "variable-name": false, 56 | "nx-enforce-module-boundaries": [ 57 | true, 58 | { 59 | "enforceBuildableLibDependency": true, 60 | "allow": [], 61 | "depConstraints": [ 62 | { 63 | "sourceTag": "*", 64 | "onlyDependOnLibsWithTags": ["*"] 65 | } 66 | ] 67 | } 68 | ], 69 | "directive-selector": [true, "attribute", "app", "camelCase"], 70 | "component-selector": [true, "element", "app", "kebab-case"], 71 | "no-conflicting-lifecycle": true, 72 | "no-host-metadata-property": true, 73 | "no-input-rename": true, 74 | "no-inputs-metadata-property": true, 75 | "no-output-native": true, 76 | "no-output-on-prefix": true, 77 | "no-output-rename": true, 78 | "no-outputs-metadata-property": true, 79 | "template-banana-in-box": true, 80 | "template-no-negated-async": true, 81 | "use-lifecycle-interface": true, 82 | "use-pipe-transform-interface": true 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /apps/myapp/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Remove template code below 3 | */ 4 | :host { 5 | display: block; 6 | font-family: sans-serif; 7 | min-width: 300px; 8 | max-width: 600px; 9 | margin: 50px auto; 10 | } 11 | 12 | .gutter-left { 13 | margin-left: 9px; 14 | } 15 | 16 | .col-span-2 { 17 | grid-column: span 2; 18 | } 19 | 20 | .flex { 21 | display: flex; 22 | align-items: center; 23 | justify-content: center; 24 | } 25 | 26 | header { 27 | background-color: #143055; 28 | color: white; 29 | padding: 5px; 30 | border-radius: 3px; 31 | } 32 | 33 | main { 34 | padding: 0 36px; 35 | } 36 | 37 | p { 38 | text-align: center; 39 | } 40 | 41 | h1 { 42 | text-align: center; 43 | margin-left: 18px; 44 | font-size: 24px; 45 | } 46 | 47 | h2 { 48 | text-align: center; 49 | font-size: 20px; 50 | margin: 40px 0 10px 0; 51 | } 52 | 53 | .resources { 54 | text-align: center; 55 | list-style: none; 56 | padding: 0; 57 | display: grid; 58 | grid-gap: 9px; 59 | grid-template-columns: 1fr 1fr; 60 | } 61 | 62 | .resource { 63 | color: #0094ba; 64 | height: 36px; 65 | background-color: rgba(0, 0, 0, 0); 66 | border: 1px solid rgba(0, 0, 0, 0.12); 67 | border-radius: 4px; 68 | padding: 3px 9px; 69 | text-decoration: none; 70 | } 71 | 72 | .resource:hover { 73 | background-color: rgba(68, 138, 255, 0.04); 74 | } 75 | 76 | pre { 77 | padding: 9px; 78 | border-radius: 4px; 79 | background-color: black; 80 | color: #eee; 81 | } 82 | 83 | details { 84 | border-radius: 4px; 85 | color: #333; 86 | background-color: rgba(0, 0, 0, 0); 87 | border: 1px solid rgba(0, 0, 0, 0.12); 88 | padding: 3px 9px; 89 | margin-bottom: 9px; 90 | } 91 | 92 | summary { 93 | cursor: pointer; 94 | outline: none; 95 | height: 36px; 96 | line-height: 36px; 97 | } 98 | 99 | .github-star-container { 100 | margin-top: 12px; 101 | line-height: 20px; 102 | } 103 | 104 | .github-star-container a { 105 | display: flex; 106 | align-items: center; 107 | text-decoration: none; 108 | color: #333; 109 | } 110 | 111 | .github-star-badge { 112 | color: #24292e; 113 | display: flex; 114 | align-items: center; 115 | font-size: 12px; 116 | padding: 3px 10px; 117 | border: 1px solid rgba(27, 31, 35, 0.2); 118 | border-radius: 3px; 119 | background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%); 120 | margin-left: 4px; 121 | font-weight: 600; 122 | } 123 | 124 | .github-star-badge:hover { 125 | background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%); 126 | border-color: rgba(27, 31, 35, 0.35); 127 | background-position: -0.5em; 128 | } 129 | .github-star-badge .material-icons { 130 | height: 16px; 131 | width: 16px; 132 | margin-right: 4px; 133 | } 134 | -------------------------------------------------------------------------------- /apps/react-app/src/app/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /apps/myapp/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | /*************************************************************************************************** 61 | * APPLICATION IMPORTS 62 | */ 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Myorg 2 | 3 | This project was generated using [Nx](https://nx.dev). 4 | 5 |

6 | 7 | 🔎 **Nx is a set of Extensible Dev Tools for Monorepos.** 8 | 9 | ## Adding capabilities to your workspace 10 | 11 | Nx supports many plugins which add capabilities for developing different types of applications and different tools. 12 | 13 | These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well. 14 | 15 | Below are our core plugins: 16 | 17 | - [React](https://reactjs.org) 18 | - `npm install --save-dev @nrwl/react` 19 | - Web (no framework frontends) 20 | - `npm install --save-dev @nrwl/web` 21 | - [Angular](https://angular.io) 22 | - `npm install --save-dev @nrwl/angular` 23 | - [Nest](https://nestjs.com) 24 | - `npm install --save-dev @nrwl/nest` 25 | - [Express](https://expressjs.com) 26 | - `npm install --save-dev @nrwl/express` 27 | - [Node](https://nodejs.org) 28 | - `npm install --save-dev @nrwl/node` 29 | 30 | There are also many [community plugins](https://nx.dev/nx-community) you could add. 31 | 32 | ## Generate an application 33 | 34 | Run `nx g @nrwl/react:app my-app` to generate an application. 35 | 36 | > You can use any of the plugins above to generate applications as well. 37 | 38 | When using Nx, you can create multiple applications and libraries in the same workspace. 39 | 40 | ## Generate a library 41 | 42 | Run `nx g @nrwl/react:lib my-lib` to generate a library. 43 | 44 | > You can also use any of the plugins above to generate libraries as well. 45 | 46 | Libraries are sharable across libraries and applications. They can be imported from `@myorg/mylib`. 47 | 48 | ## Development server 49 | 50 | Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. 51 | 52 | ## Code scaffolding 53 | 54 | Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component. 55 | 56 | ## Build 57 | 58 | Run `nx build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 59 | 60 | ## Running unit tests 61 | 62 | Run `nx test my-app` to execute the unit tests via [Jest](https://jestjs.io). 63 | 64 | Run `nx affected:test` to execute the unit tests affected by a change. 65 | 66 | ## Running end-to-end tests 67 | 68 | Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io). 69 | 70 | Run `nx affected:e2e` to execute the end-to-end tests affected by a change. 71 | 72 | ## Understand your workspace 73 | 74 | Run `nx dep-graph` to see a diagram of the dependencies of your projects. 75 | 76 | ## Further help 77 | 78 | Visit the [Nx Documentation](https://nx.dev) to learn more. 79 | 80 | ## ☁ Nx Cloud 81 | 82 | ### Computation Memoization in the Cloud 83 | 84 |

85 | 86 | Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly. 87 | 88 | Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers. 89 | 90 | Visit [Nx Cloud](https://nx.app/) to learn more. 91 | -------------------------------------------------------------------------------- /apps/myapp/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | Nx logo 7 |

Welcome to {{ title }}!

8 |
9 |
10 |

Resources & Tools

11 |

12 | Thank you for using and showing some ♥ for Nx. 13 |

14 | 38 |

39 | Here are some links to help you get started. 40 |

41 | 88 |

Next Steps

89 |

Here are some things you can do with Nx.

90 |
91 | Add UI library 92 |
 93 | # Generate UI lib
 94 | ng g @nrwl/angular:lib ui
 95 | 
 96 | # Add a component
 97 | ng g @nrwl/angular:component xyz --project ui
99 |
100 |
101 | View dependency graph 102 |
nx dep-graph
103 |
104 |
105 | Run affected commands 106 |
107 | # see what's been affected by changes
108 | ng affected:dep-graph
109 | 
110 | # run tests for current changes
111 | ng affected:test
112 | 
113 | # run e2e tests for current changes
114 | ng affected:e2e
115 | 
117 |
118 |
119 | 120 | 121 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myorg", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "nx": "nx", 7 | "start": "nx serve", 8 | "build": "nx build", 9 | "test": "nx test", 10 | "lint": "nx workspace-lint && nx lint", 11 | "e2e": "nx e2e", 12 | "affected:apps": "nx affected:apps", 13 | "affected:libs": "nx affected:libs", 14 | "affected:build": "nx affected:build", 15 | "affected:e2e": "nx affected:e2e", 16 | "affected:test": "nx affected:test", 17 | "affected:lint": "nx affected:lint", 18 | "affected:dep-graph": "nx affected:dep-graph", 19 | "affected": "nx affected", 20 | "format": "nx format:write", 21 | "format:write": "nx format:write", 22 | "format:check": "nx format:check", 23 | "update": "nx migrate latest", 24 | "workspace-schematic": "nx workspace-schematic", 25 | "dep-graph": "nx dep-graph", 26 | "help": "nx help", 27 | "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points" 28 | }, 29 | "private": true, 30 | "dependencies": { 31 | "@angular/animations": "^10.1.0", 32 | "@angular/common": "^10.1.0", 33 | "@angular/compiler": "^10.1.0", 34 | "@angular/core": "^10.1.0", 35 | "@angular/forms": "^10.1.0", 36 | "@angular/platform-browser": "^10.1.0", 37 | "@angular/platform-browser-dynamic": "^10.1.0", 38 | "@angular/router": "^10.1.0", 39 | "@emotion/core": "10.0.28", 40 | "@emotion/styled": "10.0.27", 41 | "@nestjs/common": "^7.0.0", 42 | "@nestjs/core": "^7.0.0", 43 | "@nestjs/platform-express": "^7.0.0", 44 | "document-register-element": "1.13.1", 45 | "express": "4.17.1", 46 | "react": "16.13.1", 47 | "react-dom": "16.13.1", 48 | "react-router-dom": "5.2.0", 49 | "reflect-metadata": "^0.1.13", 50 | "rxjs": "~6.5.5", 51 | "zone.js": "^0.10.2" 52 | }, 53 | "devDependencies": { 54 | "@angular-devkit/build-angular": "~0.1001.3", 55 | "@angular/compiler-cli": "^10.1.0", 56 | "@angular/language-service": "^10.1.0", 57 | "@babel/core": "7.9.6", 58 | "@babel/preset-env": "7.9.6", 59 | "@babel/preset-react": "7.9.4", 60 | "@babel/preset-typescript": "7.9.0", 61 | "@emotion/babel-preset-css-prop": "10.0.27", 62 | "@nestjs/schematics": "^7.0.0", 63 | "@nestjs/testing": "^7.0.0", 64 | "@nrwl/angular": "^10.3.0", 65 | "@nrwl/cli": "10.3.0", 66 | "@nrwl/cypress": "10.3.0", 67 | "@nrwl/eslint-plugin-nx": "10.3.0", 68 | "@nrwl/express": "10.3.0", 69 | "@nrwl/jest": "10.3.0", 70 | "@nrwl/nest": "^10.3.0", 71 | "@nrwl/node": "10.3.0", 72 | "@nrwl/react": "^10.3.0", 73 | "@nrwl/web": "10.3.0", 74 | "@nrwl/workspace": "10.3.0", 75 | "@testing-library/react": "10.4.1", 76 | "@types/express": "4.17.0", 77 | "@types/jest": "26.0.8", 78 | "@types/node": "~8.9.4", 79 | "@types/react": "16.9.38", 80 | "@types/react-dom": "16.9.8", 81 | "@types/react-router-dom": "5.1.5", 82 | "@typescript-eslint/eslint-plugin": "4.3.0", 83 | "@typescript-eslint/parser": "4.3.0", 84 | "babel-jest": "26.2.2", 85 | "codelyzer": "~5.0.1", 86 | "cypress": "^4.1.0", 87 | "dotenv": "6.2.0", 88 | "eslint": "7.10.0", 89 | "eslint-config-prettier": "6.0.0", 90 | "eslint-plugin-cypress": "^2.10.3", 91 | "eslint-plugin-import": "2.21.2", 92 | "eslint-plugin-jsx-a11y": "6.3.1", 93 | "eslint-plugin-react": "7.20.0", 94 | "eslint-plugin-react-hooks": "4.0.4", 95 | "jest": "26.2.2", 96 | "jest-preset-angular": "8.3.1", 97 | "prettier": "2.0.4", 98 | "ts-jest": "26.4.0", 99 | "ts-node": "~7.0.0", 100 | "tslint": "~6.0.0", 101 | "typescript": "~4.0.3" 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /dev-stack/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | networks: 4 | reverseproxy: 5 | driver: ${NETWORKS_DRIVER} 6 | database: 7 | driver: ${NETWORKS_DRIVER} 8 | 9 | volumes: 10 | postgres: 11 | driver: ${VOLUMES_DRIVER} 12 | minio: 13 | driver: ${VOLUMES_DRIVER} 14 | phpmyadmin: 15 | driver: ${VOLUMES_DRIVER} 16 | elasticsearch: 17 | driver: ${VOLUMES_DRIVER} 18 | 19 | services: 20 | ### Postgres Database ######################################### 21 | postgres: 22 | image: postgres:12 23 | ports: 24 | - 5432:5432 25 | networks: 26 | - database 27 | volumes: 28 | - postgres:/var/lib/postgresql/data 29 | - ./database/initdb.d:/docker-entrypoint-initdb.d/ 30 | environment: 31 | POSTGRES_DB: main_db 32 | POSTGRES_USER: root 33 | POSTGRES_PASSWORD: root 34 | 35 | ### GraphQL Engine - Hasura ######################################### 36 | graphql-engine: 37 | image: hasura/graphql-engine:v1.3.2.cli-migrations-v2 38 | depends_on: 39 | - "postgres" 40 | extra_hosts: 41 | - "dockerhost:172.17.0.1" 42 | networks: 43 | - reverseproxy 44 | - database 45 | #volumes: 46 | # - ../.hasura/migrations:/hasura-migrations 47 | # - ../.hasura/metadata:/hasura-metadata 48 | environment: 49 | HASURA_GRAPHQL_DATABASE_URL: postgres://root:root@postgres:5432/main_db 50 | ## enable the console served by server 51 | HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console 52 | ## enable debugging mode. It is recommended to disable this in production 53 | HASURA_GRAPHQL_DEV_MODE: "true" 54 | HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log 55 | ## Secure secret 56 | HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey 57 | HASURA_GRAPHQL_CORS_DOMAIN: "https://dev.local:4200, https://*.dev.local" 58 | ## Auth system integration - see auth-connector 59 | #HASURA_GRAPHQL_AUTH_HOOK: http://auth-connector:3000 60 | #HASURA_GRAPHQL_AUTH_HOOK: http://dockerhost:3333/auth 61 | #HASURA_GRAPHQL_AUTH_HOOK_MODE: GET 62 | labels: 63 | - traefik.enable=true 64 | - traefik.http.routers.graphql.rule=Host(`graphql.${HOSTNAME}`) 65 | - traefik.http.routers.graphql.entrypoints=http, https 66 | - traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto = https 67 | - traefik.http.routers.graphql.tls=true 68 | - traefik.http.routers.graphql.service=graphql 69 | - traefik.http.services.graphql.loadbalancer.server.port=8080 70 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 71 | 72 | ### Router TRAEFIK ######################################### 73 | traefik: 74 | build: 75 | context: ./traefik 76 | command: --docker \ 77 | --logLevel=DEBUG --accessLogsFile=/dev/stdout --providers.docker 78 | volumes: 79 | - /var/run/docker.sock:/var/run/docker.sock 80 | - ./certs:/etc/certs:ro 81 | - ./traefik/traefik.toml:/etc/traefik/traefik.toml 82 | - ./traefik/traefik.config.toml:/etc/traefik/traefik.config.toml 83 | ports: 84 | - '${TRAEFIK_HOST_HTTP_PORT}:80' 85 | - '${TRAEFIK_HOST_HTTPS_PORT}:443' 86 | networks: 87 | - reverseproxy 88 | labels: 89 | - traefik.enable=true 90 | - traefik.http.routers.frontrouter.rule=Host(`traefik.${HOSTNAME}`) 91 | - traefik.http.routers.frontrouter.entrypoints=http, https 92 | - traefik.http.routers.frontrouter.tls=true 93 | - traefik.http.routers.frontrouter.service=frontrouter 94 | - traefik.http.services.frontrouter.loadbalancer.server.port=8080 95 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 96 | 97 | ### mkdocs ############################################### 98 | mkdocs: 99 | build: 100 | context: ./mkdocs 101 | volumes: 102 | - ../:/docs 103 | tty: true 104 | networks: 105 | - reverseproxy 106 | labels: 107 | - traefik.enable=true 108 | - traefik.http.routers.mkdocs.rule=Host(`docs.${HOSTNAME}`) 109 | - traefik.http.routers.mkdocs.entrypoints=http, https 110 | - traefik.http.routers.mkdocs.tls=true 111 | - traefik.http.routers.mkdocs.service=mkdocs 112 | - traefik.http.services.mkdocs.loadbalancer.server.port=8000 113 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 114 | 115 | ### Minio ################################################ 116 | minio: 117 | build: ./minio 118 | volumes: 119 | - ${DATA_PATH_HOST}/minio/data:/export 120 | - ${DATA_PATH_HOST}/minio/config:/root/.minio 121 | labels: 122 | - traefik.enable=true 123 | - traefik.http.routers.media.rule=Host(`media.${HOSTNAME}`) 124 | - traefik.http.routers.media.entrypoints=http, https 125 | - traefik.http.routers.media.tls=true 126 | - traefik.http.routers.media.service=media 127 | - traefik.http.services.media.loadbalancer.server.port=9000 128 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 129 | environment: 130 | - MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} 131 | - MINIO_SECRET_KEY=${MINIO_SECRET_KEY} 132 | networks: 133 | - reverseproxy 134 | 135 | ### MailDev ############################################## 136 | maildev: 137 | image: djfarrelly/maildev 138 | command: bin/maildev --web 80 --smtp 25 --hide-extensions STARTTLS 139 | # We need to disable TLS, to avoid a bug with symfony Mailer => https://github.com/symfony/symfony/pull/34172 & https://github.com/maildev/maildev/issues/274 140 | ports: 141 | - '${MAILDEV_SMTP_PORT}:25' 142 | networks: 143 | - reverseproxy 144 | labels: 145 | - traefik.enable=true 146 | - traefik.http.routers.mail.rule=Host(`mail.${HOSTNAME}`) 147 | - traefik.http.routers.mail.entrypoints=http, https 148 | - traefik.http.routers.mail.tls=true 149 | - traefik.http.routers.mail.service=mail 150 | - traefik.http.services.mail.loadbalancer.server.port=80 151 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 152 | 153 | ### Portainer ################################################ 154 | portainer: 155 | image: portainer/portainer 156 | command: -H unix:///var/run/docker.sock --no-auth 157 | volumes: 158 | - ${DATA_PATH_HOST}/portainer_data:/data 159 | - /var/run/docker.sock:/var/run/docker.sock 160 | extra_hosts: 161 | - 'dockerhost:${DOCKER_HOST_IP}' 162 | networks: 163 | - reverseproxy 164 | labels: 165 | - traefik.enable=true 166 | - traefik.http.routers.portainer.rule=Host(`portainer.${HOSTNAME}`) 167 | - traefik.http.routers.portainer.entrypoints=http, https 168 | - traefik.http.routers.portainer.tls=true 169 | - traefik.http.routers.portainer.service=portainer 170 | - traefik.http.services.portainer.loadbalancer.server.port=9000 171 | - traefik.docker.network=${COMPOSE_PROJECT_NAME}_reverseproxy 172 | -------------------------------------------------------------------------------- /apps/react-app/src/app/app.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import styled from '@emotion/styled'; 4 | 5 | import { ReactComponent as Logo } from './logo.svg'; 6 | import star from './star.svg'; 7 | 8 | import { Route, Link } from 'react-router-dom'; 9 | 10 | const StyledApp = styled.div` 11 | font-family: sans-serif; 12 | min-width: 300px; 13 | max-width: 600px; 14 | margin: 50px auto; 15 | 16 | .gutter-left { 17 | margin-left: 9px; 18 | } 19 | 20 | .col-span-2 { 21 | grid-column: span 2; 22 | } 23 | 24 | .flex { 25 | display: flex; 26 | align-items: center; 27 | justify-content: center; 28 | } 29 | 30 | header { 31 | background-color: #143055; 32 | color: white; 33 | padding: 5px; 34 | border-radius: 3px; 35 | } 36 | 37 | main { 38 | padding: 0 36px; 39 | } 40 | 41 | p { 42 | text-align: center; 43 | } 44 | 45 | h1 { 46 | text-align: center; 47 | margin-left: 18px; 48 | font-size: 24px; 49 | } 50 | 51 | h2 { 52 | text-align: center; 53 | font-size: 20px; 54 | margin: 40px 0 10px 0; 55 | } 56 | 57 | .resources { 58 | text-align: center; 59 | list-style: none; 60 | padding: 0; 61 | display: grid; 62 | grid-gap: 9px; 63 | grid-template-columns: 1fr 1fr; 64 | } 65 | 66 | .resource { 67 | color: #0094ba; 68 | height: 36px; 69 | background-color: rgba(0, 0, 0, 0); 70 | border: 1px solid rgba(0, 0, 0, 0.12); 71 | border-radius: 4px; 72 | padding: 3px 9px; 73 | text-decoration: none; 74 | } 75 | 76 | .resource:hover { 77 | background-color: rgba(68, 138, 255, 0.04); 78 | } 79 | 80 | pre { 81 | padding: 9px; 82 | border-radius: 4px; 83 | background-color: black; 84 | color: #eee; 85 | } 86 | 87 | details { 88 | border-radius: 4px; 89 | color: #333; 90 | background-color: rgba(0, 0, 0, 0); 91 | border: 1px solid rgba(0, 0, 0, 0.12); 92 | padding: 3px 9px; 93 | margin-bottom: 9px; 94 | } 95 | 96 | summary { 97 | outline: none; 98 | height: 36px; 99 | line-height: 36px; 100 | } 101 | 102 | .github-star-container { 103 | margin-top: 12px; 104 | line-height: 20px; 105 | } 106 | 107 | .github-star-container a { 108 | display: flex; 109 | align-items: center; 110 | text-decoration: none; 111 | color: #333; 112 | } 113 | 114 | .github-star-badge { 115 | color: #24292e; 116 | display: flex; 117 | align-items: center; 118 | font-size: 12px; 119 | padding: 3px 10px; 120 | border: 1px solid rgba(27, 31, 35, 0.2); 121 | border-radius: 3px; 122 | background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%); 123 | margin-left: 4px; 124 | font-weight: 600; 125 | } 126 | 127 | .github-star-badge:hover { 128 | background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%); 129 | border-color: rgba(27, 31, 35, 0.35); 130 | background-position: -0.5em; 131 | } 132 | .github-star-badge .material-icons { 133 | height: 16px; 134 | width: 16px; 135 | margin-right: 4px; 136 | } 137 | `; 138 | 139 | export const App = () => { 140 | /* 141 | * Replace the elements below with your own. 142 | * 143 | * Note: The corresponding styles are in the ./app.@emotion/styled file. 144 | */ 145 | return ( 146 | 147 |
148 | 149 |

Welcome to react-app!

150 |
151 |
152 |

Resources & Tools

153 |

Thank you for using and showing some ♥ for Nx.

154 | 168 |

Here are some links to help you get started.

169 | 216 |

Next Steps

217 |

Here are some things you can do with Nx.

218 |
219 | Add UI library 220 |
{`# Generate UI lib
221 | nx g @nrwl/react:lib ui
222 | 
223 | # Add a component
224 | nx g @nrwl/react:component xyz --project ui`}
225 |
226 |
227 | View dependency graph 228 |
{`nx dep-graph`}
229 |
230 |
231 | Run affected commands 232 |
{`# see what's been affected by changes
233 | nx affected:dep-graph
234 | 
235 | # run tests for current changes
236 | nx affected:test
237 | 
238 | # run e2e tests for current changes
239 | nx affected:e2e
240 |   `}
241 |
242 |
243 | 244 | {/* START: routes */} 245 | {/* These routes and navigation have been generated for you */} 246 | {/* Feel free to move and update them to fit your needs */} 247 |
248 |
249 |
250 |
251 |
    252 |
  • 253 | Home 254 |
  • 255 |
  • 256 | Page 2 257 |
  • 258 |
259 |
260 | ( 264 |
265 | This is the generated root route.{' '} 266 | Click here for page 2. 267 |
268 | )} 269 | /> 270 | ( 274 |
275 | Click here to go back to root page. 276 |
277 | )} 278 | /> 279 | {/* END: routes */} 280 |
281 | ); 282 | }; 283 | 284 | export default App; 285 | -------------------------------------------------------------------------------- /apps/react-app/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "env": { 5 | "browser": true, 6 | "commonjs": true, 7 | "es6": true, 8 | "jest": true, 9 | "node": true 10 | }, 11 | "settings": { "react": { "version": "detect" } }, 12 | "plugins": ["import", "jsx-a11y", "react", "react-hooks"], 13 | "rules": { 14 | "array-callback-return": "warn", 15 | "dot-location": ["warn", "property"], 16 | "eqeqeq": ["warn", "smart"], 17 | "new-parens": "warn", 18 | "no-caller": "warn", 19 | "no-cond-assign": ["warn", "except-parens"], 20 | "no-const-assign": "warn", 21 | "no-control-regex": "warn", 22 | "no-delete-var": "warn", 23 | "no-dupe-args": "warn", 24 | "no-dupe-keys": "warn", 25 | "no-duplicate-case": "warn", 26 | "no-empty-character-class": "warn", 27 | "no-empty-pattern": "warn", 28 | "no-eval": "warn", 29 | "no-ex-assign": "warn", 30 | "no-extend-native": "warn", 31 | "no-extra-bind": "warn", 32 | "no-extra-label": "warn", 33 | "no-fallthrough": "warn", 34 | "no-func-assign": "warn", 35 | "no-implied-eval": "warn", 36 | "no-invalid-regexp": "warn", 37 | "no-iterator": "warn", 38 | "no-label-var": "warn", 39 | "no-labels": ["warn", { "allowLoop": true, "allowSwitch": false }], 40 | "no-lone-blocks": "warn", 41 | "no-loop-func": "warn", 42 | "no-mixed-operators": [ 43 | "warn", 44 | { 45 | "groups": [ 46 | ["&", "|", "^", "~", "<<", ">>", ">>>"], 47 | ["==", "!=", "===", "!==", ">", ">=", "<", "<="], 48 | ["&&", "||"], 49 | ["in", "instanceof"] 50 | ], 51 | "allowSamePrecedence": false 52 | } 53 | ], 54 | "no-multi-str": "warn", 55 | "no-native-reassign": "warn", 56 | "no-negated-in-lhs": "warn", 57 | "no-new-func": "warn", 58 | "no-new-object": "warn", 59 | "no-new-symbol": "warn", 60 | "no-new-wrappers": "warn", 61 | "no-obj-calls": "warn", 62 | "no-octal": "warn", 63 | "no-octal-escape": "warn", 64 | "no-redeclare": "warn", 65 | "no-regex-spaces": "warn", 66 | "no-restricted-syntax": ["warn", "WithStatement"], 67 | "no-script-url": "warn", 68 | "no-self-assign": "warn", 69 | "no-self-compare": "warn", 70 | "no-sequences": "warn", 71 | "no-shadow-restricted-names": "warn", 72 | "no-sparse-arrays": "warn", 73 | "no-template-curly-in-string": "warn", 74 | "no-this-before-super": "warn", 75 | "no-throw-literal": "warn", 76 | "no-restricted-globals": [ 77 | "error", 78 | "addEventListener", 79 | "blur", 80 | "close", 81 | "closed", 82 | "confirm", 83 | "defaultStatus", 84 | "defaultstatus", 85 | "event", 86 | "external", 87 | "find", 88 | "focus", 89 | "frameElement", 90 | "frames", 91 | "history", 92 | "innerHeight", 93 | "innerWidth", 94 | "length", 95 | "location", 96 | "locationbar", 97 | "menubar", 98 | "moveBy", 99 | "moveTo", 100 | "name", 101 | "onblur", 102 | "onerror", 103 | "onfocus", 104 | "onload", 105 | "onresize", 106 | "onunload", 107 | "open", 108 | "opener", 109 | "opera", 110 | "outerHeight", 111 | "outerWidth", 112 | "pageXOffset", 113 | "pageYOffset", 114 | "parent", 115 | "print", 116 | "removeEventListener", 117 | "resizeBy", 118 | "resizeTo", 119 | "screen", 120 | "screenLeft", 121 | "screenTop", 122 | "screenX", 123 | "screenY", 124 | "scroll", 125 | "scrollbars", 126 | "scrollBy", 127 | "scrollTo", 128 | "scrollX", 129 | "scrollY", 130 | "self", 131 | "status", 132 | "statusbar", 133 | "stop", 134 | "toolbar", 135 | "top" 136 | ], 137 | "no-unexpected-multiline": "warn", 138 | "no-unreachable": "warn", 139 | "no-unused-expressions": "off", 140 | "no-unused-labels": "warn", 141 | "no-useless-computed-key": "warn", 142 | "no-useless-concat": "warn", 143 | "no-useless-escape": "warn", 144 | "no-useless-rename": [ 145 | "warn", 146 | { 147 | "ignoreDestructuring": false, 148 | "ignoreImport": false, 149 | "ignoreExport": false 150 | } 151 | ], 152 | "no-with": "warn", 153 | "no-whitespace-before-property": "warn", 154 | "react-hooks/exhaustive-deps": "warn", 155 | "require-yield": "warn", 156 | "rest-spread-spacing": ["warn", "never"], 157 | "strict": ["warn", "never"], 158 | "unicode-bom": ["warn", "never"], 159 | "use-isnan": "warn", 160 | "valid-typeof": "warn", 161 | "no-restricted-properties": [ 162 | "error", 163 | { 164 | "object": "require", 165 | "property": "ensure", 166 | "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" 167 | }, 168 | { 169 | "object": "System", 170 | "property": "import", 171 | "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" 172 | } 173 | ], 174 | "getter-return": "warn", 175 | "import/first": "error", 176 | "import/no-amd": "error", 177 | "import/no-webpack-loader-syntax": "error", 178 | "react/forbid-foreign-prop-types": ["warn", { "allowInPropTypes": true }], 179 | "react/jsx-no-comment-textnodes": "warn", 180 | "react/jsx-no-duplicate-props": "warn", 181 | "react/jsx-no-target-blank": "warn", 182 | "react/jsx-no-undef": "error", 183 | "react/jsx-pascal-case": ["warn", { "allowAllCaps": true, "ignore": [] }], 184 | "react/jsx-uses-react": "warn", 185 | "react/jsx-uses-vars": "warn", 186 | "react/no-danger-with-children": "warn", 187 | "react/no-direct-mutation-state": "warn", 188 | "react/no-is-mounted": "warn", 189 | "react/no-typos": "error", 190 | "react/react-in-jsx-scope": "error", 191 | "react/require-render-return": "error", 192 | "react/style-prop-object": "warn", 193 | "react/jsx-no-useless-fragment": "warn", 194 | "jsx-a11y/accessible-emoji": "warn", 195 | "jsx-a11y/alt-text": "warn", 196 | "jsx-a11y/anchor-has-content": "warn", 197 | "jsx-a11y/anchor-is-valid": [ 198 | "warn", 199 | { "aspects": ["noHref", "invalidHref"] } 200 | ], 201 | "jsx-a11y/aria-activedescendant-has-tabindex": "warn", 202 | "jsx-a11y/aria-props": "warn", 203 | "jsx-a11y/aria-proptypes": "warn", 204 | "jsx-a11y/aria-role": "warn", 205 | "jsx-a11y/aria-unsupported-elements": "warn", 206 | "jsx-a11y/heading-has-content": "warn", 207 | "jsx-a11y/iframe-has-title": "warn", 208 | "jsx-a11y/img-redundant-alt": "warn", 209 | "jsx-a11y/no-access-key": "warn", 210 | "jsx-a11y/no-distracting-elements": "warn", 211 | "jsx-a11y/no-redundant-roles": "warn", 212 | "jsx-a11y/role-has-required-aria-props": "warn", 213 | "jsx-a11y/role-supports-aria-props": "warn", 214 | "jsx-a11y/scope": "warn", 215 | "react-hooks/rules-of-hooks": "error", 216 | "default-case": "off", 217 | "no-dupe-class-members": "off", 218 | "no-undef": "off", 219 | "@typescript-eslint/consistent-type-assertions": "warn", 220 | "no-array-constructor": "off", 221 | "@typescript-eslint/no-array-constructor": "warn", 222 | "@typescript-eslint/no-namespace": "error", 223 | "no-use-before-define": "off", 224 | "@typescript-eslint/no-use-before-define": [ 225 | "warn", 226 | { 227 | "functions": false, 228 | "classes": false, 229 | "variables": false, 230 | "typedefs": false 231 | } 232 | ], 233 | "no-unused-vars": "off", 234 | "@typescript-eslint/no-unused-vars": [ 235 | "warn", 236 | { "args": "none", "ignoreRestSiblings": true } 237 | ], 238 | "no-useless-constructor": "off", 239 | "@typescript-eslint/no-useless-constructor": "warn", 240 | "@typescript-eslint/no-unused-expressions": [ 241 | "error", 242 | { 243 | "allowShortCircuit": true, 244 | "allowTernary": true, 245 | "allowTaggedTemplates": true 246 | } 247 | ] 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /workspace.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "projects": { 4 | "myapp": { 5 | "projectType": "application", 6 | "schematics": { 7 | "@schematics/angular:component": { 8 | "style": "scss" 9 | } 10 | }, 11 | "root": "apps/myapp", 12 | "sourceRoot": "apps/myapp/src", 13 | "prefix": "myorg", 14 | "architect": { 15 | "build": { 16 | "builder": "@angular-devkit/build-angular:browser", 17 | "options": { 18 | "outputPath": "dist/apps/myapp", 19 | "index": "apps/myapp/src/index.html", 20 | "main": "apps/myapp/src/main.ts", 21 | "polyfills": "apps/myapp/src/polyfills.ts", 22 | "tsConfig": "apps/myapp/tsconfig.app.json", 23 | "aot": true, 24 | "assets": ["apps/myapp/src/favicon.ico", "apps/myapp/src/assets"], 25 | "styles": ["apps/myapp/src/styles.scss"], 26 | "scripts": [] 27 | }, 28 | "configurations": { 29 | "production": { 30 | "fileReplacements": [ 31 | { 32 | "replace": "apps/myapp/src/environments/environment.ts", 33 | "with": "apps/myapp/src/environments/environment.prod.ts" 34 | } 35 | ], 36 | "optimization": true, 37 | "outputHashing": "all", 38 | "sourceMap": false, 39 | "extractCss": true, 40 | "namedChunks": false, 41 | "extractLicenses": true, 42 | "vendorChunk": false, 43 | "buildOptimizer": true, 44 | "budgets": [ 45 | { 46 | "type": "initial", 47 | "maximumWarning": "2mb", 48 | "maximumError": "5mb" 49 | }, 50 | { 51 | "type": "anyComponentStyle", 52 | "maximumWarning": "6kb", 53 | "maximumError": "10kb" 54 | } 55 | ] 56 | } 57 | } 58 | }, 59 | "serve": { 60 | "builder": "@angular-devkit/build-angular:dev-server", 61 | "options": { 62 | "browserTarget": "myapp:build", 63 | "host": "dev.local", 64 | "ssl": true, 65 | "sslKey": "./dev-stack/certs/local-key.pem", 66 | "sslCert": "./dev-stack/certs/local-cert.pem" 67 | }, 68 | "configurations": { 69 | "production": { 70 | "browserTarget": "myapp:build:production" 71 | } 72 | } 73 | }, 74 | "extract-i18n": { 75 | "builder": "@angular-devkit/build-angular:extract-i18n", 76 | "options": { 77 | "browserTarget": "myapp:build" 78 | } 79 | }, 80 | "lint": { 81 | "builder": "@angular-devkit/build-angular:tslint", 82 | "options": { 83 | "tsConfig": [ 84 | "apps/myapp/tsconfig.app.json", 85 | "apps/myapp/tsconfig.spec.json", 86 | "apps/myapp/tsconfig.editor.json" 87 | ], 88 | "exclude": ["**/node_modules/**", "!apps/myapp/**/*"] 89 | } 90 | }, 91 | "test": { 92 | "builder": "@nrwl/jest:jest", 93 | "options": { 94 | "jestConfig": "apps/myapp/jest.config.js", 95 | "passWithNoTests": true 96 | } 97 | } 98 | } 99 | }, 100 | "myapp-e2e": { 101 | "root": "apps/myapp-e2e", 102 | "sourceRoot": "apps/myapp-e2e/src", 103 | "projectType": "application", 104 | "architect": { 105 | "e2e": { 106 | "builder": "@nrwl/cypress:cypress", 107 | "options": { 108 | "cypressConfig": "apps/myapp-e2e/cypress.json", 109 | "tsConfig": "apps/myapp-e2e/tsconfig.e2e.json", 110 | "devServerTarget": "myapp:serve" 111 | }, 112 | "configurations": { 113 | "production": { 114 | "devServerTarget": "myapp:serve:production" 115 | } 116 | } 117 | }, 118 | "lint": { 119 | "builder": "@angular-devkit/build-angular:tslint", 120 | "options": { 121 | "tsConfig": ["apps/myapp-e2e/tsconfig.e2e.json"], 122 | "exclude": ["**/node_modules/**", "!apps/myapp-e2e/**/*"] 123 | } 124 | } 125 | } 126 | }, 127 | "react-app": { 128 | "root": "apps/react-app", 129 | "sourceRoot": "apps/react-app/src", 130 | "projectType": "application", 131 | "schematics": {}, 132 | "architect": { 133 | "build": { 134 | "builder": "@nrwl/web:build", 135 | "options": { 136 | "outputPath": "dist/apps/react-app", 137 | "index": "apps/react-app/src/index.html", 138 | "main": "apps/react-app/src/main.tsx", 139 | "polyfills": "apps/react-app/src/polyfills.ts", 140 | "tsConfig": "apps/react-app/tsconfig.app.json", 141 | "assets": [ 142 | "apps/react-app/src/favicon.ico", 143 | "apps/react-app/src/assets" 144 | ], 145 | "styles": [], 146 | "scripts": [], 147 | "webpackConfig": "@nrwl/react/plugins/webpack" 148 | }, 149 | "configurations": { 150 | "production": { 151 | "fileReplacements": [ 152 | { 153 | "replace": "apps/react-app/src/environments/environment.ts", 154 | "with": "apps/react-app/src/environments/environment.prod.ts" 155 | } 156 | ], 157 | "optimization": true, 158 | "outputHashing": "all", 159 | "sourceMap": false, 160 | "extractCss": true, 161 | "namedChunks": false, 162 | "extractLicenses": true, 163 | "vendorChunk": false, 164 | "budgets": [ 165 | { 166 | "type": "initial", 167 | "maximumWarning": "2mb", 168 | "maximumError": "5mb" 169 | } 170 | ] 171 | } 172 | } 173 | }, 174 | "serve": { 175 | "builder": "@nrwl/web:dev-server", 176 | "options": { 177 | "buildTarget": "react-app:build", 178 | "host": "dev.local", 179 | "ssl": true, 180 | "sslKey": "./dev-stack/certs/local-key.pem", 181 | "sslCert": "./dev-stack/certs/local-cert.pem" 182 | }, 183 | "configurations": { 184 | "production": { 185 | "buildTarget": "react-app:build:production" 186 | } 187 | } 188 | }, 189 | "lint": { 190 | "builder": "@nrwl/linter:eslint", 191 | "options": { 192 | "lintFilePatterns": ["apps/react-app/**/*.{ts,tsx,js,jsx}"] 193 | } 194 | }, 195 | "test": { 196 | "builder": "@nrwl/jest:jest", 197 | "options": { 198 | "jestConfig": "apps/react-app/jest.config.js", 199 | "passWithNoTests": true 200 | } 201 | } 202 | } 203 | }, 204 | "react-app-e2e": { 205 | "root": "apps/react-app-e2e", 206 | "sourceRoot": "apps/react-app-e2e/src", 207 | "projectType": "application", 208 | "architect": { 209 | "e2e": { 210 | "builder": "@nrwl/cypress:cypress", 211 | "options": { 212 | "cypressConfig": "apps/react-app-e2e/cypress.json", 213 | "tsConfig": "apps/react-app-e2e/tsconfig.e2e.json", 214 | "devServerTarget": "react-app:serve" 215 | }, 216 | "configurations": { 217 | "production": { 218 | "devServerTarget": "react-app:serve:production" 219 | } 220 | } 221 | }, 222 | "lint": { 223 | "builder": "@nrwl/linter:eslint", 224 | "options": { 225 | "lintFilePatterns": ["apps/react-app-e2e/**/*.{js,ts}"] 226 | } 227 | } 228 | } 229 | }, 230 | "express-api": { 231 | "root": "apps/express-api", 232 | "sourceRoot": "apps/express-api/src", 233 | "projectType": "application", 234 | "prefix": "express-api", 235 | "schematics": {}, 236 | "architect": { 237 | "build": { 238 | "builder": "@nrwl/node:build", 239 | "options": { 240 | "outputPath": "dist/apps/express-api", 241 | "main": "apps/express-api/src/main.ts", 242 | "tsConfig": "apps/express-api/tsconfig.app.json", 243 | "assets": ["apps/express-api/src/assets"] 244 | }, 245 | "configurations": { 246 | "production": { 247 | "optimization": true, 248 | "extractLicenses": true, 249 | "inspect": false, 250 | "fileReplacements": [ 251 | { 252 | "replace": "apps/express-api/src/environments/environment.ts", 253 | "with": "apps/express-api/src/environments/environment.prod.ts" 254 | } 255 | ] 256 | } 257 | } 258 | }, 259 | "serve": { 260 | "builder": "@nrwl/node:execute", 261 | "options": { 262 | "buildTarget": "express-api:build" 263 | } 264 | }, 265 | "lint": { 266 | "builder": "@nrwl/linter:eslint", 267 | "options": { 268 | "lintFilePatterns": ["apps/express-api/**/*.ts"] 269 | } 270 | }, 271 | "test": { 272 | "builder": "@nrwl/jest:jest", 273 | "options": { 274 | "jestConfig": "apps/express-api/jest.config.js", 275 | "passWithNoTests": true 276 | } 277 | } 278 | } 279 | }, 280 | "nest-api": { 281 | "root": "apps/nest-api", 282 | "sourceRoot": "apps/nest-api/src", 283 | "projectType": "application", 284 | "prefix": "nest-api", 285 | "schematics": {}, 286 | "architect": { 287 | "build": { 288 | "builder": "@nrwl/node:build", 289 | "options": { 290 | "outputPath": "dist/apps/nest-api", 291 | "main": "apps/nest-api/src/main.ts", 292 | "tsConfig": "apps/nest-api/tsconfig.app.json", 293 | "assets": ["apps/nest-api/src/assets"] 294 | }, 295 | "configurations": { 296 | "production": { 297 | "optimization": true, 298 | "extractLicenses": true, 299 | "inspect": false, 300 | "fileReplacements": [ 301 | { 302 | "replace": "apps/nest-api/src/environments/environment.ts", 303 | "with": "apps/nest-api/src/environments/environment.prod.ts" 304 | } 305 | ] 306 | } 307 | } 308 | }, 309 | "serve": { 310 | "builder": "@nrwl/node:execute", 311 | "options": { 312 | "buildTarget": "nest-api:build" 313 | } 314 | }, 315 | "lint": { 316 | "builder": "@nrwl/linter:eslint", 317 | "options": { 318 | "lintFilePatterns": ["apps/nest-api/**/*.ts"] 319 | } 320 | }, 321 | "test": { 322 | "builder": "@nrwl/jest:jest", 323 | "options": { 324 | "jestConfig": "apps/nest-api/jest.config.js", 325 | "passWithNoTests": true 326 | } 327 | } 328 | } 329 | } 330 | }, 331 | "cli": { 332 | "defaultCollection": "@nrwl/angular" 333 | }, 334 | "schematics": { 335 | "@nrwl/angular:application": { 336 | "unitTestRunner": "jest", 337 | "e2eTestRunner": "cypress" 338 | }, 339 | "@nrwl/angular:library": { 340 | "unitTestRunner": "jest" 341 | }, 342 | "@nrwl/react": { 343 | "application": { 344 | "style": "@emotion/styled", 345 | "linter": "eslint", 346 | "babel": true 347 | }, 348 | "component": { 349 | "style": "@emotion/styled" 350 | }, 351 | "library": { 352 | "style": "@emotion/styled", 353 | "linter": "eslint" 354 | } 355 | } 356 | }, 357 | "defaultProject": "myapp" 358 | } 359 | --------------------------------------------------------------------------------