Skip to content

namir-ahmed/fairbnb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

220 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link

Project Wiki

Technologies

JS Badge CSS3 Badge React Redux Postgres Sequelize NodeJS Express.js NPM Git Visual Studio Code Render Supabase AWS

About

FairBnB is an AirBnB inspired full-stack web application with dynamic features catered to people who want to list and rent affordable places. FairBnB lets users create listings and other users. Other users can review those listings. Try out the app as a Demo user by clicking on the link above!

Features

  • Account Signup/Login/Logout
  • Recommended Listings Viewed Upon Signup
  • Demo User
  • Create, Update, and Delete Listings
  • Dashboard For Viewing Own Listings
  • Filtered View For Other Listings
  • Add New Reviews
  • Edit and Delete Reviews
  • Create, View, Edit, and Delete Bookings
  • Live Search Bar and Filters
  • AWS S3 Bucket Upload
  • Google Location Autocomplete API
  • Google Geolocation Capture API
  • Google Maps API
  • Neumorphic Design

Screenshots

Home Page

Main

Demo User

Demo

Sign Up

Signup

Login

Login

Recommended Listings

Listings

Live Search & Filters

Search   Filters

Listing Details

Listing Details And Features

Review Functionalities (Create, View, Edit, Delete)

Reviews

Create Listing

Creating Listings

My Listings

Viewing My Listings

Booking Reservations

Booking Reservations

My Bookings

Viewing My Bookings

Changing A Booking

Changing A Booking

Google Maps & Geolocation API

Google Maps API

Google Maps & Geolocation API

Google Autocomplete API

How To Run Locally & Deploy

To run locally, you must have NodeJS and Postgres installed on your machine. Once they are installed, Download/Git Clone the repo and create an .env and database following the .env.example located in the root of the repo. Then look at the repo's package.json located in both the backend and frontend folders to see what packages the project is dependant on. Use npm install in both folders to install those dependencies. If npm install doesn't work with React due to an outdated version, then try npm i --legacy-peer-deps. (Heroku needs the same thing if you wish to deploy. That's why in the outermost package.json the install script has "npm --prefix backend install backend && npm --prefix frontend install frontend --legacy-peer-deps".) After that, use Sequelize in the backend folder to run all the migrations (npx dotenv sequelize-cli db:migrate) and then run all pending seeds (npx dotenv sequelize-cli db:seed:all). Check to see if the database was properly seeded using psql. If seeded correctly, run npm start in both folders.

Dependencies

  • BcryptJS - Bcrypt in JS (hash passwords).
  • Cookie-Parser - Parse HTTPS request cookies.
  • Csurf - Node.js CSRF protection middleware.
  • Express - Node.js web framework.
  • Express Session - Session middleware for Express.
  • Express Validator - Validator module middleware for Express.
  • HTTP Errors - Create HTTP Error Objects.
  • Morgan - HTTP request logger middleware.
  • Per ENV - Clean up package.json.
  • React - User Interface Components.
  • Redux - State Management.
  • Sequelize - ORM.
  • Dotenv - Load environment variables.
  • Nodemon - Development monitoring script.
  • AWS - Cloud Storage.
  • Multer - Uploading Middleware.
  • Google APIs - Location Features.

Future Features

  • Implement a bookings feature. Completed!
  • Implement a search feature. Completed!
  • Implement a side map that shows location. Completed!
  • Animation.
  • Improved UI/UX. Completed!
  • Extended create listings functionality. Completed!
  • Extended create reviews functionality.

Technical Implementation

This is a great project for practicing making CRUD features with the PERN stack. It is also good practice for using Redux which is used for state management.

My map for making CRUD features goes as the following:

  1. Ensure that your database is set up correctly.
  2. Set up your router on your backend to hit the database.
  3. Set up your thunk function to hit the API server and dispatch the action creator.
  4. Set up your action creator / action object.
  5. Set up your reducer with switches and default cases.
  6. Be sure to export your reducer to rootReducer.
  7. Make a controlled component / useEffect that dispatches the thunk.
  8. useSelector is then used to listen into the state and pull relevant information from the "slice of state". You can now use that information to display data from your database.

About

Airbnb clone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors