Inspiration

Every semester, dozens upon dozens of GroupMe messages are sent, Reddit threads are created, and upperclassmen are texted, as Duke students desperately try to find classes that not only will fulfill their graduation requirements, but that they will enjoy. Although DukeHub can filter classes for you by curriculum codes, areas of knowledge, subject, and times offered, it cannot take into account your preferences to find which of those classes you will like.

What it does

When a user opens Mochila, they can search for classes they've previously taken through the DukeHub API. They can then indicate whether they liked each class or not. Using a K-nearest-neighbors algorithm we wrote from scratch, our app will then recommend other classes the user might enjoy, based on what other users with similar preferences enjoyed. Users can filter these recommendations by subject and can save courses that they are interested in taking.

How we built it

We used Google Firebase for both our authentication and storage solutions. Users can log on and their profiles will be saved in Google's Firestore database. Even better, any changes they make to their ratings on the app, or any classes they rate additionally are automatically added to the user's data in the database.

Our KNN algorithm built from scratch works asynchronously and basically does a scan on the entire database, compiling users similar to the logged-on user, and finding what classes those similar users liked and ultimately recommending those new classes to our logged-on user.

Challenges we ran into

Lots of them! We ran into lots of concurrency issues when trying to access database information asynchronously while also trying to populate said data.

Building our KNN algorithm took some time since we had to perform a search across all users in our database, gather all their course ratings information, and then compute vector distances between those users and our logged-on user.

Swift was new to some of us, so we had to learn that "on-the-go" as well.

We also had trouble finding common times to meet to code. Most of our coding was done in pairs (as opposed to us 4 being in the same room), so we had to really leverage GitHub and texting to keep everyone up to date on our progress.

Accomplishments that we're proud of

This was a challenging but rewarding undertaking. We had to write a not-so-simple algorithm from scratch. We had to build authentication and storage solutions for our users using Google Firebase--a cloud service none of us had used prior. We had to build an entire app on Swift, moving large swaths of user data across views, making sure that a asynchronous API calls and database queries were happening, our data was not corrupted, lost, or needlessly altered.

Our app is scalable, fully-functioning, and our recommendations will only get better as more people use the app (the more users rate stuff, the better KNN gets!!).

What we learned

About 5 hours before the deadline, the main functionality--KNN--wasn't working. Honestly, given we had stayed up the entire night before, we seemed quite ready to give up. It sounds cliche, but it was definitely one of those moments in the movie where the protagonists up and quits.

But... we didn't. And an hour later we added some concurrency handling and suddenly: EVERYTHING WORKED. So, even though we learned or improved our ability to code in Swift, use Google cloud services, and improve our algorithmic knowledge, the biggest lesson for us was definitely perseverance. In the moment, a bump might seem like a mountain, but in reality, it might just end up being exactly that: a bump, a minor hurdle waiting to be overcome.

What's next for Mochila

We want to get even more course information from DukeHub; stuff like course codes (e.g., CZ, CCI), course descriptions, a user's degree progress, and so on. This way, our recommendations can be even more robust. For example, we list the recommendations that will best satisfy your degree and course code requirements.

We'd like to make our UI more navigable, and allow users to give written feedback about classes. We could use this written data and feed it into our KNN as vectors, and use this to generate even more sophisticated recommendations.

We want to talk to Duke students about our app and see if the app excites them. If so, we want to gather ideas on what else we could add to make the app useful for Duke students (and beyond).

Built With

Share this project:

Updates