{"id":15438105,"url":"https://github.com/kazvee/lightbnb","last_synced_at":"2026-04-11T19:35:52.655Z","repository":{"id":194898212,"uuid":"673129296","full_name":"kazvee/LightBnB","owner":"kazvee","description":"🏡 Multi-page property booking app that uses server-side JavaScript to display website search results obtained via queries to a PostgreSQL database.","archived":false,"fork":false,"pushed_at":"2024-01-04T02:24:37.000Z","size":3108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-28T06:31:55.368Z","etag":null,"topics":["express","nodejs","postgresql","sass"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kazvee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T00:12:21.000Z","updated_at":"2025-02-05T20:17:05.000Z","dependencies_parsed_at":"2023-09-15T17:24:13.873Z","dependency_job_id":"258992c3-0eb7-435f-8a64-df4d8091b2fa","html_url":"https://github.com/kazvee/LightBnB","commit_stats":null,"previous_names":["kazvee/lightbnb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kazvee/LightBnB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazvee%2FLightBnB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazvee%2FLightBnB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazvee%2FLightBnB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazvee%2FLightBnB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazvee","download_url":"https://codeload.github.com/kazvee/LightBnB/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazvee%2FLightBnB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31693272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","nodejs","postgresql","sass"],"created_at":"2024-10-01T19:00:35.138Z","updated_at":"2026-04-11T19:35:52.633Z","avatar_url":"https://github.com/kazvee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LightBnB\n\nLightBnB is a multi-page Airbnb clone. With a front-end provided by [LightBnB_WebApp](https://github.com/lighthouse-labs/LightBnB_WebApp), server-side JavaScript is used to display website search results, obtained via SQL database queries.\n\n## Final Product\n\n**Logged-in User View:**  \n\n![\"Screenshot Logged-in User View\"](/docs/logged_in_screenshot.jpg)\n\n**View of Create Listing page:**  \n\n![\"Screenshot of Create Listing\"](/docs/create_listing_screenshot.jpg)\n\n**View of Search page:**  \n\n![\"Screenshot of Search Options\"](/docs/search_options_screenshot.jpg)\n\n**View of Sign Up page:**  \n\n![\"Screenshot of Search Options\"](/docs/sign_up_screenshot.jpg)\n\n**View of Log In page:**  \n\n![\"Screenshot of Search Options\"](/docs/log_in_screenshot.jpg)\n\n## Purpose\n\nThis project was created by [me](https://github.com/kazvee) as part of my learnings at [Lighthouse Labs](https://www.lighthouselabs.ca/en/web-development-flex-program).\n\n## How to Use This Site\n\nWhether you’re a property owner eager to welcome new guests, an adventurer seeking your next home away from home, or a mix of both — we are a property booking site that runs right in your browser!\n\n\u003e**Latest News**:  \n\u003e 🏆  Proud self-nominee for this year's *\u003cu\u003eBest Property Booking Site\u003c/u\u003e* award, presented by the prestigious **LocalHost:3000 Magazine**! 😃\n\n### New or Returning Users  \n\nUse the **Sign Up** and **Log In** menu options to create a new owner listing, or view your existing active listings. If you’ve made any guest bookings, you can also view them from here!\n\n### For our Hosts  \n\nUse the **Create Listing** menu option to put your property's best square-footage forward with our intuitive marketing features:\n* Create a unique listing title to captivate and inspire potential guests\n* Provide a short description of your property and nearby visitor attractions\n* Highlight your listing with **two** exceptional photos\n* Include all essential guest information: *Number of bedrooms*, *Number of bathrooms*, *Number of parking spots*, and *Cost per night*\n\nClick on the **My Listings** menu option to view your existing listings.   \n\n### For our Guests\n\nClick on the **My Reservations** menu option to view full details about your confirmed reservations. Or use our search feature to plan your next getaway!\n\n### Just Browsing For Now?\n\nNo need to login to have a look around! Use our speedy **Search** feature to get inspiration for your next retreat!  \nTo narrow down your results, use our optional filters: *City*, *Minimum Price per Night*, *Maximum Price per Night*, and *Minimum Rating*.  \nOnce you've found the ideal local host on **your** localhost, make sure to **Register** or **Login** to book your reservation!\n\n## Stretch / Extra Features\n\nRecent database improvements will enable our front-end to be further developed to offer enhanced user experience\n* Different Rates for Different Dates:\n  * Hosts can set different pricing rates for certain date ranges, allowing flexibility for seasonal travel cost fluctuations\n* Guest Reviews, written by confirmed Hosts: \n  * Property owners can add reviews about their previous guests, offering increased transparency and accountability\n\n## Planned Improvements\n\n* Prices currently **include cents** when listing or booking properties, so typing in `10000` will equal `$100.00`. Please pay close attention when entering prices.  \n* After property owners use Create Listing, the newly-created entry will not immediately display under their My Listings, as this view currently only shows properties with existing guest review ratings.\n* Did our frontend developer use this site to book an extended vacation? 🤔 We'll be polishing up the look and feel of our online booking platform early next year!\n\n## Dependencies\n\n- [Express](https://expressjs.com/)\n- [Node.js](https://nodejs.org/)\n- [SASS](https://www.npmjs.com/package/sass)\n- [bcrypt](https://www.npmjs.com/package/bcrypt)\n- [cookie-session](https://www.npmjs.com/package/cookie-session)\n- [dotenv](https://www.npmjs.com/package/dotenv)\n- [nodemon](https://www.npmjs.com/package/nodemon)\n- [node-postgres](https://node-postgres.com)\n        \n## Getting Started\n\n### Set up Project Files\n\n1. Fork \u0026 Clone this repository to your local device.\n2. From within the project root folder, navigate into the 'LightBnB_WebApp' folder with the `cd LightBnB_WebApp` command.\n3. Install all dependencies using the `npm install` (or `npm i`) command.\n\n### Set up Database\n\n4. In a terminal window, connect to your PostgreSQL environment using `psql` and your login credentials.\n   * In some cases, the `startpostgres` command may need to be run first.\n5. Create a new database using the `CREATE DATABASE lightbnb;` command, where 'lightbnb' is the name you want to call this new db.\n6. Connect to the new database with the `\\c lightbnb` command, where 'lightbnb' is whichever name you chose for your new db in the the previous step.\n\n### Set up DB Tables\n\n7. Set up database tables by running the migrations file using the `\\i migrations/01_schema.sql` command.\n   * To verify the tables have been created, run command `\\dt` and you should see tables named: 'guest_reviews', 'properties', 'property_reviews', 'rates', 'reservations', and 'users'.\n\n### Add Data to Tables\n\n8. To add data the tables, run the seeds files. Please note that '01_seeds.sql' is optional, but can be useful for testing purposes.  \n**From the project root folder**, the commands to run are:  \n   * `\\i seeds/01_seeds.sql`\n   * `\\i seeds/02_seeds.sql`\n   * To confirm that your tables have been populated with data, run command `SELECT * FROM users;` (or any of the table names) and you should see some data displayed.\n   * You can now exit postgres by typing `\\q` to return to your command line.\n\n### Add Database Credentials to **dotenv** file (`.env`)\n\n9. Using the provided '.env.example' file as a template, create a new `.env` file in the same folder.\n10. Add your database name, username, and password.\n    * Note: If running the app locally, the 'DB_HOST' would be 'localhost', and for PostgreSQL the 'PORT' will usually be '5432'.\n    * For security reasons, the `.env` file has been added to the `.gitignore` file, so these sensitive details will not accidentally be published to GitHub.\n\n### Start the App\n\n11. **From within the 'LightBnB_WebApp' folder**, run the `npm run local` command, and the app will be served at [http://localhost:3000](http://localhost:3000).\n12. Visit [http://localhost:3000](http://localhost:3000) in your browser.\n13. Start planning your ideal getaway! 🏡\n\n## Queries\n\nTo run the various queries available, please ensure that you are connected and logged in to the database.   \nThen, use the code commands provided below (along with some examples of expected results) to interact with the database.\n\n1. Show details about a single user:  \n`\\i 1_queries/1_user_login.sql`  \n```\n id |     name      |          email          |                       password\n----+---------------+-------------------------+-------------------------------------------------------\n  4 | Devin Sanders | tristanjacobs@gmail.com | (displays hashed password, omitted here for security)\n(1 row)\n```\n\n2. Show average duration of all reservations:  \n`\\i 1_queries/2_average_length_of_reservation.sql`  \n```\n  average_duration\n---------------------\n 14.6648005598320504\n(1 row)\n```\n\n3. Show specific details (including average star rating) about properties located in Vancouver:  \n`\\i 1_queries/3_property_listings_by_city.sql`\n```\n id  |       title        | cost_per_night |   average_rating\n-----+--------------------+----------------+--------------------\n 200 | Build they         |          34822 | 4.2222222222222222\n 895 | Hold guess         |          41952 | 4.5000000000000000\n  64 | Extra sheep        |          48794 | 4.1428571428571429\n 152 | Present television |          53062 | 4.1666666666666667\n(4 rows)\n```\n\n4. Show the most visited cities, and the total number of reservations in each city:  \n`\\i 1_queries/4_most_visited_cities.sql`  \n```\n          city          | total_reservations\n------------------------+--------------------\n Carcross               |                409\n Town of Hay River      |                401\n Whitehorse             |                342\n Town of Inuvik         |                313\n Yellowknife            |                248\n(253 rows)\n```\n\n5. Show the 10 most recent reservations for a specific user:  \n`\\i 1_queries/5_all_my_reservations.sql`\n```\n   id    |     title      | cost_per_night | start_date |   average_rating\n---------+----------------+----------------+------------+--------------------\n 1017016 | Married rich   |          64002 | 2014-05-17 | 4.1666666666666667\n 1010127 | Sudden troops  |          16503 | 2014-08-17 | 3.7777777777777778\n 1012625 | Chapter still  |           2936 | 2015-07-30 | 4.2727272727272727\n 1013921 | Popular some   |          30184 | 2016-05-11 | 4.2857142857142857\n 1010623 | Law expression |          50749 | 2016-07-08 | 4.1666666666666667\n(10 rows)\n```\n\n## Project ERD (Entity Relationship Diagram)\n\nA link to the ERD with dynamic highlighting of table relationships is available [HERE](https://dbdocs.io/kayvee123/ERD-LightBnB?view=relationships)  \n\n![\"Screenshot of ERD\"](/docs/ERD-LightBnB.png)\n\n## Project Structure\n\n```\n.\n├── 1_queries\n│   ├── 1_user_login.sql\n│   ├── 2_average_length_of_reservation.sql\n│   ├── 3_property_listings_by_city.sql\n│   ├── 4_most_visited_cities.sql\n│   ├── 5_all_my_reservations.sql\n├── docs\n├── LightBnB_WebApp\n│   ├── db\n│   │   ├── json\n│   │   ├── database.js\n│   │   └── index.js\n│   ├── public\n│   │   ├── javascript\n│   │   │   ├── components \n│   │   │   │   ├── header.js\n│   │   │   │   ├── login_form.js\n│   │   │   │   ├── new_property_form.js\n│   │   │   │   ├── property_listing.js\n│   │   │   │   ├── property_listings.js\n│   │   │   │   ├── search_form.js\n│   │   │   │   └── signup_form.js\n│   │   │   ├── libraries\n│   │   │   ├── index.js\n│   │   │   ├── network.js\n│   │   │   └── views_manager.js\n│   │   ├── styles\n│   │   │   ├── main.css\n│   │   │   └── main.css.map\n│   │   └── index.html\n│   ├── routes\n│   │   ├── apiRoutes.js\n│   │   └── userRoutes.js\n│   ├── styles  \n│   │   ├── _forms.scss\n│   │   ├── _header.scss\n│   │   ├── _property-listings.scss\n│   │   └── main.scss\n│   ├── .gitignore\n│   ├── package-lock.json\n│   ├── package.json\n│   └── server.js\n├── migrations\n│   ├── 01_schema.sql\n├── seeds\n│   ├── 01_seeds.sql\n│   ├── 02_seeds.sql\n├── README.md\n```\n\n* `queries` is a directory that contains various SQL queries that can be run directly against the database.\n* `docs` is a directory containing supporting documentation \u0026 images for the `README.md` file.\n* `LightBnB_WebApp` contains all the LightBnB client side web app code.\n  * `db` contains all the database interaction code.\n    * `json` is a directory that contains a bunch of dummy data in `.json` files.\n    * `database.js` defines all queries related to the database and uses an imported `query` function to execute SQL queries against the database.\n    * `index.js` establishes a connection to the database and exports a `query` function used by `database.js` to interact with the database.\n  * `public` contains all of the HTML, CSS, and client side JavaScript. \n    * `index.html` is the entry point to the application. It's the only html page because this is a single page application.\n    * `javascript` contains all of the client side javascript files.\n      * `index.js` starts up the application by rendering the listings.\n      * `network.js` manages all ajax requests to the server.\n      * `views_manager.js` manages which components appear on screen.\n      * `components` contains all of the individual html components. They are all created using jQuery.\n  * `routes` contains the router files which are responsible for any HTTP requests to `/users/something` or `/api/something`. \n  * `styles` contains all of the sass files. \n  * `server.js` is the entry point to the application. This connects the routes to the database.\n* `migrations` is a directory that contains a schema file to setup the database tables.\n* `seeds` is a directory that contains seed files to add data to the database tables.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazvee%2Flightbnb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazvee%2Flightbnb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazvee%2Flightbnb/lists"}