## Hack The Valley 4

Hack the Valley 2020 project

## On The Radar

**Inspiration**

Have you ever been walking through your campus and wondered what’s happening around you, but too unmotivated to search through Facebook, the school’s website and where ever else people post about social gatherings and just want to see what’s around?
Ever see an event online and think this looks like a lot of fun, just to realize that the event has already ended, or is on a different day?
Do you usually find yourself looking for nearby events in your neighborhood while you’re bored?
Looking for a better app that could give you notifications, and have all the events in one and accessible place?
These are some of the questions that inspired us to build “On the Radar” --- a user-friendly map navigation system that allows users to discover cool, real-time events that suit their interests and passion in the nearby area.

*Now you’ll be flying over the Radar!*

**Purpose**

On the Radar is a mobile application that allows users to match users with nearby events that suit their preferences.

The user’s location is detected using the “standard autocomplete search” that tracks your current location. Then, the app will display a customized set of events that are currently in progress in the user’s area which is catered to each user.

**Challenges**

* Lack of RAM in some computers, see Android Studio (This made some of our tests and emulations slow as it is a very resource-intensive program. We resolved this by having one of our team members run a massive virtual machine)
* Google Cloud (Implementing google maps integration and google app engine to host the rest API both proved more complicated than originally imagined.)
* Android Studio (As it was the first time for the majority of us using Android Studio and app development in general, it was quite the learning curve for all of us to help contribute to the app.)
* Domain.com (Linking our domain.com name, flyingovertheradar.space, to our github pages was a little bit more tricky than anticipated, needing a particular use of CNAME dns setup.)
* Radar.io (As it was our first time using Radar.io, and the first time implementing its sdk, it took a lot of trouble shooting to get it to work as desired.)
* Mongo DB (We decided to use Mongo DB Atlas to host our backend database needs, which took a while to get configured properly.)
* JSON objects/files (These proved to be the bain of our existence and took many hours to get them to convert into a usable format.)
* Rest API (Getting the rest API to respond correctly to our http requests was quite frustrating, we had to use many different http Java libraries before we found one that worked with our project.)
* Java/xml (As some of our members had no prior experience with both Java and xml, development proved even more difficult than originally anticipated.)
* Merge Conflicts (Ah, good old merge conflicts, a lot of fun trying to figure out what code you want to keep, delete or merge at 3am)
* Sleep deprivation (Over all our team of four got collectively 24 hours of sleep over this 36 hour hackathon.)

**Process of Building**

* For the front-end, we used Android Studio to develop the user interface of the app and its interactivity. This included a login page, a registration page and our home page in which has a map and events nearby you.
* MongoDB Atlas was used for back-end, we used it to store the users’ login and personal information along with events and their details.
* This link provides you with the Github repository of “On the Radar.” <https://github.com/maxerenberg/hackthevalley4/tree/master/app/src/main/java/com/hackthevalley4/hackthevalleyiv/controller>
* We also designed a prototype using Figma to plan out how the app could potentially look like.
The prototype’s link → <https://www.figma.com/proto/iKQ5ypH54mBKbhpLZDSzPX/On-The-Radar?node-id=13%3A0&scaling=scale-down>
* We also used a framework called Bootstrap to make our website. In this project, our team uploaded the website files through Github.
The website’s code → <https://github.com/arianneghislainerull/arianneghislainerull.github.io>
The website’s link → <https://flyingovertheradar.space/#>

*Look us up at*

# <http://flyingovertheradar.space>
## Inspiration

Being frugal students, we all wanted to create an app that would tell us what kind of food we could find around us based on a budget that we set. And so that’s exactly what we made!

## What it does

You give us a price that you want to spend and the radius that you are willing to walk or drive to a restaurant; then voila! We give you suggestions based on what you can get in that price in different restaurants by providing all the menu items with price and calculated tax and tips! We keep the user history (the food items they chose) and by doing so we open the door to crowdsourcing massive amounts of user data and as well as the opportunity for machine learning so that we can give better suggestions for the foods that the user likes the most!
But we are not gonna stop here! Our goal is to implement the following in the future for this app:

* We can connect the app to delivery systems to get the food for you!
* Inform you about the food deals, coupons, and discounts near you

## How we built it

### Back-end

We have both an iOS and Android app that authenticates users via Facebook OAuth and stores user eating history in the Firebase database. We also made a REST server that conducts API calls (using Docker, Python and nginx) to amalgamate data from our targeted APIs and refine them for front-end use.

### iOS

Authentication using Facebook's OAuth with Firebase. Create UI using native iOS UI elements. Send API calls to Soheil’s backend server using json via HTTP. Using Google Map SDK to display geo location information. Using firebase to store user data on cloud and capability of updating to multiple devices in real time.

### Android

The android application is implemented with a great deal of material design while utilizing Firebase for OAuth and database purposes. The application utilizes HTTP POST/GET requests to retrieve data from our in-house backend server, uses the Google Maps API and SDK to display nearby restaurant information. The Android application also prompts the user for a rating of the visited stores based on how full they are; our goal was to compile a system that would incentive foodplaces to produce the highest “food per dollar” rating possible.

## Challenges we ran into

### Back-end

* Finding APIs to get menu items is really hard at least for Canada.
* An unknown API kept continuously pinging our server and used up a lot of our bandwith

### iOS

* First time using OAuth and Firebase
* Creating Tutorial page

### Android

* Implementing modern material design with deprecated/legacy Maps APIs and other various legacy code was a challenge
* Designing Firebase schema and generating structure for our API calls was very important

## Accomplishments that we're proud of

**A solid app for both Android and iOS that WORKS!**

### Back-end

* Dedicated server (VPS) on DigitalOcean!

### iOS

* Cool looking iOS animations and real time data update
* Nicely working location features
* Getting latest data from server

## What we learned

### Back-end

* How to use Docker
* How to setup VPS
* How to use nginx

### iOS

* How to use Firebase
* How to OAuth works

### Android

* How to utilize modern Android layouts such as the Coordinator, Appbar, and Collapsible Toolbar Layout
* Learned how to optimize applications when communicating with several different servers at once

## What's next for How Much

* If we get a chance we all wanted to work on it and hopefully publish the app.
* We were thinking to make it open source so everyone can contribute to the app.
## Inspiration

Currently, there is an exponential growth of obesity in the world, leading to devastating consequences such as an increased rate of diabetes and heart diseases. All three of our team members are extremely passionate about nutrition issues and wish to educate others and promote healthy active living.

## What it does

This iOS app allows users to take pictures of meals that they eat and understand their daily nutrition intake. For each food that is imaged, the amount of calories, carbohydrates, fats and proteins are shown, contributing to the daily percentage on the nutrition tab. In the exercise tab, the users are able to see how much physical activities they need to do to burn off their calories, accounting for their age and weight differences. The data that is collected easily syncs with the iPhone built-in health app.

## How we built it

We built the iOS app in Swift programming language in Xcode. For the computer vision of the machine learning component, we used CoreML, and more specifically its Resnet 50 Model. We also implemented API calls to Edamam to receive nutrition details on each food item.

## Challenges we ran into

Two of our three team members have never used Swift before - it is definitely a challenge writing in an unfamiliar coding language. It was also challenging calling different APIs and integrating them back in Xcode, as the CoreML documentation is unclear.

## Accomplishments that we're proud of

We are proud of learning an entirely new programming language and building a substantial amount of a well-functioning app within 36 hours.

## What's next for NutriFitness

Building our own machine learning model and getting more accurate image descriptions.