Skip to content

Commit 50603d8

Browse files
committed
refactor: melhorias de interface
1 parent 64f48c3 commit 50603d8

File tree

82 files changed

+1077
-238
lines changed

Some content is hidden

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

82 files changed

+1077
-238
lines changed

.env-example

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PORT=3000
2+
3+
DB_HOST=localhost
4+
DB_PORT=27017
5+
DB_NAME=devparana
6+
DB_USER=
7+
DB_PASS=
8+
9+
JWT_SECRET=

README.md

+43-47
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,73 @@
1-
# Devmx
2-
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>
4-
5-
✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.
6-
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!
1+
```
2+
_
3+
__| | _____ ___ __ ___ __ __
4+
/ _` |/ _ \ \ / / '_ ` _ \\ \/ /
5+
| (_| | __/\ V /| | | | | |> <
6+
\__,_|\___| \_/ |_| |_| |_/_/\_\
7+
```
8+
# dev member experience
89

9-
## Finish your CI setup
1010

11-
[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/MMUTh7bF3w)
11+
## Para executar em dev
1212

13+
### Requisitos
14+
1. [pnpm](https://pnpm.io/installation) instalado
15+
1. [docker](https://docs.docker.com/engine/install) instalado
1316

14-
## Run tasks
17+
### Configurações
1518

16-
To run tasks with Nx use:
19+
Clone o projeto
1720

1821
```sh
19-
npx nx <target> <project-name>
22+
git clone https://github.com/DeveloperParana/devmx
2023
```
2124

22-
For example:
25+
Configure a senha do banco e segredo jwt como quiser para uso local
2326

2427
```sh
25-
npx nx build myproject
28+
mv .env-example .env
2629
```
2730

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.
29-
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)
31-
32-
## Add new projects
31+
Preencha os valores para `DB_USER`, `DB_PASS`, `JWT_SECRET` e salve antes de executar o docker.
3332

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.
35-
36-
To install a new plugin you can use the `nx add` command. Here's an example of adding the React plugin:
3733
```sh
38-
npx nx add @nx/react
34+
docker compose up -d
3935
```
4036

41-
Use the plugin's generator to create new projects. For example, to create a new React app or library:
37+
Instale as dependências
4238

4339
```sh
44-
# Genenerate an app
45-
npx nx g @nx/react:app demo
46-
47-
# Generate a library
48-
npx nx g @nx/react:lib some-lib
40+
pnpm install
4941
```
5042

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)
43+
Execute o back-end e front-end
5444

45+
```sh
46+
pnpm dev
47+
```
5548

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)
49+
## Para commits
5750

58-
## Install Nx Console
51+
```sh
52+
pnpm cmt
53+
```
5954

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.
55+
Responda as perguntas para fazer o commit.
6156

62-
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
6357

64-
## Useful links
58+
## Responsabilidades e relacionamentos
6559

66-
Learn more:
60+
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` e `api`, camadas do tipo `data-source` podem depender apenas dos tipos `util`, `domain` e `api`, e assim por diante...
6761

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)
62+
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)
7263

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)
64+
| | util | domain | data-source | data-access | resource | feature | app | api |
65+
| ------------: | :--: | :----: | :---------: | :---------: | :------: | :-----: | :-: | :-: |
66+
| `util` |||||||||
67+
| `domain` | 𝗫 | 𝗫 ||| 𝗫 | 𝗫 | 𝗫 ||
68+
| `data-source` | 𝗫 | 𝗫 | 𝗫 | 𝗫 || 𝗫 |||
69+
| `data-access` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 ||||
70+
| `resource` | 𝗫 | 𝗫 | 𝗫 | 𝗫 || 𝗫 |||
71+
| `feature` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 ||||
72+
| `app` | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 | 𝗫 |
73+
| `api` | 𝗫 ||||||||

apps/devmx/proxy.conf.json

+4
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"/api": {
33
"target": "http://localhost:3000",
44
"secure": false
5+
},
6+
"/photos": {
7+
"target": "http://localhost:3000",
8+
"secure": false
59
}
610
}
+10
Loading

