freegeoip v3.0 · fiorix/freegeoip@0e7907b

3 min read Original article ↗
1+

# History of freegeoip.net

2+3+

The freegeoip software is the result of a web server research project that

4+

started in 2009, written in Python and hosted on

5+

[Google App Engine](http://appengine.google.com). It was rapidly adopted by

6+

many developers around the world due to its simplistic and straightforward

7+

HTTP API, causing the free account on GAE to exceed its quota every day

8+

after few hours of operation.

9+10+

A year later freegeoip 1.0 was released, and the freegeoip.net domain

11+

moved over to its own server infrastructure. The software was rewritten

12+

using the [Cyclone](http://cyclone.io) web framework, backed by

13+

[Twisted](http://twistedmatrix.com) and [PyPy](http://pypy.org) in

14+

production. That's when the first database management tool was created,

15+

a script that would download many pieces of information from the Internet

16+

to create the IP database, an sqlite flat file used by the server.

17+18+

This version of the Python server shipped with a much better front-end as

19+

well, but still as a server-side rendered template inherited from the GAE

20+

version. It was only circa 2011 that freegeoip got its first standalone

21+

front-end based on jQuery, and is when Twitter bootstrap was first used.

22+23+

Python played an important role in the early life of freegeoip and

24+

allowed the service to grow and evolve fast. It provided a lot of

25+

flexibility in building and maintaining the IP database using multiple

26+

sources of data. This version of the server lasted until 2013, when

27+

it was once again rewritten from scratch, this time in Go. The database

28+

tool, however, remained intact.

29+30+

In 2013 the Go version was released as freegeoip 2.0 and this version

31+

had many iterations. The first versions of the server written in Go were

32+

very rustic, practically a verbatim transcription of the Python server.

33+

Took a while until it started looking more like common Go code, and to

34+

have tests.

35+36+

Another important change that shipped with v2 was a front-end based on

37+

AngularJS, but still mixed with some jQuery. The Google map in the front

38+

page was made optional to put more focus on the HTTP API. The popularity

39+

of freegeoip has increased considerably over the years of 2013 and 2014,

40+

calling for more.

41+42+

Enter freegeoip 3.0, an evolution of the Go server. The foundation of

43+

freegeoip, which is the IP database and HTTP API, now lives in a Go

44+

package that other developers can leverage. The freegeoip web server is

45+

built on this package making its code cleaner, the server faster,

46+

and requires zero maintenance for the IP database. The server downloads

47+

the file from MaxMind and keep it up to date in background.

48+49+

This and other changes make it very Docker friendly.

50+51+

The front-end has been trimmed down to a single index.html file that loads

52+

CSS and JS from CDNs on the internet. The JS part is based on AngularJS

53+

and handles the search request and response of the public site. The

54+

optional map has become a link to Google Maps following the lat/long

55+

of the query results.