MakersBnb is a web application that allows registered users to request to hire a space for one night, which needs to be approved by the owner of the property. Any signed up users can list multiple spaces (properties).
Users are able to list their space with a short description, price per night, name and availability.
Only one user can book a space on a given night, and the user will only secure that space (property) once a confirmation from the owner has been received.
We approached this challenge by using a test driven approach. We created the unit and feature tests with Rspec and Capybara:
- Create a domain model and diagram from the user story
- Create a failing test (red) in Rspec
- Develop code to result in a passing test (green)
- Refactor the code and re-test (orange)
- Once I have A) high coverage, B) passing Rspec tests, C) code that fulfills the user story. I progress to the next user story and repeat steps 1-5
I used the MVC pattern to develop the web application.
The server is created with Sinatra.
The database was created using PostgreSQL
The password of users are encrypted in the database with the use of 'bcrypt'
- git clone path-to-repo
- Install bundler via
gem install bundle
(if you don't have bundler already) - Install dependencies via
bundle
Follow these instructions to set-up the PostgreSQL test database
Run rspec from the root directory to test the code and check test coverage
Follow these instructions to set-up the PostgreSQL database
In the terminal whilst at the root directory, type rackup
and press enter
Enter the following url into your preferred browser: http://localhost:9292/
As a user so I can access the platform I want to sign up for an account
As a user so I can access my account I want to log in
As a user so I can exit my account I want to log out
As an owner so I can show my property I want to list a new property
As an owner so I can list multiple spaces I would like to add multiple properties to my account
Users should be able to name their space, provide a short description of the space, and a price per night.
As an owner so I can list my property I want to name my property
As an owner so I can list my property I want to provide a short description of my property
As an owner so I can list my property I want to provide a price of my property per night
As an owner so customers can decide when to stay I want to list available dates to rent
Any signed-up user can request to hire any space for one night, and this should be approved by the user that owns that space.
As a renter so I can choose a property I would like to make a booking request
As an owner so I can review the booking request I would like to confirm the booking
Nights for which a space has already been booked should not be available for users to book that space.
As a user so there are no booking clashes I want properties already booked to be unavailable on specific dates
As an owner I want my property to still be available until the booking is confirmed I would like my property to be open for booking
- Connect to
psql
(it's important to run this command from the root directory of 'chitter-challenge') - Create the database using the
psql
commandCREATE DATABASE **NAME**;
- Connect to the database using the
pqsl
command\c **NAME**;
- Run the following commands within psql:
\i example.sql
- Connect to
psql
(it's important to run this command from the root directory of 'chitter-challenge') - Create the database using the
psql
commandCREATE DATABASE **NAME**;
- Connect to the database using the
pqsl
command\c **NAME**;
- Run the following commands within psql:
\i example.sql
Joe McNally David Ewan Campbell Rupert Pople Nadia Benzineb Conor Hope