Technical challenge developed by Eduardo Arenas
This is an API for listings who get properties to be shown at theis sites
- Rails 6.1.2.1
- Ruby 2.7.2
- PostgreSQL 13.1
- JWT https://jwt.io
- Rails admin https://github.com/sferik/rails_admin/wiki
- Rspec https://rspec.info/
Using Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
brew install postgres
Installing RVM
\curl -sSL https://get.rvm.io | bash -s 1.29.10
Installing Ruby 2.7.2 with RVM
rvm install ruby-2.7.2
git clone git@github.com:adbeel92/homie-test.git
Creating a gemset (entering to the directory, the gemset will be created thanks to the files .ruby-version
and .ruby-gemset
)
cd ./homie-test
gem install bundler -v 2.2.4
bundle install
rails db:create
rails db:migrate
rails db:seed
rails server
Go to http://locahost:3000
Go to http://locahost:3000/admin if you could setup your localhost. Or go to https://homie-challenge.herokuapp.com/admin
email: admin@homie.mx
password: adminpass
There are two listing accounts created: Segundamano and Inmuebles24, and you are able to create apps for them.
Let's create one listing app. Go to http://localhost:3000/admin/listing_app
- Click on
+ Add new
- Select any listing account (Segundamano or Inmuebles24)
- Click on
Save
The listing apps list will appear.
- Click on ⓘ of the first row
Now, the listing account selected has an API_KEY and API_SECRET. Using these, the listing account will have access to the API (such as properties data)
- *** Copy the
Api key
andApi secret
. We will use them
- Download Postman
- Sign in/up at Postman
Then, join to my postman team click on here
We are going to use the workspace: Homie workspace
- In the navigation bar located on right, click on
Environments
- Click on
Globals
You will see api_version
, api_key
, api_secret
and token
. We are going to change only api_key
and api_secret
under CURRENT VALUE
column
- Put the values in
api_key
andapi_secret
(***)
Now, we are going to generate a token
- Click on
No environment
localted top right and selectlocalhost
if you could run in your localhost, otherwise selectheroku
- Go to
Collections > Create Token
and click onSend
The token generated will persist as a global variable. Now you are able to use the API (rest of requests defined in Postman)