This is a back-end API, which provides data to this application that I developed.
This repo is an Api for a project to find houses to buy or to rent. It has a scrolling for better user experience in mobiles. It has differents interactive element like a toogle to see the navigation and the user Info. You can add to favorite the houses you like and change the selection of houses only to your favorites. It has a full functional login system and protected routes, so only a login user can enter the dashboard.
- Create a new user
- Require authentication for login
- Filter the password
- Create and get houses
- Add houses to favorites
It's deployed here on heroku
This project was built using these technologies.
- Ruby on Rails
- rack-cors
- GitHub
- Rubocop
- Stylelint
- Eslint
To get a local copy up and running follow these simple example steps.
- Clone this repo:
- Clone with SSH:
git@github.com:yahir91/FIndhousesApi.git
- Clone with HTTPS
https://github.com/yahir91/FIndhousesApi.git
Install dependencies:
$ bundle install
Start the local webserver:
$ rails s -p 4000
will open the project at local webserver at http://localhost:4000/
for all request you will need base URL:
const baseUrl = https://houses-api-yahir.herokuapp.com
data = {
title,
description,
rent,
file
}
const url = `${baseUrl}/houses`;
const config = `{
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
Authorization: ` Bearer ${token} `,
},
body: JSON.stringify(data),
}`
const url = `${baseUrl}/houses`;
const config = `{
method: 'GET',
mode: 'cors',
headers: {
Authorization: `Bearer ${token} `,
}`
const url = `${baseUrl}/favorites`;
const config = `{
method: 'GET',
mode: 'cors',
headers: {
Authorization: `Bearer ${token} `,
}`
const url = `${baseUrl}/houses/id`;
const config = `{
method: 'GET',
mode: 'cors',
headers: {
Authorization: `Bearer ${token} `,
}`
data ={
house: params[id]
}
const url = `${baseUrl}/favorites`;
const config = `{
method: 'POST',
mode: 'cors',
headers: {
Authorization: `Bearer ${token}`,
}`,
body: JSON.stringify(data),
const url = `${baseUrl}/favorites/id`;
const config = `{
method: 'DELETE',
mode: 'cors',
headers: {
Authorization: `Bearer ${token}`,
}`,
data = {
email,
name,
password,
password_confirmation
}
const url = `${baseUrl}/users/sign_up`;
const config = `{
method: 'POST',
mode: 'cors',
headers: { 'Content-Type': 'application/json' },
redirect: 'follow',
body: JSON.stringify(data),
},`
data = {
email,
password
}
const url = `${baseUrl}/users/sign_in`;
const config = `{
method: 'POST',
mode: 'cors',
headers: { 'Content-Type': 'application/json' },
redirect: 'follow',
body: JSON.stringify(data),
}`
const apiUrl = `${baseUrl}/users/sign_out`;
const config = `{
method: 'DELETE',
mode: 'cors',
headers: { 'Content-Type': 'application/json' },
redirect: 'follow',
}`
Working as a FullStack developer on this project.
Give a ⭐ if you like this project!
This project is MIT licensed.