) ) /\
===== / \
_|___|_____/ __ \____________
|::::::::::/ | | \:::::::::::|
|:::::::::/ ==== \::::::::::|
|::::::::/__MAKERS__\:::::::::|
|_________| _BNB_ |__________|
| ______ | / || \ | _______ |
|| | || ====== || | ||
||--+---|| | | ||---+---||
||__|___|| | o| ||___|___||
|========| |____| |=========|
(^^-^^^^^-|________|-^^^--^^^)
(,, , ,, ,/________\,,,, ,, ,)
','',,,,' /__________\,,,',',;;
Welcome to MakersBNB!
- Don’t Ignore Testing
- Always ask for help if you are stuck
- The project is for everyone - Everyone understanding the project is important
- Overtime - No major implementation changes after 6pm unless otherwise agreed
- Spread knowledge
- Everyone has the chance to run a standup and retro
- Less is more - Don’t over extend the project. Figure out what we want to do and do that very well.
A github project board was used to manage the development of this product. This allowed the team to create and assign issues to pairing teams to develop and implement.
Separate sets of user stories were created for each 2 day sprint.
The frontend was implemented using the Bootstrap Framework, HTML and CSS.
Sinatra was used as part of our model controller view framework.
Frontend testing was achieved by using the Capybara/rspec testing framework.
The backend was designed using Ruby and Postgres. Testing for backend methodologies was achieved using the rspec testing framework.
Class diagrams were created to give a basic structure to class expectations during the project.
Management classes were used to interact with the database by passing in space, booking or user objects.
Methods:
-
show all spaces
-
create space(space_object), with name, price and description
-
shows user_spaces(user_id)
-
shows specific spaces view_spaces(space_id)
-
shows specific spaces according to availability
-
shows specific spaces according to availability
-
contains a method for converting string month to a date object
Methods:
-
has a sign up functionality
-
has a log in functionality
- note that logout functionality is implemented by destroying a session, no need for a method itself.
Methods:
-
show customer bookings
-
show host listings booked
-
confirm booking
-
request booking
-
show host pending bookings
CRC diagrams were initially created to mock the structure of databases and what datatypes may be suitable for use.
A MVC diagram was created to visually represent the log between the client, controller, model and viewer.
Test environment consisting of 2 Databases;
- makersbnb
- makersbnb_test (for testing purposes)
Each database has 3 tables:
- id
- name
- description
- price
- userid
- id
- name
- password
- bookingid
- spaceid
- guestid
- stay_date
- confirmation
User id's are UUIDv4's that were generated using the pgcrypto postgresql extension to prevent userid enumeration.
Passwords are stored within the database as bcrypt hashes using the pgcrypto postgresql extension.
This was implemented using this guide.
Variable interpolation was used to protect against SQL injection. This was achieved by using the pg gem.
The messages table contains a foreign key reference to the users table to ensure that only users that exist in the schema can be added as message authors. If a user were to delete their account, their message history would be removed as a consequence.
To reduce duplication of data within the tables, join methods were used to gain access to information stored within other tables.
"SELECT bookings.*, users.*, users.name AS user_name, spaces.* FROM bookings LEFT JOIN spaces ON bookings.spaceid = spaces.id LEFT JOIN users ON bookings.guestid = users.id WHERE spaces.userid = $1 AND bookings.confirmation IS NULL;"
This example was used to access user information (name, email, hostid) without explicitly storing that within the booking table.
Run:
psql -c 'CREATE DATABASE makersbnb_test;'
psql -d makersbnb_test -f db/migrations/test_database_setup.sql
Run:
psql -c 'CREATE DATABASE makersbnb;'
psql -d makersbnb -f db/migrations/database_setup.sql
Run bundle in the directory to install required gems:
charlotte@Charlottes-MBP makersbnb % bundle
Run rspec to test:
charlotte@Charlottes-MBP makersbnb % rspec
- run
rackup
charlotte@Charlottes-MBP makersbnb % rackup
[2020-10-02 12:36:47] INFO WEBrick 1.6.0
[2020-10-02 12:36:47] INFO ruby 2.7.0 (2019-12-25) [x86_64-darwin19]
[2020-10-02 12:36:47] INFO WEBrick::HTTPServer#start: pid=9084 port=9292
- Navigate to
http://localhost:9292/
in your web browser
- Unique Email
- Name
- Password
- Password
- User must be logged in.
- Name
- Price
- Description
- View spaces hosted by logged in user.
- Accept or decline booking requests on spaces.
- View confirmed, pending or declined booking requests.