/LightBnB

Database project inspired from AirBnB allowing practice with the SQL language using PostgreSQL

Primary LanguageJavaScript

LightBnB

LightBnB is a simple application clone to AirBnB.

Users sign up for an account where they can create a new listing to rent out their homes to people on vacation. Account holders can search for properties available for rent using the Search feature, which pulls data from the database. Account holders can also view any existing properties they own and have listed for rent as well as view past and current reservations.

The purpose of this project was to design a database using server-side JavaScript to display the information from queries to web pages. It offered practice working with simple and complex SQL queries, relational databases and ERD (entity relationship diagram) design to integrate the database with a Node backend, using PostgreSQL and node-postgres (Node PG).

Final Product

Sign up page "Signup page"

Login page "Login page"

Logged in view "View when user logged in"

Search for a rental property "Search page with filters

View past and current reservations My Reservations page showing past and current reservations

Database Structure

ERD showing each table's relationship to one another "ERD from Draw.io displaying each table and their relationships to one another"

Project Structure

  • 1_queries contains some SQL queries to retrieve data from the PostgreSQL database
  • LightBnB_WebApp contains HTML, CSS, and JavaScript (client and server side) code as well as database code to render the contents for the app
  • docs contains screenshots of the app
  • migrations contains sql files to create the tables needed for the database
  • seeds contains sql files to populate each of the database's tables with data

Getting Started

  1. Create a new repository using this repository as a template.
  2. Clone your repository onto your local device.
  3. Install dependencies using the npm install command.
  4. Start the web server using the npm run local command. The app will be served at http://localhost:3000/.
  5. Go to http://localhost:3000/ in your browser (preferably Chrome).

Dependencies

  • bcrypt: ^3.0.6
    • (If you receive an error after starting the server, uninstall bcrypt and install it again using a higher version e.g. version 5.1.0)
  • body-parser: ^1.19.0
  • cookie-session: ^1.3.3
  • express: ^4.17.1
  • nodemon: ^1.19.1
  • pg: ^8.7.3