Skip to content

1. Model and Engine

colyoon edited this page Apr 19, 2022 · 21 revisions

Story Map

Story Map

Engine Architecture

Engine Architecture

Views

There are two main views: the 2D map view that is more akin to a standard map UI and the AR view in which nearby posts will be visible as if they were a part of the real world.

The 2D map view will be generated using Mapbox SDK for Android by providing it the GPS location of the device along with the locations of the nearest pins. The user's location is needed so the map view can zoom in to the right area of the world while the nearest pin locations are need to appear as pins on the map UI.

The AR view is facilitated by Google’s ARCore, which takes ImageViews created by pulling images from the backend based on the user’s location and displays them in AR space. Whenever the user moves a given distance away from their original location, the AR view automatically repeats the call to the backend and (updates the displayed images at the new location)[https://github.com/michigan224/Interesting-Co/blob/e0e710951a51951295366d19df679b5806b06f3c/rememri/app/src/main/java/edu/umich/interestingco/rememri/ARView.java#L151-L165]. Finally, the AR view sets an OnTapListener that listens for when the user taps on a photo in AR and sends it to the 2D comment view from our main view if the user taps on the photo.

Pins Service

This service can primarily be split into two categories: posting pins and getting pins.

Posting pins requires the user ID and the image but also the location as latitude and longitude. The city of the location is then found by using the Google Maps API, which is important for the sake of being able to index posts by city. The ability to index posts by city greatly alleviates computational pressure in the processes of getting nearby pins.

The main difficulty in getting pins is in determining which pins are nearby. The posts being indexed by city helps to heavily reduce the amount of posts that this service needs to look through to determine the distance to the user. The distance to the user is calculated using the Google Maps API. Once a set of nearby posts are determined, they are returned for the Mapbox view or the ARCore-Location view to show in the frontend.

Friend Service

This service is simply to deal with friends and friend requests. Using only user IDs, friends can be viewed and friend requests can be made, accepted, or rejected.

Firestore

Firestore will be where we store all of our server-side data. We will use Cloud Functions to act as the services.

Clone this wiki locally