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

Desafio - Desenvolvedor Fullstack - Júnior #34

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ddb4aec
backend-build: setup the project
JirlanSouza Jan 22, 2023
87fe4ff
backend-build: added the new projet dependencies
JirlanSouza Jan 22, 2023
b79ab2e
backend-feat: creatd the User entity calss and UserRepository interface
JirlanSouza Jan 22, 2023
1e01677
backend-feat: created the RegisterUser service class
JirlanSouza Jan 22, 2023
ec981ba
backend-feat: created the User controller class
JirlanSouza Jan 22, 2023
bbefef7
backend-feat: created the PrismaClient service
JirlanSouza Jan 22, 2023
e6d559f
backend-doc: created the swagguer config class
JirlanSouza Jan 22, 2023
66de63b
backend-feat: created the UserRepository prisma implementation
JirlanSouza Jan 22, 2023
33b593a
Merge the backend project
JirlanSouza Jan 22, 2023
d79ba3b
backend-build: move the backend project files to car-sale-ads-backend…
JirlanSouza Jan 22, 2023
d6b5f8b
backend-build: created the createUser migration
JirlanSouza Jan 22, 2023
a80dbde
backend-feat: created the AllExceptionsFilter
JirlanSouza Jan 22, 2023
298d464
backend-fix: fix the PrismaService, PrismaUserRepository and Register…
JirlanSouza Jan 22, 2023
afd3722
fix: fix the conflict http error response
JirlanSouza Jan 22, 2023
39fda82
backend-fix: fix the PrismaUserRepository file name
JirlanSouza Jan 22, 2023
903497e
backend-build: created the docker-compose file
JirlanSouza Jan 22, 2023
f7de021
backend-feat: added the password User propertitie
JirlanSouza Jan 23, 2023
d1998ce
backend-feat: created the loginService and validateUserService
JirlanSouza Jan 23, 2023
11977ca
backend-feat: created the auth stratagies and guards
JirlanSouza Jan 23, 2023
8e97de3
backend-feat: created the auth controller with login api endpoint
JirlanSouza Jan 23, 2023
28e31ed
backend-feat: created the new errors class
JirlanSouza Jan 23, 2023
417f0bb
backend-fix: fix the exceptions filter to handle HttpExceptions
JirlanSouza Jan 23, 2023
19459ff
backend-doc: fix the register user endpont response documentation
JirlanSouza Jan 23, 2023
c91a7f7
backend-feat: added the AuthModule in AppModule
JirlanSouza Jan 23, 2023
a0a1646
backend-feat: create the CarAdd Entity and CarItems class
JirlanSouza Jan 24, 2023
8ce894d
backend-feat: created the CreateCarAddService class
JirlanSouza Jan 24, 2023
c49bcdf
backend-feat: created the carAddController with Post method endpoint
JirlanSouza Jan 24, 2023
f72220c
backend-feat: Implemented the PrismaCarAddRepository
JirlanSouza Jan 24, 2023
8c62b83
backend-build: change the prisma CarAd model
JirlanSouza Jan 24, 2023
e48492a
beckend-fix: update carAd class names
JirlanSouza Jan 24, 2023
bd40864
backend-build: fix the prisma binaryTraget to run in the docker conta…
JirlanSouza Jan 24, 2023
2b072db
doc: chaged the README file
JirlanSouza Jan 24, 2023
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
91 changes: 67 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,67 @@
![Bitcointoyou](https://bitcointoyou.com/_next/static/media/logoAzul.c6609791.png)

# Desafio - Desenvolvedor Fullstack - Júnior
Seja bem-vindo! Este desafio foi projetado para avaliar a sua capacidade técnica como candidato ao cargo proposto.

## Instruções
- Faça um fork deste repositório;
- O conjunto mínimo de tecnologias a serem utilizadas são: alguma das tecnologias front-end e back-end informadas na proposta desse desafio;
- Crie um passo a passo de como rodar a sua aplicação;
- Após finalizar, submeta um pull request com um comentário informando o seu e-mail de contato e aguarde nossa avaliação.

## Proposta
Você deverá desenvolver um projeto utilizando React no front-end e Node.js no back-end com a finalidade de que seja possível listar, visualizar, criar, editar e excluir carros de uma aplicação de anuncios de venda de automóveis.

**Observações:**
> - Você pode persistir os dados em memoria;
> - Cada carro precisa ter um identificador único, nome, marca, ano de fabricação e descrição;
> - Além dos dados do carro, é necessário também salvar os dados do dono do carro(nome, email e telefone de contato).
## Diferenciais
Serão considerados diferenciais:

- Conhecimento sólido em Expo ou React Native;
- Boas práticas de escrita de código (código limpo, padrões de arquitetura, etc.);
- Conhecimento em infraestruturas em nuvem;
# Car sale ads

Desafio - Desenvolvedor Fullstack - Júnior

## Descrição

Api de uma aplicação de anuncios de carro com as funcionalidade de registrar um usuráio,
o usuário registrado e logado poderá criar um novo anuncio de carro.

## Técnologias utilizadas

> Nodejs
> Typescript
> Nestjs
> Prisma
> Postgre
> Docker

## Dependêcias necessárias para executar o projeto

para executar localmente

> [Nodejs](https://nodejs.org/en/)

para executar no Docker

> [Docker](https://docs.docker.com/get-docker/)

## Instalação e execução

#### Clone o repositório

```bash
$ git clone https://github.com/JirlanSouza/desafio-dev-junior-b2u.git
$ cd desafio-dev-junior-b2u
```

### Executar o projeto localmente

```bash
# instale as dependências
$ npm install

# executar em modo de desenvolvimento
$ npm run start:dev

# executar em modo de produção
$ npm run build
$ npm run start
```

### Executar o projeto com o Docker

```bash
$ docker compose up -d
```

Com a aplicação já em execução a documentação Swagger pode ser acessada em http://localhost:3000/doc

### Observação

Devido ao tempo que tive disponívél para implementar o teste conseguí implementar apenas o backend da aplicação.

## Autor

[Jirlan Souza](inkedin.com/in/jirlansouza)
[email protected]
8 changes: 8 additions & 0 deletions car-sale-ads-backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DATABASE_HOST="localhost"
DATABASE_PORT=5432
DATABASE_USER="car-sale-ads"
DATABASE_PASSWORD="car-sale-ads"
DATABASE_DB="car-sale-ads"
DATABASE_URL="postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE}"
JWT_SECRET="secret"
JWT_EXPIRES="1h"
25 changes: 25 additions & 0 deletions car-sale-ads-backend/.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',
},
};
35 changes: 35 additions & 0 deletions car-sale-ads-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# compiled output
/dist
/node_modules

# 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
4 changes: 4 additions & 0 deletions car-sale-ads-backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
11 changes: 11 additions & 0 deletions car-sale-ads-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:16-alpine
WORKDIR /usr/app
COPY package*.json ./
COPY prisma ./prisma/
COPY tsconfig.json ./
RUN npm install
RUN npx prisma generate
COPY . .
RUN npm run build
EXPOSE 3000
CMD [ "npm", "run", "start" ]
5 changes: 5 additions & 0 deletions car-sale-ads-backend/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}
Loading