I’m happy to announce I’m releasing as open source the backend of the application I’ve been working on in the past 5 months 🙂

Introduction

Smart Backpacker is an App, available for Android and iOS, where you can easily find Visa Requirements, Currency Exchange, Health Information and Airline’s Baggage Policy, no matter what your nationality is! And it’s worth mentioning it’s 100% Free with No Advertisements ;).

Tech Stack

As you might know from previous posts, my default choice is the Typelevel stack, but for this project I’m also using some other libraries, mainly the ones part of the Cats ecosystem.

The project consists of four sbt modules abstracting over the effect type F[_] using the Cats Effect library:

Airlines : Uses mainly fs2.io to read airline’s information from files and persist it to the DB using Doobie in a streaming fashion way.

: Uses mainly to read airline’s information from files and persist it to the DB using in a streaming fashion way. Api : It’s the core of the backend and exposes the main HTTP API using Http4s , Tsec , Circe and Doobie .

: It’s the core of the backend and exposes the main HTTP API using , , and . Common : Contains utils for IO , Stream , logging, testing, etc.

: Contains utils for , , logging, testing, etc. Scraper: It has all the scrapers and HTML parsers, in addition to the DB Repositories. It uses scala-scraper and Doobie .

Find out more at the GitHub project’s page.

Why Open Source?

I believe in the power of the open source community and I have benefited from it since I started writing code (+15 years ago). So this is my way to give something back. Also, by making it open source, I’m exposed to the criticism of the masses that will inevitably force me to become a better developer.

Running Environments

At the moment there are two environments: Development and Production. The first one runs on a free instance of Heroku and the productive one on a CentOS 7.x in the cloud, using the SBT Native Packager to generate the executable files and HA Proxy as a load balancer and TLS/SSL manager.

Find below some metrics of the Production server:

Average HTTP Request – Response Throughput of 320 ms over TLS/SSL .

over . Scraping + Persisting the visa requirements of all the countries runs in an average time of 45 seconds .

. Scraping + Persisting the health information of all the countries runs in an average time of 1 minute.

Other Projects

In addition to the backend, both the website and the documentation are generated using Open Source tools such as Hugo and Slate. These two projects have been open source since day one. Feel free to look into the GitHub organization’s page. Oh… and I hope to open source (soon) the Android App code as well so stay tuned 🙂

Special Mentions

Last but not least, I want to thank all the folks in the community that have been extremely helpful in providing feedback as well as direct help:

Infinite thanks to @sheinix for making the iOS app a reality.

a reality. @tpolecat for the help with Doobie .

. @jmcardon and @aeons for the help with the JWT Authentication part.

part. @rossabaker, @ChristopherDavenport and @SystemFw for the help with Http4s .

. @mpilquist for the help with Fs2 .

Spread the word!

Cheers,

Gabriel.