Skip to content

Latest commit

 

History

History
110 lines (82 loc) · 3.44 KB

README.md

File metadata and controls

110 lines (82 loc) · 3.44 KB

Real Estate API

A rails API application that is consumed by Real-Estate-Client. The application handled user authentication using JWT. There are endpoints that require authentication/protected endpoints and those that don't.

Let's start by listing the list of unprotected endpoints:

  • POST /authenticate. The endpoint used to authenticate/log in a user.
  • POST /auth/signup. The endpoint that is used when creating a new user.
  • GET /categories. Endpoint used for getting all the categories.
  • GET /properties. The endpoint used to fetch all the properties.
  • GET /properties/:id. Used to get a specific property record.

All the other endpoint requires the user to be authenticated. They include:

  • GET /user. Endpoint used to retrieve the current user.
  • PATCH /categories/:id. Used to update specific fields of an already existing category record.
  • PUT /categories/:id. Used to update all the fields of an existing category record.
  • DELETE /categories/:id. Used to delete an existing category record.
  • POST /properties. Used to create a new property record.
  • PATCH /properties/:id. Used to update specific fields of an existing property record.
  • PUT /properties/:id. Used to update all the fields of an existing property record.
  • DELETE /properties/:id. Used to delete an existing property record.
  • PUT /add_geo_location. Creates a geo_location record for an existing propery record.
  • GET /geo_location. Fetches the geo_location record for an existing property record.
  • PUT /add_favourites. Creates a favourite record for the current user.
  • GET /my_favourites. Gets all the favourite properties of the current user.

All of the above endpoints have been tested for the negative and positive scenarios.

Live Link

See the all the properites using the unprotected route here.

📦 Built With

- Rails
- API
- Rpec
- JWT
- Postgress

💻 Getting Started

To get a local copy up and running follow these simple steps.

⤵️ Install

  1. Clone the repository to your local machine
$ git clone https://github.com/wathigo/Real-Estate-API.git
  1. cd into the directory
$ cd Real-Estate-API
  1. install dependencies
bundle install
  1. Migrate to the database
rails db:migrate
  1. Seed in some data
rails db:seed
  1. Start the development server
rails start

▶️ Usage

To use the API visit https://real-estate-client.netlify.app and make use of the hosted version with seeded data. Tools like postman can also be used to test each endpoits. The tests also makes sure that each and every endpoint has been tested.

properties

🚦 Testing

To run the tests:

bundle exec rspec

Potential Features

Add user priveledges. Create user and admin roles.This is an issue addressed here.

👥 Authors

👤 Simon Wathigo

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

🌟 Show your support

Give a ⭐️ if you like this project!