My very first Hackathon and my first Dev.to post
Tags: cloud, showdev, babylonjs, oracle
Published: 2023-04-08 11:51:30

Hi! 

I am [Tena](https://www.linkedin.com/in/francisco-tena/), proudly from [Canary Islands](https://goo.gl/maps/qK2g6Vy3wLJkDsFF7), and I wanted to share with you my experience at my very first Hackathon ever. It's also the perfect excuse to write my first post, and that way I kill two birds with one stone. 

Everything started with an advertisement about [DeveloperWeek](https://developerweek-2023-hackathon.devpost.com/), As a good pro-lurker I have been I thought… “Mmm looks really nice, I’ll check out what they build when it's over” but then I realized that you can just register and maybe someone needs your skills, who knows!. 

And that’s how suddenly one day I received an email from [Dylan](https://www.linkedin.com/in/dylan-miller-swe/), who was looking for some colleagues to build a game he had in mind. I was very surprised because I really didn’t expect this to happen 😛.

Dylan has a very clear idea about how the game should be, so foremost we needed to understand his vision. So I needed to put all his ideas in paper (literally) not only for validation but also to detect some possible design flaws. Something like a pro would do:

<img width="100%" style="width:100%" src="https://pbs.twimg.com/media/Fh6qtzdUAAARaTI?format=jpg&name=large">

Just kidding, I created a very simplified low def mock-up, from which a few questions and thoughts arose. 

Having such a different time zones (±5 hours) gives us the advantage of having longer shifts when working in parallel, but that also means that we had a few problems to solve before going too technical: asynchronous communication and workflow. 

For that, Dylan already created a [Discord](https://discord.com/) server, where we can leave comments, share ideas, questions or just share our struggles. Later on, I realized that we also need some kind of planning to synchronize ourselves, so we created a [GitHub project](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) with a simple board to write down the current status but also what was pending and what is done as well as somewhere to put our thoughts on some ideas and discuss them. 

![GitHub Project screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cgfx5gmrnt7mqh0ax08g.png)

Next, we needed to have a strategy to get as many points as possible, and it looked like one of the most important parts was to use the most features available on [Oracle Cloud](https://www.oracle.com/cloud/). B[u{9}]t none of us knew anything about OCI! So what do you do when you have such a huge cake to eat? Easy (or not…), break it down into pieces and… just [read the docs](https://docs.oracle.com/en/cloud/get-started/index.html)! 

Then you realize that Oracle Cloud is not only the most generous Cloud Provider free tier without a doubt, but also a giant one that is growing every day. 

<img width="100%" style="width:100%" src="https://media.tenor.com/aiD_RViS7JYAAAAC/huge-donald-trump.gif">

I know it *is* overwhelming to see that huge amount of documentation, but one of the most important virtues a developer should have is resilience. So: one at a time, break it down, start from the beginning and avoid shortcuts is my advice in these cases.

I love mother nature and all of its wonders, and sometimes you can learn a lot from how she solves very difficult problems. In this case, I use the same technique a [Ruppell’s Griffon Vulture](https://ebird.org/species/ruegri1) does (or if you don’t like Griffons for whatever reason…, maybe a [Common Crane](https://ebird.org/species/comcra/)? 🤔): Fly as high as you can and spin around over some area of interest at a very high level, so you can go deeper if you think it’s worthy. 

Leaf through the docs, and go deeper LATER if you think it’s interesting for your use case, it's really easy to fall on [analysis paralysis](https://en.wikipedia.org/wiki/Analysis_paralysis) in these situations. That’s how I learned about what features we could use from OCI for our project, and I have to say it was hard, and it involved hours of reading and going back and forth, but totally worth it for having an overview of part of the Oracle Cloud ecosystem.

<img width="100%" style="width:100%" src="https://media.tenor.com/SlrNmKlb9wYAAAAC/johnny-johnny5.gif">

One thing that I didn’t know about Oracle Cloud is that, in my experience, I have never seen a better support ever before. I joined their [Devrel community](https://github.com/oracle-devrel), and this was a game changing situation. Their support and documentation are awesome, but it’s also impressive how many examples you can use to get started, from the simplest one to a really complex project, and you notice they really care about you getting on board, especially when you start using their workshops or just reading how they documented every project on every step. 

After that, I realized we could use all these shiny things 🤯:

- API Gateway: Fully managed gateway for governed HTTP/S interfaces
- [Load Balancer](https://docs.oracle.com/en-us/iaas/Content/Balance/home.htm): ...
- Container Engine for Kubernetes: Kubernetes on Oracle Cloud
- Container Registry: Service to distribute container images
- Email Delivery:	Enables sending emails
- Functions: Scalable, multi-tenant serverless functions based on [Fn](https://fnproject.io/)
- Monitoring: Integrated metrics from all resources and services
- Resource Manager: Infrastructure as code with Terraform
- Stream: Large scale data collection and processing
- Notifications: Broadcast messages to distributed systems
- Bucket: Object storage for media assets
- WAF: Web Application Firewall (OWASP, DDoS and ACM)
- ATP Database: Autonomous Database for persistence

With all this information, I started to work on the design of the backend solution dealing with messages using [Nats.io](https://nats.io/) when Lucas came up with the idea of using [Colyseus.io](http://Colyseus.io), which was a perfect fit for our needs* plus simplifies everything a lot!. *[Our needs at that time were: Time remaining to develop an MVP, and how to get the most from OCI while developing the game itself.]

Now we are finally set! (or so we thought). Dylan was already working on the client, learning about [Babylon.js](https://www.babylonjs.com/) and Lucas was already working on authentication and reading about Colyseus. I wanted to start a conversation about how the client - server communication should be because I already had some ideas about how to solve common problems such as protocols, backend solutions for messaging, scalability and availability; those were my first concerns. I have always been a backend guy and I must say that I suck at front end, and although I can do React and Angular, don’t ask me to do something fancy 😅.

Like the great Abraham Lincoln said, 

> Give me six hours to chop down a tree and I will spend the first four sharpening the axe.

We were running out of time while Dylan was using very precious hours of his sleep trying to make the game work, so I wanted us to focus on the development, not on the platform or details that could disturb us while developing the solution. But for that we needed to automatize as much as possible, especially everything related to deployment and infrastructure.

It was time to work on the infrastructure, we already made some decisions and assumed pros and cons. I already have worked with [Google Cloud](https://cloud.google.com/) and I especially love how they use Kubernetes, so I wanted to learn how I can use it in Oracle Cloud (via Terraform if possible). I use k8s and Terraform at my home lab, so it should be easy to set up the infrastructure for this project, and it was thanks to the [OCI Terraform provider](https://github.com/oracle/terraform-provider-oci). 

One important thing was to document every step I made for my team members, not only for validation but also for my future self, so I created a (very casual/ugly but functional) Google document where Lucas and Dylan can see the progress and share their thoughts. So we end up with something like this, a picture is worth a thousand words:


![Infrastructure diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fniwglcg2pj8wu8d714g.png)

The next step was to work on the CD/CI, and we chose to use the handy [GitHub Actions](https://github.com/features/actions) which will trigger the deployment to our Container Registry the necessary docker images every time we push a change in our main branch. 

Now I am working on some client refactoring using a state machine and on the backend and thinking about ways to optimize our workflow and developer experience while Dylan is improving the game.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51taew1x96lypy6a2fqg.png)


Likewise, if someone is interested, I will write a post about how I did it to reduce cloud costs to the minimum and how we are working on the backend.

We still have lots of ideas about how to improve it, and we will! It's a funny side project, and I must confess that I would have never imagined how much I could learn in 2 weeks about Oracle Cloud if it wasn’t because of this hackathon. . Now I want to have my OCI certification by the end of the year 😀.

---
The key is to have a motivation and a reachable short term goal.

---

And this is a summary of 2 weeks of hard work that made us [winners](https://devpost.com/software/foo-flighters) 🤯! I was surprised and astonished at the same time, and still am 😯. 

Congrats to [all participants](https://developerweek-2023-hackathon.devpost.com/project-gallery), I hope it was as enriching for you as it was for me 🥳.

I would like to thank [Dylan](https://devpost.com/dylan-r-miller517) for giving me the opportunity to work together on his game and of course to the [organizers](https://developerweek-2023-hackathon.devpost.com/), it was an amazing experience. 

Special mention to Niki Chen from [Oracle Devrel](https://developer.oracle.com/community/meet-the-devrel-team.html), your legendary support has been really important for me. 

See you in the next one!