VacationBnb is a full-stack single-page web application inspired by AirBnB. The frontend utilizes React.js with Redux while the backend utilizes the Ruby on Rails framework with PostgreSQL.
Home page for the site.
Users can signup, login, or search for listings by location.
Modal for login/signup is implemented through Redux and React, allowing modular re-use throughout the site.
return ({
action: (user) => dispatch(login(user)),
otherForm: (
<button onClick={() => dispatch(openModal('signup'))}>
Signup
</button>
),
closeModal: () => dispatch(closeModal()),
openModal: (formtype) => dispatch(openModal(formtype))
})
homes = params[:bounds] ? Home.with_attached_photos.in_bounds(params[:bounds]) : Home.with_attached_photos.all
if params[:price]
homes = homes.where(price: price_range)
end
if params[:num_guests]
homes = homes.where(num_guests: guests_range)
end
if params[:query]
homes = homes.where("city ILIKE ?", "%#{params[:query]}%")
end
<DateRangePicker
startDate={this.state.start_date}
startDateId="start_date_id"
endDate={this.state.end_date}
endDateId="end_date_id"
onDatesChange={({ startDate, endDate }) => this.setState({ start_date: startDate, end_date: endDate })}
focusedInput={this.state.focusedInput}
onFocusChange={focusedInput => this.setState({ focusedInput })}
startDatePlaceholderText="Check in"
endDatePlaceholderText="Check out"
numberOfMonths={1}
/>