Skip to content

Commit f6ca0bf

Browse files
committed
feat: presentation comments and likes
1 parent 4afd2be commit f6ca0bf

File tree

109 files changed

+19115
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+19115
-231
lines changed

.eslintrc.json

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,64 @@
1313
"allow": [],
1414
"depConstraints": [
1515
{
16-
"sourceTag": "*",
17-
"onlyDependOnLibsWithTags": ["*"]
16+
"sourceTag": "type:util",
17+
"onlyDependOnLibsWithTags": ["type:util"]
18+
},
19+
{
20+
"sourceTag": "type:domain",
21+
"onlyDependOnLibsWithTags": ["type:util", "type:api"]
22+
},
23+
{
24+
"sourceTag": "type:data-source",
25+
"onlyDependOnLibsWithTags": [
26+
"type:util",
27+
"type:domain",
28+
"type:api"
29+
]
30+
},
31+
{
32+
"sourceTag": "type:data-access",
33+
"onlyDependOnLibsWithTags": [
34+
"type:util",
35+
"type:domain",
36+
"type:api"
37+
]
38+
},
39+
{
40+
"sourceTag": "type:resource",
41+
"onlyDependOnLibsWithTags": [
42+
"type:util",
43+
"type:data-source",
44+
"type:resource"
45+
]
46+
},
47+
{
48+
"sourceTag": "type:feature",
49+
"onlyDependOnLibsWithTags": [
50+
"type:util",
51+
"type:data-access",
52+
"type:feature"
53+
]
54+
},
55+
{
56+
"sourceTag": "type:app",
57+
"onlyDependOnLibsWithTags": [
58+
"type:util",
59+
"type:data-source",
60+
"type:resource",
61+
"type:feature"
62+
]
63+
},
64+
{
65+
"sourceTag": "type:api",
66+
"onlyDependOnLibsWithTags": [
67+
"type:util",
68+
"type:domain",
69+
"type:data-source",
70+
"type:resource",
71+
"type:feature",
72+
"type:api"
73+
]
1874
}
1975
]
2076
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ Thumbs.db
4141
.nx/cache
4242
.nx/workspace-data
4343
.env
44+
45+
.angular

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/dist
33
/coverage
44
/.nx/cache
5-
/.nx/workspace-data
5+
/.nx/workspace-data
6+
.angular

README.md

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,52 @@
11
# Platform
22

3-
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
3+
Plataforma da comunidade DevParaná que além de cumprir sua missão como software, também ensina sobre software.
44

5-
✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.
5+
Encontraremos conceitos essenciais para desenvolver software de qualidade, fazendo conexões entre conceitos teóricos e aplicações práticas.
66

