├── libs
├── .gitkeep
├── data
│ ├── src
│ │ ├── index.ts
│ │ └── lib
│ │ │ └── data.ts
│ ├── tslint.json
│ ├── tsconfig.json
│ ├── README.md
│ ├── tsconfig.lib.json
│ ├── jest.config.js
│ └── tsconfig.spec.json
└── ticket-list
│ ├── .eslintrc
│ ├── src
│ ├── index.ts
│ └── lib
│ │ └── ticket-list
│ │ ├── ticket-list.spec.tsx
│ │ └── ticket-list.tsx
│ ├── README.md
│ ├── tsconfig.lib.json
│ ├── jest.config.js
│ ├── tsconfig.json
│ └── tsconfig.spec.json
├── apps
├── .gitkeep
├── api
│ ├── src
│ │ ├── app
│ │ │ └── .gitkeep
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ └── main.ts
│ ├── tslint.json
│ ├── jest.config.js
│ ├── tsconfig.json
│ ├── tsconfig.app.json
│ └── tsconfig.spec.json
├── agent-api
│ ├── src
│ │ ├── app
│ │ │ └── .gitkeep
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.ts
│ │ │ └── environment.prod.ts
│ │ └── main.ts
│ ├── tslint.json
│ ├── jest.config.js
│ ├── tsconfig.json
│ ├── tsconfig.app.json
│ └── tsconfig.spec.json
├── agent
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── favicon.ico
│ │ ├── main.tsx
│ │ ├── polyfills.ts
│ │ ├── index.html
│ │ └── app
│ │ │ ├── app.spec.tsx
│ │ │ └── app.tsx
│ ├── .eslintrc
│ ├── proxy.conf.json
│ ├── tsconfig.app.json
│ ├── jest.config.js
│ ├── tsconfig.json
│ ├── tsconfig.spec.json
│ └── browserslist
├── tickets
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── favicon.ico
│ │ ├── main.tsx
│ │ ├── polyfills.ts
│ │ ├── index.html
│ │ └── app
│ │ │ ├── app.spec.tsx
│ │ │ └── app.tsx
│ ├── .eslintrc
│ ├── proxy.conf.json
│ ├── tsconfig.app.json
│ ├── jest.config.js
│ ├── tsconfig.json
│ ├── tsconfig.spec.json
│ └── browserslist
├── agent-e2e
│ ├── .eslintrc
│ ├── src
│ │ ├── support
│ │ │ ├── app.po.ts
│ │ │ ├── index.ts
│ │ │ └── commands.ts
│ │ ├── fixtures
│ │ │ └── example.json
│ │ ├── integration
│ │ │ └── app.spec.ts
│ │ └── plugins
│ │ │ └── index.js
│ ├── tsconfig.json
│ ├── tsconfig.e2e.json
│ └── cypress.json
└── tickets-e2e
│ ├── .eslintrc
│ ├── src
│ ├── support
│ │ ├── app.po.ts
│ │ ├── index.ts
│ │ └── commands.ts
│ ├── fixtures
│ │ └── example.json
│ ├── integration
│ │ └── app.spec.ts
│ └── plugins
│ │ └── index.js
│ ├── tsconfig.json
│ ├── tsconfig.e2e.json
│ └── cypress.json
├── tools
├── schematics
│ └── .gitkeep
└── tsconfig.tools.json
├── .prettierrc
├── .prettierignore
├── README.md
├── .vscode
└── extensions.json
├── .editorconfig
├── jest.config.js
├── .gitignore
├── tsconfig.json
├── nx.json
├── .eslintrc
├── tslint.json
├── package.json
└── workspace.json
/libs/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/apps/api/src/app/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/api/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tools/schematics/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/agent-api/src/app/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/agent/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/tickets/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/agent-api/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true
3 | }
4 |
--------------------------------------------------------------------------------
/libs/data/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/data';
2 |
--------------------------------------------------------------------------------
/apps/agent/.eslintrc:
--------------------------------------------------------------------------------
1 | { "extends": "../../.eslintrc", "rules": {} }
2 |
--------------------------------------------------------------------------------
/apps/api/tslint.json:
--------------------------------------------------------------------------------
1 | { "extends": "../../tslint.json", "rules": [] }
2 |
--------------------------------------------------------------------------------
/apps/tickets/.eslintrc:
--------------------------------------------------------------------------------
1 | { "extends": "../../.eslintrc", "rules": {} }
2 |
--------------------------------------------------------------------------------
/libs/data/tslint.json:
--------------------------------------------------------------------------------
1 | { "extends": "../../tslint.json", "rules": [] }
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Add files here to ignore them from prettier formatting
2 |
--------------------------------------------------------------------------------
/apps/agent-api/tslint.json:
--------------------------------------------------------------------------------
1 | { "extends": "../../tslint.json", "rules": [] }
2 |
--------------------------------------------------------------------------------
/apps/agent-e2e/.eslintrc:
--------------------------------------------------------------------------------
1 | { "extends": "../../.eslintrc", "rules": {} }
2 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/.eslintrc:
--------------------------------------------------------------------------------
1 | { "extends": "../../.eslintrc", "rules": {} }
2 |
--------------------------------------------------------------------------------
/libs/ticket-list/.eslintrc:
--------------------------------------------------------------------------------
1 | { "extends": "../../.eslintrc", "rules": {} }
2 |
--------------------------------------------------------------------------------
/libs/ticket-list/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/ticket-list/ticket-list';
2 |
--------------------------------------------------------------------------------
/apps/agent-e2e/src/support/app.po.ts:
--------------------------------------------------------------------------------
1 | export const getGreeting = () => cy.get('h1');
2 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/src/support/app.po.ts:
--------------------------------------------------------------------------------
1 | export const getGreeting = () => cy.get('h1');
2 |
--------------------------------------------------------------------------------
/libs/data/src/lib/data.ts:
--------------------------------------------------------------------------------
1 | export type Ticket = {
2 | title: string;
3 | id: number;
4 | };
5 |
--------------------------------------------------------------------------------
/apps/api/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/api/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: false
3 | };
4 |
--------------------------------------------------------------------------------
/apps/agent-api/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: false
3 | };
4 |
--------------------------------------------------------------------------------
/apps/agent/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/tickets/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/agent-api/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/agent/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nrwl/full-stack-react-example-app/HEAD/apps/agent/src/favicon.ico
--------------------------------------------------------------------------------
/apps/tickets/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nrwl/full-stack-react-example-app/HEAD/apps/tickets/src/favicon.ico
--------------------------------------------------------------------------------
/apps/tickets/proxy.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "/api": {
3 | "target": "http://localhost:3333",
4 | "secure": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > :warning: Outdated! Head over to [our docs](https://nx.dev/docs) to learn more about how to use Nx in a full-stack setup.
2 |
--------------------------------------------------------------------------------
/apps/agent-e2e/src/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/src/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io"
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "ms-vscode.vscode-typescript-tslint-plugin",
4 | "esbenp.prettier-vscode"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/apps/api/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api',
3 | preset: '../../jest.config.js',
4 | coverageDirectory: '../../coverage/apps/api'
5 | };
6 |
--------------------------------------------------------------------------------
/libs/data/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/agent-api/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'agent-api',
3 | preset: '../../jest.config.js',
4 | coverageDirectory: '../../coverage/apps/agent-api'
5 | };
6 |
--------------------------------------------------------------------------------
/apps/agent-e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["cypress", "node"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest", "express"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["cypress", "node"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/agent-api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest", "express"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/tickets/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 |
4 | import App from './app/app';
5 |
6 | ReactDOM.render(, document.getElementById('root'));
7 |
--------------------------------------------------------------------------------
/libs/data/README.md:
--------------------------------------------------------------------------------
1 | # data
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test data` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/apps/agent-e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "sourceMap": false,
5 | "outDir": "../../dist/out-tsc"
6 | },
7 | "include": ["src/**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "sourceMap": false,
5 | "outDir": "../../dist/out-tsc"
6 | },
7 | "include": ["src/**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/ticket-list/README.md:
--------------------------------------------------------------------------------
1 | # ticket-list
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ticket-list` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/apps/agent/proxy.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "/agent": {
3 | "target": "http://localhost:3334",
4 | "secure": false
5 | },
6 | "/api": {
7 | "target": "http://localhost:3333",
8 | "secure": false
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/apps/agent/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/tickets/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/libs/data/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/agent-api/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/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/agent-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/agent/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 |
--------------------------------------------------------------------------------
/libs/ticket-list/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts", "**/*.spec.tsx"],
8 | "include": ["**/*.ts", "**/*.tsx"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/tickets/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 |
--------------------------------------------------------------------------------
/libs/data/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'data',
3 | preset: '../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../coverage/libs/data'
9 | };
10 |
--------------------------------------------------------------------------------
/tools/tsconfig.tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.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/agent-e2e/src/integration/app.spec.ts:
--------------------------------------------------------------------------------
1 | import { getGreeting } from '../support/app.po';
2 |
3 | describe('agent', () => {
4 | beforeEach(() => cy.visit('/'));
5 |
6 | it('should display welcome message', () => {
7 | getGreeting().contains('Welcome to agent!');
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/apps/agent/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'agent',
3 | preset: '../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../coverage/apps/agent'
9 | };
10 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/src/integration/app.spec.ts:
--------------------------------------------------------------------------------
1 | import { getGreeting } from '../support/app.po';
2 |
3 | describe('tickets', () => {
4 | beforeEach(() => cy.visit('/'));
5 |
6 | it('should display welcome message', () => {
7 | getGreeting().contains('Welcome to tickets!');
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/apps/tickets/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'tickets',
3 | preset: '../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../coverage/apps/tickets'
9 | };
10 |
--------------------------------------------------------------------------------
/libs/ticket-list/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ticket-list',
3 | preset: '../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../coverage/libs/ticket-list'
9 | };
10 |
--------------------------------------------------------------------------------
/.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/agent/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "jsx": "react",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "types": ["node", "jest"]
9 | },
10 | "include": ["**/*.ts", "**/*.tsx"]
11 | }
12 |
--------------------------------------------------------------------------------
/apps/tickets/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "jsx": "react",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "types": ["node", "jest"]
9 | },
10 | "include": ["**/*.ts", "**/*.tsx"]
11 | }
12 |
--------------------------------------------------------------------------------
/libs/ticket-list/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "jsx": "react",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "types": ["node", "jest"]
9 | },
10 | "include": ["**/*.ts", "**/*.tsx"]
11 | }
12 |
--------------------------------------------------------------------------------
/apps/agent/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 | document.getElementById('root')
13 | );
14 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
3 | transform: {
4 | '^.+\\.(ts|js|html)$': 'ts-jest'
5 | },
6 | resolver: '@nrwl/jest/plugins/resolver',
7 | moduleFileExtensions: ['ts', 'js', 'html'],
8 | coverageReporters: ['html'],
9 | passWithNoTests: true
10 | };
11 |
--------------------------------------------------------------------------------
/apps/agent/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 | }
16 |
--------------------------------------------------------------------------------
/libs/data/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 | }
16 |
--------------------------------------------------------------------------------
/apps/tickets/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 | }
16 |
--------------------------------------------------------------------------------
/libs/ticket-list/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 | }
16 |
--------------------------------------------------------------------------------
/apps/agent/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Polyfill stable language features.
3 | * It's recommended to use @babel/preset-env and browserslist
4 | * to only include the polyfills necessary for the target browsers.
5 | */
6 | import 'core-js/stable';
7 |
8 | import 'regenerator-runtime/runtime';
9 |
10 | /**
11 | * This file contains polyfills loaded on all browsers
12 | **/
13 |
--------------------------------------------------------------------------------
/apps/tickets/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Polyfill stable language features.
3 | * It's recommended to use @babel/preset-env and browserslist
4 | * to only include the polyfills necessary for the target browsers.
5 | */
6 | import 'core-js/stable';
7 |
8 | import 'regenerator-runtime/runtime';
9 |
10 | /**
11 | * This file contains polyfills loaded on all browsers
12 | **/
13 |
--------------------------------------------------------------------------------
/apps/agent/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Agent
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/apps/tickets/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Tickets
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/apps/agent-e2e/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileServerFolder": ".",
3 | "fixturesFolder": "./src/fixtures",
4 | "integrationFolder": "./src/integration",
5 | "pluginsFile": "./src/plugins/index",
6 | "supportFile": false,
7 | "video": true,
8 | "videosFolder": "../../dist/cypress/apps/agent-e2e/videos",
9 | "screenshotsFolder": "../../dist/cypress/apps/agent-e2e/screenshots",
10 | "chromeWebSecurity": false
11 | }
12 |
--------------------------------------------------------------------------------
/apps/tickets-e2e/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileServerFolder": ".",
3 | "fixturesFolder": "./src/fixtures",
4 | "integrationFolder": "./src/integration",
5 | "pluginsFile": "./src/plugins/index",
6 | "supportFile": false,
7 | "video": true,
8 | "videosFolder": "../../dist/cypress/apps/tickets-e2e/videos",
9 | "screenshotsFolder": "../../dist/cypress/apps/tickets-e2e/screenshots",
10 | "chromeWebSecurity": false
11 | }
12 |
--------------------------------------------------------------------------------
/libs/ticket-list/src/lib/ticket-list/ticket-list.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render, cleanup } from '@testing-library/react';
3 |
4 | import TicketList from './ticket-list';
5 |
6 | describe(' TicketList', () => {
7 | afterEach(cleanup);
8 |
9 | it('should render successfully', () => {
10 | const { baseElement } = render();
11 | expect(baseElement).toBeTruthy();
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/apps/agent/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/apps/tickets/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/apps/agent-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 |
8 | const app = express();
9 |
10 | app.get('/agent', (req, res) => {
11 | res.send({ name: 'Julie K' });
12 | });
13 |
14 | const port = process.env.port || 3334;
15 | const server = app.listen(port, () => {
16 | console.log(`Listening at http://localhost:${port}/agent`);
17 | });
18 | server.on('error', console.error);
19 |
--------------------------------------------------------------------------------
/libs/ticket-list/src/lib/ticket-list/ticket-list.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import { Ticket } from '@happyorg/data';
4 |
5 | /* tslint:disable:no-empty-interface */
6 | export interface TicketListProps {
7 | tickets: Ticket[];
8 | }
9 |
10 | export const TicketList = (props: TicketListProps) => {
11 | return (
12 | <>
13 | {props.tickets.map(t => (
14 |
15 | {t.title}
16 |
17 | ))}
18 | >
19 | );
20 | };
21 |
22 | export default TicketList;
23 |
--------------------------------------------------------------------------------
/apps/tickets/src/app/app.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render, cleanup } from '@testing-library/react';
3 |
4 | import App from './app';
5 |
6 | describe('App', () => {
7 | afterEach(cleanup);
8 |
9 | it('should render successfully', () => {
10 | const { baseElement } = render();
11 |
12 | expect(baseElement).toBeTruthy();
13 | });
14 |
15 | it('should have a greeting as the title', () => {
16 | const { getByText } = render();
17 |
18 | expect(getByText('Welcome to tickets!')).toBeTruthy();
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/.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/agent-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/tickets-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/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 { Ticket } from '@happyorg/data';
8 |
9 | const app = express();
10 |
11 | const tickets: Ticket[] = [
12 | {
13 | title: `Install updates`,
14 | id: 1
15 | },
16 | {
17 | title: `Restore the backup`,
18 | id: 2
19 | }
20 | ];
21 |
22 | app.get('/api/tickets', (req, res) => {
23 | res.send(tickets);
24 | });
25 |
26 | const port = process.env.port || 3333;
27 | const server = app.listen(port, () => {
28 | console.log(`Listening at http://localhost:${port}/api`);
29 | });
30 | server.on('error', console.error);
31 |
--------------------------------------------------------------------------------
/tsconfig.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 | "@happyorg/data": ["libs/data/src/index.ts"],
20 | "@happyorg/ticket-list": ["libs/ticket-list/src/index.ts"]
21 | }
22 | },
23 | "exclude": ["node_modules", "tmp"]
24 | }
25 |
--------------------------------------------------------------------------------
/apps/agent/src/app/app.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render, cleanup } from '@testing-library/react';
3 |
4 | import { BrowserRouter } from 'react-router-dom';
5 |
6 | import App from './app';
7 |
8 | describe('App', () => {
9 | afterEach(cleanup);
10 |
11 | it('should render successfully', () => {
12 | const { baseElement } = render(
13 |
14 |
15 |
16 | );
17 |
18 | expect(baseElement).toBeTruthy();
19 | });
20 |
21 | it('should have a greeting as the title', () => {
22 | const { getByText } = render(
23 |
24 |
25 |
26 | );
27 |
28 | expect(getByText('Welcome to agent!')).toBeTruthy();
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/nx.json:
--------------------------------------------------------------------------------
1 | {
2 | "npmScope": "happyorg",
3 | "implicitDependencies": {
4 | "workspace.json": "*",
5 | "package.json": "*",
6 | "tsconfig.json": "*",
7 | "tslint.json": "*",
8 | "nx.json": "*"
9 | },
10 | "projects": {
11 | "tickets": {
12 | "implicitDependencies": ["api"],
13 | "tags": []
14 | },
15 | "tickets-e2e": {
16 | "tags": []
17 | },
18 | "api": {
19 | "tags": []
20 | },
21 | "data": {
22 | "tags": []
23 | },
24 | "agent": {
25 | "implicitDependencies": ["api", "agent-api"],
26 | "tags": []
27 | },
28 | "agent-e2e": {
29 | "tags": []
30 | },
31 | "ticket-list": {
32 | "tags": []
33 | },
34 | "agent-api": {
35 | "tags": []
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "parserOptions": {
5 | "ecmaVersion": 2018,
6 | "sourceType": "module",
7 | "project": "./tsconfig.json"
8 | },
9 | "plugins": ["@typescript-eslint"],
10 | "extends": [
11 | "eslint:recommended",
12 | "plugin:@typescript-eslint/eslint-recommended",
13 | "plugin:@typescript-eslint/recommended",
14 | "prettier",
15 | "prettier/@typescript-eslint"
16 | ],
17 | "rules": {
18 | "@typescript-eslint/explicit-member-accessibility": "off",
19 | "@typescript-eslint/explicit-function-return-type": "off",
20 | "@typescript-eslint/no-parameter-properties": "off"
21 | },
22 | "overrides": [
23 | {
24 | "files": ["*.tsx"],
25 | "rules": {
26 | "@typescript-eslint/no-unused-vars": "off"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/apps/agent-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
21 | on('file:preprocessor', preprocessTypescript(config));
22 | };
23 |
--------------------------------------------------------------------------------
/apps/tickets-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
21 | on('file:preprocessor', preprocessTypescript(config));
22 | };
23 |
--------------------------------------------------------------------------------
/apps/agent-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 | //
12 | // -- This is a parent command --
13 | // Cypress.Commands.add("login", (email, password) => { ... })
14 | //
15 | //
16 | // -- This is a child command --
17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18 | //
19 | //
20 | // -- This is a dual command --
21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22 | //
23 | //
24 | // -- This will overwrite an existing command --
25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26 |
--------------------------------------------------------------------------------
/apps/tickets-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 | //
12 | // -- This is a parent command --
13 | // Cypress.Commands.add("login", (email, password) => { ... })
14 | //
15 | //
16 | // -- This is a child command --
17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18 | //
19 | //
20 | // -- This is a dual command --
21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22 | //
23 | //
24 | // -- This will overwrite an existing command --
25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26 |
--------------------------------------------------------------------------------
/apps/tickets/src/app/app.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { Ticket } from '@happyorg/data';
3 | import { TicketList } from '@happyorg/ticket-list';
4 | import styled from 'styled-components';
5 |
6 | const StyledApp = styled.div`
7 | font-family: sans-serif;
8 | min-width: 300px;
9 | max-width: 600px;
10 | margin: 50px auto;
11 |
12 | .flex {
13 | display: flex;
14 | align-items: center;
15 | justify-content: center;
16 | }
17 |
18 | header {
19 | background-color: #143055;
20 | color: white;
21 | padding: 5px;
22 | border-radius: 3px;
23 | }
24 |
25 | main {
26 | padding: 0 36px;
27 | }
28 |
29 | h1 {
30 | text-align: center;
31 | margin-left: 18px;
32 | font-size: 24px;
33 | }
34 |
35 | .ticket {
36 | color: #0094ba;
37 | height: 36px;
38 | background-color: rgba(0, 0, 0, 0);
39 | border: 1px solid rgba(0, 0, 0, 0.12);
40 | border-radius: 4px;
41 | }
42 | `;
43 |
44 | export const App = () => {
45 | const [tickets, setTickets] = useState([]);
46 |
47 | useEffect(() => {
48 | fetch('/api/tickets')
49 | .then(t => t.json())
50 | .then(setTickets);
51 | }, []);
52 |
53 | return (
54 |
55 |
56 | Welcome to tickets!
57 |
58 |
59 |
60 |
61 |
62 | );
63 | };
64 |
65 | export default App;
66 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": ["node_modules/@nrwl/workspace/src/tslint"],
3 | "rules": {
4 | "arrow-return-shorthand": true,
5 | "callable-types": true,
6 | "class-name": true,
7 | "deprecation": {
8 | "severity": "warn"
9 | },
10 | "forin": true,
11 | "import-blacklist": [true, "rxjs/Rx"],
12 | "interface-over-type-literal": true,
13 | "member-access": false,
14 | "member-ordering": [
15 | true,
16 | {
17 | "order": [
18 | "static-field",
19 | "instance-field",
20 | "static-method",
21 | "instance-method"
22 | ]
23 | }
24 | ],
25 | "no-arg": true,
26 | "no-bitwise": true,
27 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
28 | "no-construct": true,
29 | "no-debugger": true,
30 | "no-duplicate-super": true,
31 | "no-empty": false,
32 | "no-empty-interface": true,
33 | "no-eval": true,
34 | "no-inferrable-types": [true, "ignore-params"],
35 | "no-misused-new": true,
36 | "no-non-null-assertion": true,
37 | "no-shadowed-variable": true,
38 | "no-string-literal": false,
39 | "no-string-throw": true,
40 | "no-switch-case-fall-through": true,
41 | "no-unnecessary-initializer": true,
42 | "no-unused-expression": true,
43 | "no-var-keyword": true,
44 | "object-literal-sort-keys": false,
45 | "prefer-const": true,
46 | "radix": true,
47 | "triple-equals": [true, "allow-null-check"],
48 | "unified-signatures": true,
49 | "variable-name": false,
50 |
51 | "nx-enforce-module-boundaries": [
52 | true,
53 | {
54 | "allow": [],
55 | "depConstraints": [
56 | { "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
57 | ]
58 | }
59 | ]
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/apps/agent/src/app/app.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { Ticket } from '@happyorg/data';
3 | import { TicketList } from '@happyorg/ticket-list';
4 | import styled from 'styled-components';
5 |
6 | const StyledApp = styled.div`
7 | font-family: sans-serif;
8 | min-width: 300px;
9 | max-width: 600px;
10 | margin: 50px auto;
11 |
12 | .flex {
13 | display: flex;
14 | align-items: center;
15 | justify-content: center;
16 | }
17 |
18 | header {
19 | background-color: #143055;
20 | color: white;
21 | padding: 5px;
22 | border-radius: 3px;
23 | }
24 |
25 | main {
26 | padding: 0 36px;
27 | }
28 |
29 | h1 {
30 | text-align: center;
31 | margin-left: 18px;
32 | font-size: 24px;
33 | }
34 |
35 | .ticket {
36 | color: #0094ba;
37 | height: 36px;
38 | background-color: rgba(0, 0, 0, 0);
39 | border: 1px solid rgba(0, 0, 0, 0.12);
40 | border-radius: 4px;
41 | }
42 | `;
43 |
44 | export const App = () => {
45 | const [tickets, setTickets] = useState([]);
46 | const [agentName, setAgentName] = useState<{ name: string }>({ name: '' });
47 |
48 | useEffect(() => {
49 | fetch('/api/tickets')
50 | .then(t => t.json())
51 | .then(setTickets);
52 | }, []);
53 |
54 | useEffect(() => {
55 | fetch('/agent')
56 | .then(t => t.json())
57 | .then(setAgentName);
58 | }, []);
59 |
60 | return (
61 |
62 |
63 | Welcome to agent!
64 |
65 |
66 |
67 |
68 |
69 | Agent {agentName.name}
70 |
71 |
72 |
73 |
74 | );
75 | };
76 |
77 | export default App;
78 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "happyorg",
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 | "workspace-schematic": "nx workspace-schematic",
24 | "dep-graph": "nx dep-graph",
25 | "help": "nx help"
26 | },
27 | "private": true,
28 | "dependencies": {
29 | "document-register-element": "1.13.1",
30 | "react": "16.8.6",
31 | "react-dom": "16.8.6",
32 | "styled-components": "4.3.2",
33 | "express": "4.16.3",
34 | "react-router-dom": "5.0.1"
35 | },
36 | "devDependencies": {
37 | "@nrwl/workspace": "8.4.6",
38 | "@nrwl/express": "8.4.6",
39 | "@types/node": "~8.9.4",
40 | "dotenv": "6.2.0",
41 | "ts-node": "~7.0.0",
42 | "tslint": "~5.11.0",
43 | "typescript": "~3.4.5",
44 | "prettier": "1.16.4",
45 | "@nrwl/react": "8.4.6",
46 | "@nrwl/jest": "8.4.6",
47 | "jest": "24.1.0",
48 | "@types/jest": "24.0.9",
49 | "ts-jest": "24.0.0",
50 | "cypress": "3.4.0",
51 | "@nrwl/cypress": "8.4.6",
52 | "@nrwl/web": "8.4.6",
53 | "@types/react": "16.8.23",
54 | "@types/react-dom": "16.8.5",
55 | "@testing-library/react": "8.0.5",
56 | "@typescript-eslint/parser": "2.0.0-alpha.4",
57 | "@typescript-eslint/eslint-plugin": "2.0.0-alpha.4",
58 | "eslint": "6.1.0",
59 | "eslint-config-prettier": "6.0.0",
60 | "@types/styled-components": "4.1.18",
61 | "@babel/core": "7.5.5",
62 | "@babel/preset-env": "7.5.5",
63 | "@babel/preset-react": "7.0.0",
64 | "@babel/preset-typescript": "7.3.3",
65 | "@babel/plugin-proposal-decorators": "7.4.4",
66 | "babel-loader": "8.0.6",
67 | "babel-plugin-macros": "2.6.1",
68 | "core-js": "3.1.4",
69 | "regenerator-runtime": "0.13.3",
70 | "@nrwl/node": "8.4.6",
71 | "@types/express": "4.16.0"
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/workspace.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "projects": {
4 | "tickets": {
5 | "root": "apps/tickets",
6 | "sourceRoot": "apps/tickets/src",
7 | "projectType": "application",
8 | "schematics": {},
9 | "architect": {
10 | "build": {
11 | "builder": "@nrwl/web:build",
12 | "options": {
13 | "differentialLoading": false,
14 | "outputPath": "dist/apps/tickets",
15 | "index": "apps/tickets/src/index.html",
16 | "main": "apps/tickets/src/main.tsx",
17 | "polyfills": "apps/tickets/src/polyfills.ts",
18 | "tsConfig": "apps/tickets/tsconfig.app.json",
19 | "assets": [
20 | "apps/tickets/src/favicon.ico",
21 | "apps/tickets/src/assets"
22 | ],
23 | "styles": [],
24 | "scripts": [],
25 | "webpackConfig": "@nrwl/react/plugins/babel"
26 | },
27 | "configurations": {
28 | "production": {
29 | "fileReplacements": [
30 | {
31 | "replace": "apps/tickets/src/environments/environment.ts",
32 | "with": "apps/tickets/src/environments/environment.prod.ts"
33 | }
34 | ],
35 | "optimization": true,
36 | "outputHashing": "all",
37 | "sourceMap": false,
38 | "extractCss": true,
39 | "namedChunks": false,
40 | "extractLicenses": true,
41 | "vendorChunk": false,
42 | "budgets": [
43 | {
44 | "type": "initial",
45 | "maximumWarning": "2mb",
46 | "maximumError": "5mb"
47 | }
48 | ]
49 | }
50 | }
51 | },
52 | "serve": {
53 | "builder": "@nrwl/web:dev-server",
54 | "options": {
55 | "buildTarget": "tickets:build",
56 | "proxyConfig": "apps/tickets/proxy.conf.json"
57 | },
58 | "configurations": {
59 | "production": {
60 | "buildTarget": "tickets:build:production"
61 | }
62 | }
63 | },
64 | "lint": {
65 | "builder": "@nrwl/linter:lint",
66 | "options": {
67 | "linter": "eslint",
68 | "config": "apps/tickets/.eslintrc",
69 | "tsConfig": [
70 | "apps/tickets/tsconfig.app.json",
71 | "apps/tickets/tsconfig.spec.json"
72 | ],
73 | "exclude": ["**/node_modules/**", "!apps/tickets/**"]
74 | }
75 | },
76 | "test": {
77 | "builder": "@nrwl/jest:jest",
78 | "options": {
79 | "jestConfig": "apps/tickets/jest.config.js",
80 | "tsConfig": "apps/tickets/tsconfig.spec.json"
81 | }
82 | }
83 | }
84 | },
85 | "tickets-e2e": {
86 | "root": "apps/tickets-e2e",
87 | "sourceRoot": "apps/tickets-e2e/src",
88 | "projectType": "application",
89 | "architect": {
90 | "e2e": {
91 | "builder": "@nrwl/cypress:cypress",
92 | "options": {
93 | "cypressConfig": "apps/tickets-e2e/cypress.json",
94 | "tsConfig": "apps/tickets-e2e/tsconfig.e2e.json",
95 | "devServerTarget": "tickets:serve"
96 | },
97 | "configurations": {
98 | "production": {
99 | "devServerTarget": "tickets:serve:production"
100 | }
101 | }
102 | },
103 | "lint": {
104 | "builder": "@nrwl/linter:lint",
105 | "options": {
106 | "linter": "eslint",
107 | "config": "apps/tickets-e2e/.eslintrc",
108 | "tsConfig": ["apps/tickets-e2e/tsconfig.e2e.json"],
109 | "exclude": ["**/node_modules/**", "!apps/tickets-e2e/**"]
110 | }
111 | }
112 | }
113 | },
114 | "api": {
115 | "root": "apps/api",
116 | "sourceRoot": "apps/api/src",
117 | "projectType": "application",
118 | "prefix": "api",
119 | "schematics": {},
120 | "architect": {
121 | "build": {
122 | "builder": "@nrwl/node:build",
123 | "options": {
124 | "outputPath": "dist/apps/api",
125 | "main": "apps/api/src/main.ts",
126 | "tsConfig": "apps/api/tsconfig.app.json",
127 | "assets": ["apps/api/src/assets"]
128 | },
129 | "configurations": {
130 | "production": {
131 | "optimization": true,
132 | "extractLicenses": true,
133 | "inspect": false,
134 | "fileReplacements": [
135 | {
136 | "replace": "apps/api/src/environments/environment.ts",
137 | "with": "apps/api/src/environments/environment.prod.ts"
138 | }
139 | ]
140 | }
141 | }
142 | },
143 | "serve": {
144 | "builder": "@nrwl/node:execute",
145 | "options": {
146 | "buildTarget": "api:build"
147 | }
148 | },
149 | "lint": {
150 | "builder": "@nrwl/linter:lint",
151 | "options": {
152 | "linter": "tslint",
153 | "tsConfig": [
154 | "apps/api/tsconfig.app.json",
155 | "apps/api/tsconfig.spec.json"
156 | ],
157 | "exclude": ["**/node_modules/**", "!apps/api/**"]
158 | }
159 | },
160 | "test": {
161 | "builder": "@nrwl/jest:jest",
162 | "options": {
163 | "jestConfig": "apps/api/jest.config.js",
164 | "tsConfig": "apps/api/tsconfig.spec.json"
165 | }
166 | }
167 | }
168 | },
169 | "data": {
170 | "root": "libs/data",
171 | "sourceRoot": "libs/data/src",
172 | "projectType": "library",
173 | "schematics": {},
174 | "architect": {
175 | "lint": {
176 | "builder": "@nrwl/linter:lint",
177 | "options": {
178 | "linter": "tslint",
179 | "tsConfig": [
180 | "libs/data/tsconfig.lib.json",
181 | "libs/data/tsconfig.spec.json"
182 | ],
183 | "exclude": ["**/node_modules/**", "!libs/data/**"]
184 | }
185 | },
186 | "test": {
187 | "builder": "@nrwl/jest:jest",
188 | "options": {
189 | "jestConfig": "libs/data/jest.config.js",
190 | "tsConfig": "libs/data/tsconfig.spec.json"
191 | }
192 | }
193 | }
194 | },
195 | "agent": {
196 | "root": "apps/agent",
197 | "sourceRoot": "apps/agent/src",
198 | "projectType": "application",
199 | "schematics": {},
200 | "architect": {
201 | "build": {
202 | "builder": "@nrwl/web:build",
203 | "options": {
204 | "differentialLoading": false,
205 | "outputPath": "dist/apps/agent",
206 | "index": "apps/agent/src/index.html",
207 | "main": "apps/agent/src/main.tsx",
208 | "polyfills": "apps/agent/src/polyfills.ts",
209 | "tsConfig": "apps/agent/tsconfig.app.json",
210 | "assets": ["apps/agent/src/favicon.ico", "apps/agent/src/assets"],
211 | "styles": [],
212 | "scripts": [],
213 | "webpackConfig": "@nrwl/react/plugins/babel"
214 | },
215 | "configurations": {
216 | "production": {
217 | "fileReplacements": [
218 | {
219 | "replace": "apps/agent/src/environments/environment.ts",
220 | "with": "apps/agent/src/environments/environment.prod.ts"
221 | }
222 | ],
223 | "optimization": true,
224 | "outputHashing": "all",
225 | "sourceMap": false,
226 | "extractCss": true,
227 | "namedChunks": false,
228 | "extractLicenses": true,
229 | "vendorChunk": false,
230 | "budgets": [
231 | {
232 | "type": "initial",
233 | "maximumWarning": "2mb",
234 | "maximumError": "5mb"
235 | }
236 | ]
237 | }
238 | }
239 | },
240 | "serve": {
241 | "builder": "@nrwl/web:dev-server",
242 | "options": {
243 | "buildTarget": "agent:build",
244 | "proxyConfig": "apps/agent/proxy.conf.json",
245 | "port": 4201
246 | },
247 | "configurations": {
248 | "production": {
249 | "buildTarget": "agent:build:production"
250 | }
251 | }
252 | },
253 | "lint": {
254 | "builder": "@nrwl/linter:lint",
255 | "options": {
256 | "linter": "eslint",
257 | "config": "apps/agent/.eslintrc",
258 | "tsConfig": [
259 | "apps/agent/tsconfig.app.json",
260 | "apps/agent/tsconfig.spec.json"
261 | ],
262 | "exclude": ["**/node_modules/**", "!apps/agent/**"]
263 | }
264 | },
265 | "test": {
266 | "builder": "@nrwl/jest:jest",
267 | "options": {
268 | "jestConfig": "apps/agent/jest.config.js",
269 | "tsConfig": "apps/agent/tsconfig.spec.json"
270 | }
271 | }
272 | }
273 | },
274 | "agent-e2e": {
275 | "root": "apps/agent-e2e",
276 | "sourceRoot": "apps/agent-e2e/src",
277 | "projectType": "application",
278 | "architect": {
279 | "e2e": {
280 | "builder": "@nrwl/cypress:cypress",
281 | "options": {
282 | "cypressConfig": "apps/agent-e2e/cypress.json",
283 | "tsConfig": "apps/agent-e2e/tsconfig.e2e.json",
284 | "devServerTarget": "agent:serve"
285 | },
286 | "configurations": {
287 | "production": {
288 | "devServerTarget": "agent:serve:production"
289 | }
290 | }
291 | },
292 | "lint": {
293 | "builder": "@nrwl/linter:lint",
294 | "options": {
295 | "linter": "eslint",
296 | "config": "apps/agent-e2e/.eslintrc",
297 | "tsConfig": ["apps/agent-e2e/tsconfig.e2e.json"],
298 | "exclude": ["**/node_modules/**", "!apps/agent-e2e/**"]
299 | }
300 | }
301 | }
302 | },
303 | "ticket-list": {
304 | "root": "libs/ticket-list",
305 | "sourceRoot": "libs/ticket-list/src",
306 | "projectType": "library",
307 | "schematics": {},
308 | "architect": {
309 | "lint": {
310 | "builder": "@nrwl/linter:lint",
311 | "options": {
312 | "linter": "eslint",
313 | "config": "libs/ticket-list/.eslintrc",
314 | "tsConfig": [
315 | "libs/ticket-list/tsconfig.lib.json",
316 | "libs/ticket-list/tsconfig.spec.json"
317 | ],
318 | "exclude": ["**/node_modules/**", "!libs/ticket-list/**"]
319 | }
320 | },
321 | "test": {
322 | "builder": "@nrwl/jest:jest",
323 | "options": {
324 | "jestConfig": "libs/ticket-list/jest.config.js",
325 | "tsConfig": "libs/ticket-list/tsconfig.spec.json"
326 | }
327 | }
328 | }
329 | },
330 | "agent-api": {
331 | "root": "apps/agent-api",
332 | "sourceRoot": "apps/agent-api/src",
333 | "projectType": "application",
334 | "prefix": "agent-api",
335 | "schematics": {},
336 | "architect": {
337 | "build": {
338 | "builder": "@nrwl/node:build",
339 | "options": {
340 | "outputPath": "dist/apps/agent-api",
341 | "main": "apps/agent-api/src/main.ts",
342 | "tsConfig": "apps/agent-api/tsconfig.app.json",
343 | "assets": ["apps/agent-api/src/assets"]
344 | },
345 | "configurations": {
346 | "production": {
347 | "optimization": true,
348 | "extractLicenses": true,
349 | "inspect": false,
350 | "fileReplacements": [
351 | {
352 | "replace": "apps/agent-api/src/environments/environment.ts",
353 | "with": "apps/agent-api/src/environments/environment.prod.ts"
354 | }
355 | ]
356 | }
357 | }
358 | },
359 | "serve": {
360 | "builder": "@nrwl/node:execute",
361 | "options": {
362 | "buildTarget": "agent-api:build",
363 | "inspect": false
364 | }
365 | },
366 | "lint": {
367 | "builder": "@nrwl/linter:lint",
368 | "options": {
369 | "linter": "tslint",
370 | "tsConfig": [
371 | "apps/agent-api/tsconfig.app.json",
372 | "apps/agent-api/tsconfig.spec.json"
373 | ],
374 | "exclude": ["**/node_modules/**", "!apps/agent-api/**"]
375 | }
376 | },
377 | "test": {
378 | "builder": "@nrwl/jest:jest",
379 | "options": {
380 | "jestConfig": "apps/agent-api/jest.config.js",
381 | "tsConfig": "apps/agent-api/tsconfig.spec.json"
382 | }
383 | }
384 | }
385 | }
386 | },
387 | "cli": {
388 | "defaultCollection": "@nrwl/react"
389 | },
390 | "schematics": {
391 | "@nrwl/react:application": {
392 | "babel": true
393 | },
394 | "@nrwl/workspace": {
395 | "application": {
396 | "linter": "eslint"
397 | }
398 | },
399 | "@nrwl/cypress": {
400 | "cypress-project": {
401 | "linter": "eslint"
402 | }
403 | },
404 | "@nrwl/react": {
405 | "application": {
406 | "linter": "eslint"
407 | },
408 | "library": {
409 | "linter": "eslint"
410 | }
411 | },
412 | "@nrwl/web": {
413 | "application": {
414 | "linter": "eslint"
415 | }
416 | },
417 | "@nrwl/node": {
418 | "application": {
419 | "linter": "eslint"
420 | }
421 | },
422 | "@nrwl/nest": {
423 | "application": {
424 | "linter": "eslint"
425 | }
426 | }
427 | },
428 | "defaultProject": "tickets"
429 | }
430 |
--------------------------------------------------------------------------------