Final project of Resilia Educação - Module 5

Overview

API-IMOBILIARIA

Esta API é o resultado final do Projeto de Módulo 5 da Resília Eduação.

O objetivo da API é fornecer o back-end para a nossa aplicação princial projetada em React. Realizando o CRUD para o nosso aplicativo que simula um site para buscar e encontrar propriedades para aluguel e venda.

Stack utilizada

Back-end: Node, Express, TypeScript

Autores

Live URL

https://api-imobiliaria-m5.herokuapp.com/

Rodando localmente

Clone o repositório

  git clone https://github.com/ivangeier/api-imobiliaria.git

Acesse o diretório

  cd api-imobiliaria

Instale as dependências do projeto

  yarn

Crie uma cópia do arquivo .env.example e renomeie para .env. Será necessário preencher as variáveis com os seus acessos, você poserá cirar um banco de dados POSTGRE e um segredo próprio.

Inicie o projeto, após preencher as variáveis de ambiente com o comando

  yarn dev

Documentação da API

Propriedades

Retorna todas as propriedades cadastradas

  GET /properties

Retorna um item

  GET /property/${id}
Parâmetro Tipo Descrição
id string Obrigatório. O ID do item que você quer

Pesquisa uma propriedade através do parâmetros

  GET /properties/search/
Parâmetro Tipo Descrição
mode string Aluguel ou Venda &mode=aluguel &mode=venda
min max number Valor mínimo e máximo &min=1000 &max=50000 Obrigatório. &min=1000&max=1000 min e max devem ser utilizados na mesma query, caso contrário os valores serão ignorados
beds number Numero de quartos &beds=2
baths number Numero de banheiros &baths=1
garage number Numero de garagens &garage=2
type string Tipo de imóvel &type=casa
state string Estado onde esta o imóvel &state=SP

Deletar propriedade

  DELETE /properties/${id}
Parâmetro Tipo Descrição
id string Obrigatório. O ID do item que você quer

Registrar um nova propriedade

  POST /properties/register
Parâmetro Tipo Descrição
title string Obrigatório. Título da propriedade/Anuncio
state string Obrigatório. Estado
street string Obrigatório. Logradouro
city string Obrigatório. Nome da cidade
amountBedrooms number Obrigatório. Número de quartos
amountBathrooms number Obrigatório. Número de banheiros
amountGarage number Obrigatório. Número de garagens
valueCondominium number Obrigatório. O ID do item que voc+ê quer
iptu number Obrigatório. Valor do condominio
valueRental number Obrigatório. Valor do aluguel do imóvel
valueSell number Obrigatório. Valor de venda do imóvel
isSelling boolean Obrigatório. Imóvel esta a venda
tisRenting boolean Obrigatório. Imóvel esta para alugar
type string Obrigatório. Tipo de proṕriedade
images [string] Obrigatório. Imagens da propriedade, array de string os os links

Usuário

Retornar usuário por ID

Rota autenticada 🔐

Retorna as informações do próprio usuário logado

  GET /user

Criar um novo usuário

  POST /user/register
Parâmetro Tipo Descrição
firstName string Obrigatório. Primeiro nome do usuário
lastName string Obrigatório. Sobrenome do usuário
cpf string Obrigatório e único. CPF do usuário
email string Obrigatório. E-mail do usuário
password string Obrigatório. Senha do usuário
role string Obrigatório. Tipo de usuário (admin, client, realEstate)
state string Obrigatório. Estado do usuário

Atualizar a senha

Rota autenticada 🔐

Atualiza a senha do usuário logado

  PUT /user/update
Parâmetro Tipo Descrição
oldPassword string Obrigatório. Senha antiga utilizada pela usuário
newPassword string Obrigatório. Nova senha do usuário

Deletar usuário

Rota autenticada 🔐

Inativa o usuário logado do sistema

  DELETE /user/delete

Atualizar um usuário

Rota autenticada 🔐

Atualiza o usuário logado do sistema

  PUT /user/update
Parâmetro Tipo Descrição
firstName string Primeiro nome do usuário
lastName string Sobrenome do usuário
email string E-mail do usuário
state string Estado do usuário

Login

Loga um usuário no sistema

  POST /login
Parâmetro Tipo Descrição
email string E-mail do usuário
password string Senha do usuário

Imobiliária

Registrar Imobiliária

Cria uma nova imobiliária no sistema

  POST /realestate/register
Parâmetro Tipo Descrição
userData: { object Obrigatório. Objeto com os dados do usuário para cadastro
firstName string Obrigatório. Primeiro nome do usuário
lastName string Obrigatório. Sobrenome do usuário
cpf string Obrigatório e único. CPF do usuário
email string Obrigatório. E-mail do usuário
password string Obrigatório. Senha do usuário
role string Obrigatório. Tipo de usuário (admin, client, realEstate)
state string Obrigatório. Estado do usuário
},
realEstateData: { object Obrigatório. Objeto com os dados da imobiliaria para cadastro
name string Obrigatório. Nome da imobiliária
cnpj string Obrigatório. CNPJ da imobiliária
city string Obrigatório. Cidade onde esta a imobiliária
initialBroker string Obrigatório. Quantidade de corretores
initialProperties string Obrigatório. Quantidade de propriedades
},

