September 12, 2017

My First Hackathon

Last Wednesday, I participated on IAK Hackathon, held by Indonesian Google Developer Group. It was first Hackathon.

I was surprised that more than 50% of the participants are much younger than me. Luckily my teammate, was not so distant in age with me. It was a fun event, where we got the chance to get a bunch of cool advice and perspectives on developing attractive application from an experienced mentor, especially in a Hackathon where time is not a luxury that we had.

Since the theme of the Hackathon was "Sports and Healthy Lifestyle", my team developed an Android application called "MamaOlga" which in Indonesian stands for "Mari-mari Olahraga" (Eng: Let's do sport together). The app basically searches people who has common sports interest in nearby location.

Unfortunately I didn't got the chance to code the Android part, instead, as my specialty, I did the REST API backend. With Laravel. With Passport. I would like to make a special article about providing a usable RESTful API, with clean JSON responses for Android apps someday. But in this article, I'm only going to share the full source code.

So, here it is:
https://drive.google.com/file/d/0BwO5-mGH9haoSXUxNXU2cDY1Nm8/view?usp=sharing

And here is the presentation slides:
https://docs.google.com/presentation/d/1Be9Rpj2nX0fqFjCockxSlbd5HM8G1nbNUIMcXMN8JJI/edit?usp=sharing

The flow of the REST API is as follow:

  1. Client requests for an access token by submitting app client_id, and client_secret. App users mus also provide username and password.
  2. API respond with an access token if the credentials on step 1 is correct.
  3. The access token can then be used to fetch other data by requesting to several endpoints, such as:
    • Get users nearby
    • Get joined chat groups
    • Get chat threads based on group
    • Invite someone to private chat
    • Get chat threads on a private channel

Perhaps someone would develop this REST API even further, or as an example to your project or your Hachaton ^_^.

Please leave a comment below if you have any question, or if you want to share your first Hackathon experience.