apps/devmx/src/app/app.config.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
22
import { provideEnv, provideHttpClientImpl } from '@devmx/shared-data-access';
3-
import { provideRouter, withViewTransitions } from '@angular/router';
3+
import { provideRouter, withRouterConfig, withViewTransitions } from '@angular/router';
44
import { registerLocaleData } from '@angular/common';
55
import { authInterceptor } from './interceptors';
66
import ptBr from '@angular/common/locales/extra/br';
@@ -26,7 +26,9 @@ registerLocaleData(pt, 'pt-BR', ptBr);
2626
export const appConfig: ApplicationConfig = {
2727
providers: [
2828
provideZoneChangeDetection({ eventCoalescing: true }),
29-
provideRouter(appRoutes, withViewTransitions()),
29+
provideRouter(appRoutes, withViewTransitions(), withRouterConfig({
30+
urlUpdateStrategy: 'eager'
31+
})),
3032
provideAnimationsAsync(),
3133
{
3234
provide: LOCALE_ID,

apps/devmx/src/envs/env.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ export const env = {
22
api: {
33
url: '/api',
44
},
5+
photos: {
6+
url: '/photos'
7+
}
58
};

apps/devmx/src/scss/_theme.scss

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
@use '@angular/material' as mat;
33
// Plus imports for other components in your app.
44

5+
body {
6+
--mdc-filled-button-container-color: #39b44d;
7+
}
8+
59
// Include the common styles for Angular Material. We include this here so that you only
610
// have to load a single css file for Angular Material in your app.
711
// Be sure that you only ever include this mixin once!
@@ -12,8 +16,8 @@ $light: mat.define-theme(
1216
(
1317
color: (
1418
theme-type: light,
15-
primary: mat.$azure-palette,
16-
tertiary: mat.$blue-palette,
19+
primary: mat.$green-palette,
20+
tertiary: mat.$spring-green-palette,
1721
),
1822
density: (
1923
scale: 0,

apps/devmx/src/scss/_utils.scss

+27
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,30 @@ kbd {
1414
vertical-align: middle;
1515
user-select: none; /* Evita que o texto seja selecionado */
1616
}
17+
18+
.flex {
19+
display: flex;
20+
21+
&.column {
22+
flex-direction: column;
23+
}
24+
25+
&.justify-between {
26+
justify-content: space-between;
27+
}
28+
}
29+
30+
.gap {
31+
&-1 {
32+
gap: 1em;
33+
}
34+
&-2 {
35+
gap: 2em;
36+
}
37+
&-3 {
38+
gap: 3em;
39+
}
40+
&-4 {
41+
gap: 4em;
42+
}
43+
}

apps/devmx/src/styles.scss

+13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
@use '@angular/cdk/overlay-prebuilt.css';
12
@use '@angular/material' as mat;
23
@use './scss/theme' as theme;
34
@use './scss/utils';
45

6+
57
// Include theme styles for core and each component used in your app.
68
// Alternatively, you can import and @include the theme mixins for each component
79
// that you are using.
@@ -25,3 +27,14 @@ body {
2527
margin: 0;
2628
font-family: Roboto, 'Helvetica Neue', sans-serif;
2729
}
30+
31+
a:link,
32+
a:visited,
33+
a:active {
34+
color: rgb(7, 80, 224);
35+
text-decoration: none;
36+
37+
&:hover {
38+
text-decoration: underline;
39+
}
40+
}

config/cz.config.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// prettier-ignore
2+
/** @type {import('cz-git').UserConfig['prompt']} */
3+
module.exports = {
4+
alias: { fd: 'docs: fix typos' },
5+
messages: {
6+
type: 'Selecione o tipo de alteração que você está comitando:',
7+
scope: 'Informe o ESCOPO desta alteração (opcional):',
8+
customScope: 'Escreva o ESCOPO desta alteração:',
9+
subject: 'Escreva uma descrição CURTA e IMPERATIVA da mudança:\n',
10+
body: 'Forneça uma descrição MAIS LONGA da mudança (opcional). Use "|" para quebrar uma nova linha:\n',
11+
breaking: 'Liste quaisquer BREAKING CHANGES (opcional). Use "|" para quebrar nova linha:\n',
12+
footerPrefixesSelect: 'Select the ISSUES type of change List by this change (optional):',
13+
customFooterPrefix: 'Input ISSUES prefix:',
14+
footer: 'List any ISSUES by this change. E.g.: #31, #34:\n',
15+
generatingByAI: 'Generating your AI commit subject...',
16+
generatedSelectByAI: 'Select suitable subject by AI generated:',
17+
confirmCommit: 'Are you sure you want to proceed with the commit above?'
18+
},
19+
types: [
20+
{ value: 'feat', name: 'feat: Nova funcionalidade', emoji: ':sparkles:' },
21+
{ value: 'fix', name: 'fix: Correção de bug', emoji: ':bug:' },
22+
{ value: 'docs', name: 'docs: Apenas mudanças em documentação', emoji: ':memo:' },
23+
{ value: 'style', name: 'style: Mudança no código que não afeta seu funcionamento', emoji: ':lipstick:' },
24+
{ value: 'refactor', name: 'refactor: Alteração de código que não corrige bug nem adiciona recurso', emoji: ':recycle:' },
25+
{ value: 'perf', name: 'perf: Mudança no código que melhora o desempenho', emoji: ':zap:' },
26+
{ value: 'test', name: 'test: Adiciona testes ou corrige testes existentes', emoji: ':white_check_mark:' },
27+
{ value: 'build', name: 'build: Alteração que afeta o build ou dependências externas', emoji: ':package:' },
28+
{ value: 'ci', name: 'ci: Alteração em arquivos de configuração e scripts de CI', emoji: ':ferris_wheel:' },
29+
{ value: 'chore', name: 'chore: Alteração fora dos diretórios src/**/*', emoji: ':hammer:' },
30+
{ value: 'revert', name: 'revert: Reverte um commit anterior', emoji: ':rewind:' }
31+
],
32+
useEmoji: false,
33+
emojiAlign: 'center',
34+
useAI: false,
35+
aiNumber: 1,
36+
themeColorCode: '',
37+
scopes: [],
38+
allowCustomScopes: true,
39+
allowEmptyScopes: true,
40+
customScopesAlign: 'bottom',
41+
customScopesAlias: 'custom',
42+
emptyScopesAlias: 'empty',
43+
upperCaseSubject: false,
44+
markBreakingChangeMode: false,
45+
allowBreakingChanges: ['feat', 'fix'],
46+
breaklineNumber: 100,
47+
breaklineChar: '|',
48+
skipQuestions: [],
49+
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
50+
customIssuePrefixAlign: 'top',
51+
emptyIssuePrefixAlias: 'skip',
52+
customIssuePrefixAlias: 'custom',
53+
allowCustomIssuePrefix: false,
54+
allowEmptyIssuePrefix: false,
55+
confirmColorize: true,
56+
maxHeaderLength: Infinity,
57+
maxSubjectLength: Infinity,
58+
minSubjectLength: 0,
59+
scopeOverrides: undefined,
60+
defaultBody: '',
61+
defaultIssues: '',
62+
defaultScope: '',
63+
defaultSubject: ''
64+
}

package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"scripts": {
6-
"dev": "nx run-many -t serve --projects=server,devmx"
6+
"dev": "nx run-many -t serve --projects=server,devmx",
7+
"cmt": "czg"
78
},
89
"private": true,
910
"devDependencies": {
@@ -42,6 +43,7 @@
4243
"@typescript-eslint/eslint-plugin": "^7.16.0",
4344
"@typescript-eslint/parser": "^7.16.0",
4445
"@typescript-eslint/utils": "^7.16.0",
46+
"czg": "^1.9.4",
4547
"eslint": "~8.57.0",
4648
"eslint-config-prettier": "^9.0.0",
4749
"jest": "^29.7.0",
@@ -87,5 +89,11 @@
8789
"rxjs": "^7.8.0",
8890
"tslib": "^2.3.0",
8991
"zone.js": "~0.14.3"
92+
},
93+
"config": {
94+
"commitizen": {
95+
"path": "node_modules/cz-git",
96+
"czConfig": "./config/cz.config.js"
97+
}
9098
}
9199
}

packages/account/data-access/src/lib/facades/account.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class AccountFacade extends State<AccountState> {
8181
uploadPhoto(photo: Blob) {
8282
const request$ = this.uploadPhotoUseCase.execute(photo);
8383

84-
request$.pipe(take(1)).subscribe((account) => this.setState({ account }));
84+
request$.pipe(take(1)).subscribe(({ id }) => this.loadOne(id));
8585
}
8686

8787
remove(id: string) {

0 commit comments

Comments
 (0)