Licença

MIT

You might also like...

Java/React Camp Project

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 22, 2022

This command line helps you create components, pages and even redux implementation for your react project

This command line helps you create components, pages and even redux implementation for your react project

react-help-create This command line helps you create components, pages and even redux implementation for your react project. How to install it? To ins

Dec 10, 2022

Finished code and notes from EFA bonus class on building a React project without create-react-app

React From Scratch Completed Code This is the completed code for the EFA bonus class on building a React project from scratch. Included are also markd

Oct 11, 2021

Example project using Miniflare, esbuild and AVA

Miniflare Example Project This is an example Cloudflare Workers project that uses Miniflare for local development, esbuild for bundling, and AVA for t

Dec 3, 2022

my best project right now ❤️

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Dec 20, 2021

👉 Built my first React JS project "ToDo" webapp using some Features and Icons from Material UI.

# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Avai

Dec 15, 2021

A basic React/NextJS project showing how to use the Flow Client Library (FCL)

A basic React/NextJS project showing how to use the Flow Client Library (FCL)

How to use the Flow Client Library (FCL) with SvelteKit Everything you need to build a SvelteKit project with the Flow Client Library (FCL). For a Sve

Sep 24, 2022

E-commerce project using Next.js

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jan 5, 2022

A simple project showing the usage of useState, useEffect and conditional rendering in React

Getting Started with Tour-sample React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can ru

Jul 30, 2022
Owner
Ivan Geier
Jr BackEnd Developer | JavaScript | Node | SQL | Mongo
Ivan Geier
Webpack is an open-source JavaScript module bundler. This includes basic setup files to help me not redo all the setups for webpack when starting a new project.

Webpack Setup Webpack is an open-source JavaScript module bundler. It is made primarily for JavaScript, but it can transform front-end assets such as

Nemwel Boniface 14 Jun 23, 2022
The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that allows you to: Display a list of books. Add a book. Remove a selected book.

Bookstore The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that al

Anuar Shaidenov 6 Jun 12, 2022
Angular Youtube clone with Module Federation. Turborepo edition.

Youtube microfrontend using Angular, Module Federation. Turborepo edition. NOTE: This is project is for education purpose only and was made to illustr

Vugar 180 Dec 30, 2022
🔄 Basic project to start studying React and Typescript. With it you can translate text to binary or morse language. This project addresses the creation of routes and components.

max-conversion Projeto criado para iniciar nos estudos de React e Typescript Basic project to gain knowledge in react Na plataforma é possível convert

Igor Neves 3 Feb 12, 2022
This a todo list project that uses webpack. In this project you will find features like adding tasks, deleting tasks, maintaining localstorage, marking tasks completed and clearing all completed tasks.

webpack-Todo list This a todo list project that uses webpack. In this project you will find features like adding tasks, deleting tasks, maintaining lo

Natnael Demelash 2 Jun 15, 2022
WPPConnect/mobile is an open source project with the objective of automating whatsapp web using the android or ios mobile browser and being able to perform all the functions of our wa-js project

WPPConnect/mobile is an open source project with the objective of automating whatsapp web using the android or ios mobile browser and being able to perform all the functions of our wa-js project, so it is possible to create a customer service, media sending, intelligence recognition based on artificial phrases and many other things, use your imagination to change and modify this project or collaborate on improvements...

null 11 Dec 28, 2022
This project was developed to show the leaderboards of races in OpenFusion which is an open source revival project of the beloved CN FusionFall.

Getting Started with DexLabs Leaderboards This project was developed to show the leaderboards of races in OpenFusion which is an open source revival p

Hichem Fantar 3 Jul 20, 2022
Hello, world! :) Welcome to this project. This is a free web repository that you can use as a blog for your website. This project is dedicated to "Sina Sattari" as an honorary title.

QURNO News/Technology Web Application Greetings and courtesy to all of you dear colleagues and friends of the DarkDragons team. We came back with anot

DarkDragons Team 12 Sep 8, 2022
This project was bootstrapped with Chakra UI & Create React App

Getting Started with Create React App This project was bootstrapped with Chakra UI & Create React App. ScreenShots Available Scripts In the project di

Pawan Kumar 51 Dec 11, 2022
Open-source project which generates the Fortnite Item Shop in an image similar to the in-game design.

Fort-Shop Fort-Shop is a unique project which generates the current Fortnite Item Shop into a stylized image, similar to the new In-Game design (refer

im2rnado 25 Jan 5, 2023