Git Product home page Git Product logo

ibslover's Introduction

Why this project built?

This is an open source project aim to help you find the neareast toilet.

Imagine someday you are about to shit in your pants, but you have no idea where to go! And you start to search on your map "where is the nearest public toilet?" "oh no😫😫😫 There is no public toilet AT ALL!!" "where is the closest McDonald's??" "Ah! Found it". And you walk 10 minutes to get there. But what you don't know is there is a nearer place you can go to release your stomach JUST BESIDES YOU!!! And this project is to help you avoid this situation.

How to use this app?

Starting with this project on your smartphone, just hit PANIC! button. It'll show you the nearest bathroom and guide you there automatically.

WHAAAAAT? You dont like that place? That's fine! You can also click other place with Toliet Signs and by clicking navigate to that place you'll also get directions to that place you just clicked.

Remember turn on your location feature and give this app permission to access your current location.

Getting Started

If you're looking to get a local copy of this project up and running on your machine, make sure to follow these steps.

Prerequisites

Before you can build this project, you'll need the following software installed:

  • Ensure NodeJs is installed on your machine.

Project Setup

  • Begin by cloning the project on your local machine:
git clone https://github.com/xxLovy/IBSLover.git
  • Then navigate into the directory you just cloned:
cd IBSLover

Backend Setup

  • Navigate to the Backend directory:
cd Backend
  • Create a .env file:
touch .env
  • Add those environment variables to the .env file, replacing 'YOUR_KEY' with your actual key:
GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_API_KEY
MONGODB_URI=YOUR_MONGODB_URI
  • Now, install backend dependencies:
npm install
  • Start the backend service:
node server.js

Frontend Setup

  • Navigate to the frontend directory:
cd Frontend/IBSLover
  • Install frontend dependencies:
npm install
  • Edit global.js file, add your backend server(api services) here.
export const api = 'YOUR_SERVER_ADDRESS'
  • Replace com.xxxuan.IBSLover with your bundleIdentifier and CFBundleURLSchemes in app.json

  • Run eas build:configure in your terminal to generate a eas.json file.

  • Run eas build --profile development --platform ios to generate a .ipa file with expo.

  • Follow the instructions, download this .ipa file on your iPhone

  • Click the file just downloaded then run npx expo start --dev--client to get started Make sure you iPhone and your mac are in the same network so you can connect

IMPORTANT NOTICE: 1. Presumably, your backend service should be on a remote server that can be reached. And a domain name for https configuration.(iPhone will automatically block http request)2. Ensure that the backend service is started before attempting to run the frontend.

TODO

  • Add some filters so users can choose their preferred locations (like if you don't want to use a toilet in a Walmart, you can filter that out)
  • Add a list view for a more intuitive display of places
  • Users can add toilets to the list
  • As the number of votes increases, the icon's color intensifies
  • Filter by the number of votes before hitting the PANIC! button
  • Allow users to log in (if they like) and save their favorite toilet spots or create custom locations which are presumably tested and proven to be reliable for the user himself/herself.
  • Propose existing names to users attempting to add a toilet if there is an existing one nearby within 20 meters, encouraging name consistency.
  • Use Google Matrix Distance to calculate the actual distance.
  • Still brainstorming...

ibslover's People

Contributors

xxlovy avatar yanzhanglovx avatar

Stargazers

 avatar Cucco avatar

Watchers

 avatar

ibslover's Issues

Caching Recent Search Queries Locally

In most cases, the bathroom information for a specific area won't drastically change within a single day. Under this premise, if a user conducts a search and the result is within the vicinity, say about 100 meters, we can save this result into the database. If another query is made by any user within this proximity shortly afterward, we can swiftly provide the results from the recent search instead of querying again.

This strategy will serve to boost search speed and reduce the frequency of Google Maps API calls. Considering that this app has a core user base—likely individuals with IBS, who are the main users—it's highly probable that these frequent users will perform queries within specific areas. Thus, relying on our database for rapid searches can alleviate the need for constant Google Maps API calls. I'm even contemplating whether we could leverage a fast-caching system like Redis instead of traditional databases such as MongoDB for speedier retrieval.
For the sake of data accuracy, the stored queries would be refreshed daily.

Security problem

The backend service lacks measures to prevent flood attacks. If the backend service API is reverse-engineered, it can be flooded with a large number of requests in a short period of time, leading to economic losses due to excessive calls to the Google Maps API.

Currently considered mitigation strategies:

  1. Google Maps API Key Usage Limitation: Apply a usage limit to the Google Maps API key. Each call increases the usage count, and when the usage reaches the daily limit, no further access is allowed.
  2. IP Usage Limitation: Restrict the number of requests from the same IP address within a short period of time.

Limitations

  • Theoretically, attackers can still conduct flood attacks by changing IP addresses. However, due to the usage limit imposed on the Google Maps API key, economic losses can be mitigated. Nevertheless, subsequent users may be unable to access our service.

Improving Location Accuracy for Toilet Entries

Description

Current Implementation: As it stands, when a user submits a new toilet location, the system checks the database for any existing toilets within a defined range, (let's say 20 meters). If a toilet is present within this proximity, it's assumed to be the same one, and the existing entry's vote count is incremented by one. If there is no matching entry, a new toilet with a vote count of one is added to the database.

Issue: This method presents a challenge when the user's GPS location isn't precise within 20 meters, leading to potential errors. One idea I'm considering is to insert the user's data into the toilet entry when a toilet is detected within the 20-meter range in the database. Subsequently, when displaying this data, the system would calculate the average of all the coordinates for that specific entry, resulting in a more accurate toilet location.

Seeking Better Solutions: I am exploring if there are any better methods to enhance the accuracy of this feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.