Graviti: Behind the scenes of my first coding experience
A few months ago, I decided to get back to coding and not stop until I would ship something that solves one of my real-life problems.
The genesis of the idea
The problem I had was the following: Picking a place to meet with your friends when everyone lives on the other side of town. In Paris, when you want to meet with friends for dinner or drinks you either:
- End up in one of your friends’ favorite bar near his place, but you’re screwed in terms of travel time.
- End up in a shitty bar in the city center, and you’re screwed because those bars suck.
The idea seduced Antoine Fabre who helped me with the UI/UX. With his 6-month coding experience in Rails and React/React Native, my friend Romain Chambe also joined the project during the summer and we spent the month of September coding our MVP.
The result
Enter Gravity, a webapp that helps you find the optimal spot to meet with your friends. You enter all your friends and where they’ll be leaving from, and we push you recommended bars in a geographically ideal area for each of you. You can also choose to get restaurants, cafés, cinemas and parks.
Here’s an example of recommandations you can get thanks to Graviti:
The choice of the stack
I had learnt the basics of Ruby on Rails while I was a student back in 2013/2014, so I decided to use this framework. At first it wasn’t easy because Rails isn’t the best thing to use when you want to build something with lots of front-end interactions, especially with maps. But at the same time I didn’t want to spend a month learning a new language, so I dealt with it (disclaimer: jQuery became my best front-end friend).
How it works technically
- Our users enter their address. We use Algolia autocomplete API because their UX is great.
- We then calculate an optimal meeting area (the “Graviti” centre) based on a very basic « barycentre » math formula that uses each friend’s coordinates (latitude and longtitude). If several friends are leaving from the same area, they will have more weight in the equation: the recommended locations will be closer to them.
- We then use Google Places API to get the best places in the optimal meeting area.
What could be improved
- A more accurate definition of “Graviti” centre. For now we only calculate distance « as crow flies ». We don’t take into account transport time. We believe that for now, distance « as crow flies » is a good proxy of the transport time, but it can be flawed in some cases. For instance, if you live outside the city, some « express trains » like the RER can bring you to the city center in 10 minutes in Paris. We tried to investigate « isometric » APIs but they don’t work with our use case. To improve this calculation, we could investigate more advanced algorithms that cut in smaller areas the « polygon » limited by each friend location, see which area minimizes the transport time for each friend and repeat the operation until we are satisfied… But that’s way outside the scope of our MVP !
- More granular suggested places. For now, we push you up to 5 suggestions, but they can be irrelevant (e.g. you’re specifically looking for a wine bar, or an Italian restaurant). In those cases, you don’t have any option to drill down to a more specific type of place. Another idea could be the possibility to « refresh » places or get more recommandations. That might be something we could think about for a v2.
Thanks for reading me! I hope you will use and enjoy Graviti. If you have any feedback about this project, please send me feedback at lucas.didier at gmail.com