7-
[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/intro#learn-nx?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
7+
## Responsabilidades e relacionamentos
88

9-
## Finish your CI setup
9+
Trata-se de responsabilidade e relacionamentos, ou seja, qual a responsabilidade de cada camada e quais camadas podem depender diretamente uma das outras. Na tabela a seguir vemos que camadas do tipo `util` podem depender apenas de camadas que também sejam do tipo `util`, camadas do tipo `domain` podem depender apenas de camadas do tipo `util`, camadas do tipo `data-source` podem depender apenas dos tipos `util` e `domain` e assim por diante.
1010

11-
[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/8GO6xKrjst)
11+
Caso tenha interesse em aprofundar neste assunto e descobrir os motivos, recomendo que leia um conteúdo que escrevi ano passado, você pode fazer download através do link a seguir. [Arquitetura em camadas, uma abordagem sobre responsabilidades e relacionamentos](https://conteudode.dev/pdf/nx)
1212

13+
| | util | domain | data-source | data-access | resource | feature | app | api |
14+
| ------------: | :--: | :----: | :---------: | :---------: | :------: | :-----: | :-: | :-: |
15+
| `util` |||||||||
16+
| `domain` | 𝗫 | 𝗫 ||| 𝗫 | 𝗫 | 𝗫 ||
17+
| `data-source` | 𝗫 | 𝗫 | 𝗫 | 𝗫 || 𝗫 |||
18+
| `data-access` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 ||||
19+
| `resource` | 𝗫 | 𝗫 | 𝗫 | 𝗫 || 𝗫 |||
20+
| `feature` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 ||||
21+
| `app` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 |
22+
| `api` | 𝗫 | 𝗫 ||| 𝗫 ||||
1323

14-
## Run tasks
24+
## Conceitos
1525

16-
To run tasks with Nx use:
26+
### SOLID
1727

18-
```sh
19-
npx nx <target> <project-name>
20-
```
28+
1. **Single Responsibility Principle** ou Princípio da Responsabilidade Única diz que uma classe deve ter apenas uma única responsabilidade e assim, um único motivo para mudar.
2129

22-
For example:
30+
1. **Open-Closed Principle** ou Princípio do Aberto-Fechado diz que uma classe deve estar aberta para novos cenários, mas fechada para modificação.
2331

24-
```sh
25-
npx nx build myproject
26-
```
32+
1. **Liskov Substitution Principle** ou Princípio da Substituição de Liskov diz que os objetos de uma classe derivada devem ser substituíveis por objetos de sua classe base sem alterar o comportamento do software.
2733

28-
These targets are either [inferred automatically](https://nx.dev/concepts/inferred-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or defined in the `project.json` or `package.json` files.
34+
1. **Interface Segregation Principle** ou Princípio da Segregação de Interface diz que interfaces devem ser separadas para que classes possam depender apenas dos métodos que utilizam.
2935

30-
[More about running tasks in the docs &raquo;](https://nx.dev/features/run-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
36+
1. **Dependency Inversion Principle** ou Princípio da Inversão de Dependência diz que módulos de alto nível não devem depender de módulos de baixo nível. Ambos devem depender de abstrações.
3137

32-
## Add new projects
38+
### Conceitos aplicados
3339

34-
While you could add new projects to your workspace manually, you might want to leverage [Nx plugins](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) and their [code generation](https://nx.dev/features/generate-code?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) feature.
40+
#### Liskov Substitution Principle
3541

36-
To install a new plugin you can use the `nx add` command. Here's an example of adding the React plugin:
37-
```sh
38-
npx nx add @nx/react
39-
```
42+
- A função [`provideCryptoService`](packages/data-source-account/src/lib/providers/crypto.ts) aplica este princípio permitindo a possibilidade de substituição da classe abstrata [`CryptoService`](packages/domain-account/src/lib/ports/crypto.service.ts) por outra, no nosso caso, está sendo substituída pela classe [`CryptoServiceImpl`](packages/data-source-account/src/lib/services/crypto.ts), do arquivo [`providers.ts`](packages/data-source-account/src/lib/providers.ts)
4043

41-
Use the plugin's generator to create new projects. For example, to create a new React app or library:
44+
```ts
45+
const dataSourceAccountProviders: Provider[] = [
46+
// ...
4247

43-
```sh
44-
# Genenerate an app
45-
npx nx g @nx/react:app demo
48+
provideCryptoService(CryptoServiceImpl),
4649

47-
# Generate a library
48-
npx nx g @nx/react:lib some-lib
50+
// ...
51+
];
4952
```
50-
51-
You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx list <plugin-name>` to learn about more specific capabilities of a particular plugin. Alternatively, [install Nx Console](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) to browse plugins and generators in your IDE.
52-
53-
[Learn more about Nx plugins &raquo;](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) | [Browse the plugin registry &raquo;](https://nx.dev/plugin-registry?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
54-
55-
56-
[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
57-
58-
## Install Nx Console
59-
60-
Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.
61-
62-
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
63-
64-
## Useful links
65-
66-
Learn more:
67-
68-
- [Learn more about this workspace setup](https://nx.dev/getting-started/intro#learn-nx?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects)
69-
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
70-
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
71-
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
72-
73-
And join the Nx community:
74-
- [Discord](https://go.nx.dev/community)
75-
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
76-
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
77-
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

apps/platform/.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "devpr",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "devpr",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}

apps/platform/jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'platform',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../coverage/apps/platform',
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};

apps/platform/project.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"name": "platform",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"prefix": "devpr",
6+
"sourceRoot": "apps/platform/src",
7+
"tags": ["type:app"],
8+
"targets": {
9+
"build": {
10+
"executor": "@angular-devkit/build-angular:application",
11+
"outputs": ["{options.outputPath}"],
12+
"options": {
13+
"outputPath": "dist/apps/platform",
14+
"index": "apps/platform/src/index.html",
15+
"browser": "apps/platform/src/main.ts",
16+
"polyfills": ["zone.js"],
17+
"tsConfig": "apps/platform/tsconfig.app.json",
18+
"inlineStyleLanguage": "scss",
19+
"assets": [
20+
{
21+
"glob": "**/*",
22+
"input": "apps/platform/public"
23+
}
24+
],
25+
"styles": ["apps/platform/src/styles.scss"],
26+
"scripts": []
27+
},
28+
"configurations": {
29+
"production": {
30+
"budgets": [
31+
{
32+
"type": "initial",
33+
"maximumWarning": "500kb",
34+
"maximumError": "1mb"
35+
},
36+
{
37+
"type": "anyComponentStyle",
38+
"maximumWarning": "2kb",
39+
"maximumError": "4kb"
40+
}
41+
],
42+
"outputHashing": "all"
43+
},
44+
"development": {
45+
"optimization": false,
46+
"extractLicenses": false,
47+
"sourceMap": true
48+
}
49+
},
50+
"defaultConfiguration": "production"
51+
},
52+
"serve": {
53+
"executor": "@angular-devkit/build-angular:dev-server",
54+
"configurations": {
55+
"production": {
56+
"buildTarget": "platform:build:production"
57+
},
58+
"development": {
59+
"buildTarget": "platform:build:development"
60+
}
61+
},
62+
"defaultConfiguration": "development",
63+
"options": {
64+
"proxyConfig": "apps/platform/proxy.conf.json"
65+
}
66+
},
67+
"extract-i18n": {
68+
"executor": "@angular-devkit/build-angular:extract-i18n",
69+
"options": {
70+
"buildTarget": "platform:build"
71+
}
72+
},
73+
"lint": {
74+
"executor": "@nx/eslint:lint"
75+
},
76+
"test": {
77+
"executor": "@nx/jest:jest",
78+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
79+
"options": {
80+
"jestConfig": "apps/platform/jest.config.ts"
81+
}
82+
},
83+
"serve-static": {
84+
"executor": "@nx/web:file-server",
85+
"options": {
86+
"buildTarget": "platform:build",
87+
"port": 4200,
88+
"staticFilePath": "dist/apps/platform/browser",
89+
"spa": true
90+
}
91+
}
92+
}
93+
}

apps/platform/proxy.conf.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"/server": {
3+
"target": "http://localhost:3333",
4+
"secure": false
5+
}
6+
}

0 commit comments

Comments
 (0)