GithubHelp home page GithubHelp logo

challenge-database-user's Introduction

Banner Github Jander Nery

API DE PRODUTOS

Github top language Github language count Repository size License

About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


🎯 About

Projeto de criação de uma API feita com o NodeJs de Produtos e Categorias.

The Project

Desenvolver uma API RESTfull utilizando nodejs e banco de dados relaciona. Cada produto deve pertencer a uma categoria pré registrada no sistema.

✨ Features

Funcionalidades

  • Usuários
    • (store) Cadastrar Usuário
    • (login) Login de usuário retornando um bearer token para utilizar nas chamadas abaixo
  • Categorias
    • (store) Cadastrar categoria
    • (update) Atualizar categoria
    • (delete) Remover categoria
    • (show) Exibir Categoria
    • (index) Listar categorias
  • Produtos
    • (store) Cadastrar produto
    • (update) Atualizar produto
    • (delete) Remover produto
    • (show) Exibir produto
    • (index) Listar produtos
      • Filtrar por categorias

Exemplo de Produto

https://github.com/jnerydesigner/challenge-database-user/blob/main/src/assets/tela_cadastro_empresa.png

Retorno Alcançado

https://github.com/jnerydesigner/challenge-database-user/blob/main/src/assets/tela_cadastro_minha.png

Regras de negócio

  • A data de fabricação nunca deve ser maior que a data de validade;
  • O Preço do produto deverá ser registrado com 2 casas decimais;
  • A listagem deve ter a possibilidade de ordenação dos campos e com uma paginação de 10 produtos por página.

Rotas da Aplicação

Users

1 - http://localhost:4444/api/v1/users

Post Body(Json)

{
	"name": "",
	"email": "",
	"password": ""
}

Post 2 - http://localhost:4444/api/v1/sessions

Body(Json)

{
	"email": "",
	"password": ""
}

Categories

3 - http://localhost:4444/api/v1/categories

Post Body(Json)

{
	"name": "Açougue",
	"description": "Descrição Generica para teste"
}

4 - http://localhost:4444/api/v1/categories

Get No Body

{

}

5 - http://localhost:4444/api/v1/categories/:id

Get Params No Body

{

}

5 - http://localhost:4444/api/v1/categories

Patch Body(Json)

{
	"id": "",
	"name": "",
	"description": "",
	"slug": ""
}

6 - http://localhost:4444/api/v1/categories/:id

Delete Params No Body

{

}

Products

7 - http://localhost:4444/api/v1/products

Post

Body(Json)

{
	"categoryId": ,
  "name": "Lençol de Cama Embrulhadinho",
  "manufacturingDate": "2021-08-15T18:52:12.927Z",
  "perishableProduct": false,
  "expirationDate": "2021-08-15T18:52:12.927Z",
  "price": ,
}

8 - http://localhost:4444/api/v1/products/:id

Get Params No Body

{

}

9 - http://localhost:4444/api/v1/products/category/:id

Get Params No Body

{

}

10 - http://localhost:4444/api/v1/products

Get No Body

{

}

11 - http://localhost:4444/api/v1/products/:id

Delete Params No Body

{

}

12 - http://localhost:4444/api/v1/products/image/:id

Patch Params Body(Multipart)

{
productImage: file
}

13 - http://localhost:4444/api/v1/products/:id

Get Params No Body

{

}

Diferenciais

  • Utilizar testes unitários e de integração;
  • Documentação dos endpoints da API - Por partes;
  • Front-end é opcional: Tela Principal, Tela de Cadastro de Produto, Tela de Login, Tela de Upload de Imagem do Produto

🚀 Technologies

The following tools were used in this project:

✅ my notes

✅ Requirements

Before starting 🏁, you need to have Git and Node installed.

🏁 Starting

# Clone this project
$ git clone https://github.com/jnerydesigner/challenge-database-user gen_products_api

# Access
$ cd gen_products_api

# Install dependencies
$ yarn

# Run the docker to install the Postgres database
docker-compose up

or

docker-compose up -d #run in detach mode

# Run the typeorm to install as migrations
yarn typeorm migration:run

# Run the project
$ yarn dev

# The server will initialize in the <http://localhost:4444>
# or
#change teh port in file .env

🏁 Documentation

  • Nota: Tentei fazer toda a documentação dos endpoints, mas não deu tempo, mas algumas foram criadas usando o Swagger

  • Só vai rodar se não mudar a porta Documentação

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by Jander Nery

Fiquei muito interessado em trabalhar nessa Empresa.

Meu Linkedin

Meu Github

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.