Giter VIP home page Giter VIP logo

shahadat3669 / rent-home-now-api Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 167 KB

Rent Home Now API is RESTful API that facilitates the connection between property owners interested in renting out their properties and potential renters. The API allows for the creation of reservations on selected properties. It has been developed using the Ruby on Rails framework and uses a PostgreSQL database.

License: MIT License

Ruby 99.80% HTML 0.20%
devise devise-token-auth rails-api rails7 restful-api rspec-rails rubocop-rails ruby-on-rails ruby-on-rails-api

rent-home-now-api's Introduction

logo

Rent Home Now API

๐Ÿ“— Table of Contents

๐ŸŽฏ Rent Home Now API

Rent Home Now API is the final capstone project for the Full Stack Developer Program at Microverse.

Rent Home Now API is RESTful API that facilitates the connection between property owners interested in renting out their properties and potential renters. The API allows for the creation of reservations on selected properties. It has been developed using the Ruby on Rails framework and uses a PostgreSQL database.

The app was built with a Ruby on Rails backend and a React/Redux frontend, located on separate repositories.

๐Ÿ›  Frontend repository:

To visit the frontend repository, please click here.

๐Ÿ›  Built With

Tech Stack

Technology
  • Ruby
  • Rails
  • PostgresSQL
Tools
  • VS Code
  • GIT
  • GITHUB

Key Features

Main functionalities which the app will have:

  • User registration: Allow new users to register an account with the API by providing their personal information and creating a username and password.
  • Property listing: Allow property owners to list their properties with the API by providing information such as property type, location, price, and availability.
  • Reservation creation: Allow renters to create reservations for selected properties by providing the desired dates of the reservation and the number of occupants.
  • Reservation management: Allow both property owners and renters to view, edit, and cancel existing reservations.
  • API documentation: Provide comprehensive documentation for the API, including endpoints, parameters, responses, and error messages, to facilitate integration with external clients and applications.

(back to top)

๐Ÿš€ Live Demo

Sorry, Currently no active link available.

(back to top)

๐Ÿงฎ Kanban Board

(back to top)

๐Ÿ’ป Getting Started

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

Prerequisites

you have to those tools in your local machine.

  • Ruby
  • Rails
  • PostgresSQL
  • GIT & GITHUB
  • Any Code Editor (VS Code, Brackets, etc)

Clone Repository

Clone the repository using the following bash command in an appropriate location.

  git clone [email protected]:shahadat3669/rent-home-now-api.git

Go to the project directory.

  cd rent-home-now-api

Adding credentials

Rails stores secrets in config/credentials.yml.enc, which is encrypted and hence cannot be edited directly. Rails uses config/master.key. If you have the master key, to add or change credentials in your terminal, run this command (change the name of you editor if you need for example code for VS Code)

  EDITOR="code" rails credentials:edit

This command will create the credentials file if it does not exist. Additionally, this command will create config/master.key if no master key is defined. Here pass the --wait flag to make sure the encryption happens after the edits have been saved and the editor closed.

  EDITOR="code --wait" rails credentials:edit

The scaffolded credentials.yml.enc looks like below:

  postgres_password: Database User Password
  smtp_user_name: SMTP User name
  smtp_password: SMTP User password

To learn more check Custom Credentials documentation.

Add necessary packages

For installing necessary packages, run the following bash command:

  bundle install

Setup Database locally

For setup database locally, run the following bash commands:

  • Create a database in your local machine
  rails db:create
  • Run necessary migrations
  rails db:migrate
  • To insert seeds in the database, you can run:
  rails db:seed

Run the server in development mode

In the project directory, you can run the project by using following bash command:

  ./bin/dev

And now you can visit the site with the URL http://localhost:4000

Run the test

Before running the test command, please make sure you have run rails db:seed.

For testing you can run following bash command:

  bundle exec rspec --exclude-pattern "spec/requests/api/**/*"

(back to top)

๐Ÿ‘ฅ Authors

First Author:

Shahadat Hossain

portfolio linkedin twitter

Second Author:

Sandro Hernandez

portfolio linkedin twitter

Third Author:

Sandro Hernandez

portfolio linkedin twitter

(back to top)

๐Ÿ”ญ Future Features

  • Payment integration: Allow renters to pay for their reservations through the API using a secure payment gateway.

  • Rating and review system: Allow renters to rate and review properties they have rented through the API, and allow property owners to view and respond to these reviews.

(back to top)

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

๐Ÿ‘‹ Show your support

Give a โญ๏ธ if you like this project!

(back to top)

๐Ÿ”ญAcknowledgments

(back to top)

โ“ FAQ

  • Can I use this project for personal use?

    • Yes, you can use it.

(back to top)

๐Ÿ“ License

This project is MIT licensed.

(back to top)

rent-home-now-api's People

Contributors

gutemag avatar sambeck87 avatar shahadat3669 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

alishahbaj

rent-home-now-api's Issues

[2pt] Designe propery list page (Front-end)

  • Design property card component
    • The card should show an image
    • The card should show the property title
    • The card should show the initial rental price
    • Card shows the address of the property
  • Design home page all public property will show

[2pt] Create the reservation controller for API

  • Create reservation API endpoint for each following operation:
    • index: get request for all reservation
    • show: get request for the specific reservation
    • create: post request for creating a new reservation
    • update: put request for updating an existing reservation
    • destroy: delete request for the specific reservation

[1pt] Add property page (Frontend)

  • Add property page allows the user to add their property
  • The user has to fill up all the necessary details for a property
  • The user needs to add at least one reservation criterion for the property

[1pt] Create the categories

  • Create the properties model with the following field:
    • name
  • configure many-to-many relationships with properties.
  • Add validation rules.
  • Add test cases for the model.

[2pt] Create the reservation_critarias controller for API

  • Create reservation_critarias API endpoint for each following operation:
    • index: get request for all reservation_critaria
    • show: get request for specific reservation_critaria
    • create: post request with creating a new reservation_critaria
    • update: put a request for updating existing reservation_critaria
    • destroy: delete request for specific reservation_critaria

[1pt] Create the reservation model

  • Create the reservation model with the following field:
    • start_date
    • end_date
    • price
    • guests
  • Add validation rules
  • Add test cases for the model

[1pt] Reserve property page (Frontend)

  • The reserve property page allows the user to reserve the property for a certain time
  • User name and property will fill up automatically
  • User has to select reservation starting and end time

[1pt] Create the users model

  • Create the users model with the following field:
    • name
    • email
    • password
    • role
    • avatar
  • Add validation rules.
  • Add test cases for the model.

[1pt] My Reservations page (Frontend)

  • My Reservations page allow the user to show the list of the property he has currently reserved.
  • User sees all the reserved property
  • User can delete a reserved property
  • User can update a reservation if possible

[2pt] Create the properties controller for API

Create properties API endpoint for each following operation:

  • index: get requests for public properties
  • show: get requests for a specific property
  • create: post request for creating a new property
  • update: put a request for updating an existing property
  • destroy: delete request for a specific property

[2pt] Create the users controller for API

  • Create reservation_critarias API endpoint for each following operation:
    • index: get requests for all users
    • show: get request for specific user
    • create: post request with create a new user
    • update: put request for updating existing user
    • destroy: delete request for specific user

[1pt] Create the properties and address model

  • Create the properties model with the following fields:
    • Title
    • Description
    • bedrooms
    • beds
    • baths
    • Size
    • kind
  • Create the address model with the following fields:
    • house_no
    • street_address
    • zip_code
    • City
    • Country
  • Add validation rules
  • Add test cases for the model

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.