Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conclusão do desafio de estágio - Softmakers 23/02 #29

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5fad5ce
🎉 chore: init nest project
Feb 20, 2024
de6b29e
🎉 chore: init a next project
Feb 20, 2024
47dd964
🙈 chore: add gitignore
Feb 20, 2024
8cb0bf0
👷 chore: dockerize project
Feb 20, 2024
c721dbf
➕ chore: setup orm
Feb 20, 2024
5c08376
🍱 chore: add assets
Feb 20, 2024
d0643d8
➕ chore: setup shadcn/ui and some components
Feb 20, 2024
f5dd9d3
💄 feat: add basic layout template
Feb 20, 2024
bcf5daf
💄 feat: add search bar component
Feb 20, 2024
b4c4ca7
💄 feat: add item popover component trigger
Feb 20, 2024
a63e087
✨ feat: add ubuntu optimized font
Feb 20, 2024
5671e9e
🍱 chore: add assets
Feb 21, 2024
3e5e39c
🎨 refactor: provide pet dtos array as context
Feb 21, 2024
8e8ee5a
💄 feat: add pet dtos context
Feb 21, 2024
18742b1
➕ chore: install components dependencies
Feb 21, 2024
2b3b50e
✨ feat: add pet registration
Feb 21, 2024
9f27055
➕ chore: setup dto validation
Feb 21, 2024
dc33bbf
🎨 refactor: add right pet columns to entity
Feb 21, 2024
9fe5048
📦 feat: add pets module
Feb 21, 2024
0516c23
✨ feat: add pets controller
Feb 21, 2024
962a06c
✨ feat: add pets service
Feb 21, 2024
740add8
✨ feat: add page navigation and server data fetching
Feb 22, 2024
5058258
✨ feat: add pet creation
Feb 22, 2024
eb54c5c
🐛 fix: day cell background color
Feb 22, 2024
8be663e
🏷️ feat: add dto pet type
Feb 22, 2024
0835013
👷 chore: add aliases to compose network
Feb 22, 2024
1fa0c0a
✨ feat: add new pet data to ui when its successfully created
Feb 22, 2024
9ea7171
🐛 fix: pagination counting
Feb 22, 2024
cf6e62f
✨ feat: add pet updating operation
Feb 22, 2024
bafadc9
🎨 refactor: move pagination elements to its own component
Feb 22, 2024
08b7710
💄 fix: nested heading tags and dialog icons
Feb 22, 2024
1e3d68e
✨ feat: add pet deletion
Feb 22, 2024
b53571f
✨ feat: add pet deletion
Feb 22, 2024
cf57432
Merge branch 'main' of https://github.com/vinicivs-rocha/desafio-estagio
Feb 22, 2024
505f143
✨ feat: add delete form to dialog
Feb 22, 2024
717adab
🐛 fix: reload window
Feb 22, 2024
2fdc621
🐛 fix: number of displayed pets exceeding 16
Feb 22, 2024
00f6379
🐛 fix: opt-out of caching
Feb 22, 2024
e080e77
💡 chore: add execution instructions
Feb 22, 2024
9dac24a
➕ chore: add react query lib
Feb 23, 2024
7de4eff
🐛 fix: enable cors
Feb 23, 2024
b7647dd
✨ feat: add client-side data fetching
Feb 23, 2024
0328bef
🐛 fix: acessing out of bounds page through URL
Feb 23, 2024
3f01137
✨ feat: add search query param mapping
Feb 23, 2024
89941fe
✨ feat: add name substring querying
Feb 23, 2024
5cf5941
🐛 fix: add search filter to pages count
Feb 23, 2024
39cdc5d
🐛 fix: searching pets
Feb 23, 2024
22c1e31
✨ feat: add form phone field mask
Feb 23, 2024
192f796
🎨 refactor: create abstract form schema builder
Mar 23, 2024
6b59d49
🎨 refactor: implement concrete register schema builder
Mar 23, 2024
da64896
🏷️ feat: add schemas' input, output and its own type
Mar 23, 2024
b3a4a65
💩 refactor: change depency to the concrete builder
Mar 23, 2024
6b6f47c
➕ chore: install tailwind-merge package
Mar 23, 2024
b0b0931
🎨 refactor: form component into composite pattern
Mar 23, 2024
302aa78
🎨 refactor: button component into composite pattern
Mar 23, 2024
0de7743
🎨 refactor: remove unnecessary components
Mar 25, 2024
019156b
🎨 refactor: move typeorm entities to model pattern
Mar 25, 2024
90564e8
🎨 refactor: add domain entities
Mar 25, 2024
35439e5
🎨 refactor: add entities value objects
Mar 25, 2024
0844b22
🎨 refactor: move pet creation to use case
Mar 25, 2024
aaf5cb3
🎨 refactor: add pet creation use case boundaries
Mar 25, 2024
6cf1b1b
🎨 refactor: add pet creation repository interface
Mar 25, 2024
9814371
🎨 refactor: move pet creation DAL to repository pattern
Mar 25, 2024
9348180
🎨 refactor: move pet creation to its own controller
Mar 25, 2024
941a18e
🎨 refactor: consume already validated request body on controller
Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# compiled output
**/dist
**/node_modules
**/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
**/coverage
**/.nyc_output

# IDEs and editors
**/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
**/.pnp
.pnp.js
.yarn/install-state.gz

# testing
**/coverage

# next.js
**/.next/
**/out/

# production
**/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,33 @@ Serão considerados diferenciais:
- O uso de qualquer banco de dados para armazenar os dados da sua aplicação;
- O uso de qualquer framework;
- Boas práticas de escrita de código (código limpo, padrões de arquitetura, etc.).

## Instruções de execução

### Pré-requisitos
- [WSL](https://docs.microsoft.com/pt-br/windows/wsl/install) (ou qualquer outro terminal Linux)
- [Docker](https://www.docker.com/products/docker-desktop) (CLI ou Extensão do Docker no VSCode)
- [Git](https://git-scm.com/downloads)

### Clonar o repositório
```bash
git clone https://github.com/vinicivs-rocha/desafio-estagio
```

### Executar o projeto
```bash
cd desafio-estagio
docker compose up --build
```

### Notas
- Caso o comando `docker compose up --build` não funcione, tente `docker-compose up --build`
- **Fique atento aos logs**, pois o front-end e o back-end só estarão prontos quando aparecerem mensagens como as seguintes (não necessariamente nessa ordem):
```bash
front-1 | ✓ Ready in 6.3s

db-1 | 2024-02-22 17:39:46.067 UTC [1] LOG: database system is ready to accept connections

back-1 | [Nest] 29 - 02/22/2024, 5:39:54 PM LOG [NestApplication] Nest application successfully started +1ms
```
- Caso o serviço db não fique pronto a tempo, o back-end não conseguirá se conectar a ele e isso exibirá um erro no console. Nesse caso, espere o serviço do db ficar pronto e reinicie o back-end com `docker compose up --build back`
1 change: 1 addition & 0 deletions back/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
25 changes: 25 additions & 0 deletions back/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
4 changes: 4 additions & 0 deletions back/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions back/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine

WORKDIR /usr/app/back

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD [ "npm", "run", "start:dev" ]
73 changes: 73 additions & 0 deletions back/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
8 changes: 8 additions & 0 deletions back/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading