{"id":20001743,"url":"https://github.com/boer-coding/safestayny-search-platform","last_synced_at":"2026-02-03T21:32:03.053Z","repository":{"id":256651409,"uuid":"774678418","full_name":"boer-coding/safeStayNY-search-platform","owner":"boer-coding","description":"A powerful search platform using React, Node.js, and AWS-hosted MySQL, merging Airbnb listings with real-time NYC crime data 🏙️🛏️🚨. This tool helps users make informed booking decisions with features like crime analysis and safety-based recommendations, leading to a 30% increase in user satisfaction 📈😊.","archived":false,"fork":false,"pushed_at":"2024-09-23T20:19:54.000Z","size":151960,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T22:11:23.226Z","etag":null,"topics":["css","css3","html","html5","javascript","mui","mui-material","react","react-hooks","react-router","react-router-dom","reactjs"],"latest_commit_sha":null,"homepage":"https://safe-stay-ny-fullstack-search-platform.vercel.app","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/boer-coding.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":"2024-03-20T01:11:50.000Z","updated_at":"2024-10-09T20:45:42.000Z","dependencies_parsed_at":"2024-11-13T05:29:27.741Z","dependency_job_id":null,"html_url":"https://github.com/boer-coding/safeStayNY-search-platform","commit_stats":null,"previous_names":["boer-coding/safestayny-full-stack-project","boer-coding/safestayny-fullstack-searchplatform","boer-coding/safestayny-search-platform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/boer-coding/safeStayNY-search-platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boer-coding%2FsafeStayNY-search-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boer-coding%2FsafeStayNY-search-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boer-coding%2FsafeStayNY-search-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boer-coding%2FsafeStayNY-search-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boer-coding","download_url":"https://codeload.github.com/boer-coding/safeStayNY-search-platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boer-coding%2FsafeStayNY-search-platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276022568,"owners_count":25571820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["css","css3","html","html5","javascript","mui","mui-material","react","react-hooks","react-router","react-router-dom","reactjs"],"created_at":"2024-11-13T05:18:35.138Z","updated_at":"2025-09-20T00:32:33.498Z","avatar_url":"https://github.com/boer-coding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SafeStayNY Search Platform\n\n### Live Website:\n[![Live](https://img.shields.io/badge/Live-Site-blue)](https://safestayny.vercel.app/)\n\n\u003c!-- ### Cover Image:\n![SafeStayNY_cover](media/home.png) --\u003e\n\n### Live Video:\n[![SafeStayNY Cover](./client/public/home.png)](https://safestayny.vercel.app/video.mp4)\n\nWelcome to SafeStayNY, your go-to platform for insights and recommendations on safety statistics, personalized host discovery, and Airbnb listings with safety scores in New York City. 🏙️🔍\n\nWhile traditional platforms like Airbnb focus on price and availability, many users want more—like knowing which neighborhoods are safe 🛡️ and which hosts are trustworthy 🏠 for a better rental experience.\n\nOur platform meets these needs by analyzing recent crime data 📊 to evaluate neighborhood safety across NYC. We also highlight top hosts based on user preferences 🌟 and generate tailored Airbnb listings that prioritize safety and your other specific criteria. 🗺️🔑\n\n---\n\n## 🎬 Key Features:\n\n- **Crime Information:** View statistical data on top crime types and demographics, with filters to refine results for specific areas or the entire New York City region.📊🔍\n- **Host Search:** Search or filter for trusted Airbnb hosts based on preferred neighborhoods, superhost status, and user-valued factors. Explore intuitive bar visuals and convenient links for further details.🏠🌟\n- **Airbnb Recommendations:** Get recommendations for safe accommodations in New York through various filters, including five featured listings with the lowest crime rates and prices in each Neighborhood Group.🏙️🔑\n\n## 🛠️ Project Architecture\n\n### Backend\n- **MySQL:** Relational database management system for storing and managing data.\n- **Node.js:** Server-side runtime for handling API requests and interacting with the database.\n- **Express:** Web application framework for Node.js, used to build and manage API endpoints.\n\n### Frontend\n- **React:** JavaScript library for creating dynamic user interfaces.\n- **Material-UI:** Collection of React components for streamlined and efficient web development.\n\n\n## 📊 Database Design\n\nThe database design of SafeStayNY is meticulously crafted to manage over 2 million NYPD arrest records and nearly 40,000 NYC Airbnb listings, ensuring efficient data retrieval and robust management. Below is an overview of the key tables and their relationships, illustrated by an ER diagram:\n\n### ER Diagram\n\n![ER Diagram](data/ER.png)\n\nThe database is designed to be in Third Normal Form (3NF) and Boyce-Codd Normal Form (BCNF) to minimize redundancy and enhance data integrity. Here's an overview of the structure:\n\n- **airbnb:** Contains details about Airbnb listings, including attributes like `listing_id`, `listing_des`, `listing_url`, `room_type`, `price`, `longtitute`, and `latitude`.\n- **host:** Stores host information linked to Airbnb listings.\n- **reviews:** Stores reviews related to Airbnb listings.\n- **arrest_list:** Holds New York arrest records, including attributes like `arrest_id`, `arrest_date`, `longtitute`, and `latitude`.\n- **suspect:** Stores suspect data tied to arrest records.\n- **location:** Contains location data, including attributes like `location_id`, `neighborhood`, and `neighborhood_group`.\n\nTo further normalize the original data tables and achieve BCNF, we decompose tables to eliminate any remaining functional dependencies. For example, we split a table that stores both `airbnb` and `host` information into two separate tables. This process helps ensure that each table contains data related to a single topic and reduces redundancy.\n\n### Benefits of BCNF:\n\n- **Eliminates Redundancy:** Reducing redundancy minimizes storage costs and prevents data anomalies.\n- **Improves Data Integrity:** Organizing data into well-structured tables ensures consistency and accuracy.\n- **Enhances Query Performance:** Optimized tables lead to more efficient queries, improving overall database performance.\n\nBy adhering to these normalization principles, SafeStayNY maintains a robust and efficient database structure that minimizes redundancy and ensures data integrity.\n\n## 🚀 Optimization Strategies\n\nGiven the large dataset with millions of entries, initial loading times were quite long. To enhance performance and reduce loading times, we implemented several optimization strategies:\n\n1. **Caching:** To address the performance challenges associated with joining large tables, we implemented caching by creating intermediate tables, as MySQL does not support materialized views. Specifically, we introduced the `crime_count` table, which stores `location_id`, `neighborhood`, `neighborhood_group`, and pre-calculated `count` values using the SUM() function. With only 306 tuples, this table is approximately 1000 times smaller than the original join output, allowing for efficient joins with other tables. This optimization significantly reduced the time spent on multiple joins, boosting data retrieval speed and improving overall application performance.\n\n2. **Indexes:** We created indexes on columns frequently used in `WHERE` and `ORDER BY` clauses to enhance query performance. Given that major queries often involve the `neighborhood` and `neighborhood_group` attributes, we introduced a compound index with `neighborhood_group` as the prefix. This indexing strategy optimizes performance for queries that may or may not specify the `neighborhood`, resulting in significant improvements in search and sorting efficiency.\n\nThese strategies boosted performance and reduced load time by over 80%, cutting some page load times from over 15 seconds to under 5 seconds.\n\n## 📘 References and Credits\n\n- **Inside Airbnb: Get the Data:** [Airbnb Datasets](https://insideairbnb.com/get-the-data/)\n- **NYPD Arrest Data (Year to Date) Catalog:** [NYPD Arrest Datasets](https://catalog.data.gov/dataset/nypd-arrest-data-year-to-date)\n- **React:** [React Documentation](https://reactjs.org/)\n- **Node.js:** [Node.js Documentation](https://nodejs.org/en/)\n- **MySQL:** [MySQL Documentation](https://dev.mysql.com/doc/)\n\n## ✨ Contributors\n\n- 👩‍💻 **Boer Liu:** [@boer-coding](https://github.com/boer-coding)\n- 👩‍💻 **Hannah Luan** [@hqluan](https://github.com/hqluan)\n- 👩‍💻 **Ying Zhang**  [@athrala](https://github.com/athrala)\n- 👨‍💻 **Ford Guo** [@codingnoobyford](https://github.com/codingnoobyford)\n\n## Dependencies:\n\n`npm install`\u003cbr /\u003e\n`npm install recharts`\u003cbr /\u003e\n`npm install @mui/icons-material`\n\n## Instruction to build: \n\nIn the project directory, you can run:\u003cbr /\u003e\n`npm start`\u003cbr /\u003e\nRuns the app in the development mode. \u003cbr /\u003e\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\u003cbr /\u003e\n\n---\nStart exploring SafeStayNY today and discover the safest areas in New York for your stay! 🏙️✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboer-coding%2Fsafestayny-search-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboer-coding%2Fsafestayny-search-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboer-coding%2Fsafestayny-search-platform/lists"}