OpenSplit: Divide bills, unite friends 🤝

Inspiration 🧠

The inspiration for this project comes from out own experience using expense sharing apps. We were not satisfied with how these apps behaved from a UX standpoint, because of reasons like advertising or diary limits. That's what motivated us to tackle this problem.

What it does ⚒️

OpenSplit allows groups of friends to organise their group payments and expenses. All of us have shared a trip with some friends where, at the end, nobody knew how much they paid or who they paid it for during the trip. OpenSplit is able to register all of these expenses with an integrated Telegram bot. This helps the group show how much money each person owes, or gives the group the minimum number of transactions to balance the account.

OpenSplit also has a web interface. Users can log in to this page using their Telegram accounts. This interface centralizes information for each user, helping them to control their expenses and debts.

How we built it ⚙️

OpenSplit has three main components:

  • The Telegram bot @opensplit_bot, that manages interactions with users.
  • The Backend, which processes the incoming data, interacts with the database and calculates the minimum number of transactions.
  • The Web Interface, which shows information to users in a friendlier interface.

At first, we tried to implement the Telegram bot with Rust and teloxide, plus the tools Telegram offers. We found it more difficult than we expected, specially due to the limited time we have, so we decided to change to Python and python-telegram-bot library, which give us great results.

The backend uses Rust and Actix to handle the requests from the bot and the web interface, and we store all the info in a MongoDB database.

The frontend was made with React and Bootstrap, and finally, we decided to use Telegram Authentication for identifying the users in the web interface.

Challenges we ran into 💣

The 36 hours went by really fast, and we found some challenges which complicated our progress. These came from different parts of the project, but with patience, work and little sleep, we were able to overcome them.

The first big challenge we had to overcome was the use of technologies we had little experience in. We made the backend in Rust, but only one of us had previous experience in that language and even then, nobody had used it with MongoDB, another technology we didn't really know. We also used Telegram bots, which we had not tried before.

While part of the team was working with those problems, the other one was debating how to implement the algorithm to minimize the amount of transactions. This is a notoriously hard problem (NP-Complete!). We had to check out papers and search the Internet to find out how to implement it.

Finally, we knew that all the infrastructure needed an authentication module. Since we used Telegram accounts for the bot, we thought the best user experience would be to use this accounts for authentication on the web interface. This proved difficult from a design and implementation perspective, but in the end we reached a result we were happy with.

Accomplishments that we're proud of 💪

The challenges we faced made us even more proud of the achievements we reached. Some of them were:

  • With each hackathon, our teamwork capacities get better. We are very happy with the way we divided our work in order to achieve the best possible results.
  • We accomplished a functional Telegram bot, despite having little to no experience in that regard.
  • Rust was an almost unknown programming language for the majority of us. Working with it is always stimulating and a good reason to be happy with our performance.

What we learned 🧑‍🏫

Although it seems like a short time, 36 hours are enough to learn lots lessons:

  • How to implement a Telegram bot with the python-telegram-bot library.
  • Rust has a really steep learning curve, and the teloxide library doubly so.
  • How to authenticate users on a web service using Telegram accounts.
  • How to handle HTTP requests in Rust with Actix library.
  • How to work with NoSQL databases.
  • How to win a Nerf Gun Battle🔫.

What's next for OpenSplit 🔮

We thought of many features that could not be implemented due to the short amount of time we had. Some interesting ideas to expand the project could be:

  • Getting more user information in the OpenSplit web interface.
  • Adding new expenses from the web interface.
  • More flexibility for some of the Telegram bot commands, specially /add_expense.
  • Some improvements on our handling of the data in the MongoDB database.

Built With

Share this project:

Updates