yourfreebooking.com

Inheritance
yourfreebooking.com homepage

Just like Flowey CMD, yourfreebooking.com is a project that TenTwentyFour1024 inherited from a team that had started its development, but was unable to bring it to a close. Structurally sane, with only a few flaws in the build process, this MEAN (Mongo, Express, Angular, NodeJs)-based project unfortunately never reached a state under the initial team where it could have been deployed to production. TenTwentyFour1024 accepted the challenge to dig into an existing code-base, bring the project to completion, and handle all infrastructure aspects.

Having sorted through a first batch of challenges, such as merging in half a dozen feature branches that were in no obvious order and often in an indeterminate state, TenTwentyFour1024 proceeded with updating the existing code-base and weeding out any unused code and functionalities.

Implementation of the core concept of yourfreebooking.com, the algorithm that allows 1 in 100 bookings to be fully refunded, was completely up to TenTwentyFour1024 and so was both error handling and managing booking state, which we’ll dive into a little later.

As an Expedia Affiliate Network partner site, yourfreebooking.com makes use of their EAN-API to retrieve hotel information and place bookings. Having been through a few revisions since development on yourfreebooking.com had been halted, the node module developed to communicate with this API – whose documentation is, to be totally blunt, a little challenging – had to be brought up to speed and adapted to the most recent API version.

Challenges
Room listing for a hotel

Briefly after the page first went live, TenTwentyFour1024 faced a new problem: Expedia had deprecated the part of its API that was used to identify cities and regions and decided to remove it just as swiftly. Having already previously discussed ditching this part of the API and replacing it with our very own location index on an ElasticSearch server, TenTwentyFour1024 had no other choice but to put this plan into action as fast as possible.

In the end, having our own search engine allowed us to get more reliable results, adding support for fuzzy search and ngrams, and empowered us to add more lucene powered functionality in the medium run. Having ES in place, TenTwentyFour1024 has begun adding hotel search and suggestions.

Two additional challenges in this otherwise straightforward project were handling bookings and errors. The EAN API defines a large range of possible errors related to bookings, credit cards, etc., but forewarns that this list is nowhere near exhaustive. Indeed, since EAN themselves are forwarding some requests to their suppliers and in turn returning their errors and exceptions, it’s possible that the system encounters errors it has never seen before and doesn’t yet know how to handle. Is the error critical or can the user resume his booking? Error handling has turned out to be a real challenge in this project.

Likewise bookings: whenever a customer books a hotel on yourfreebooking.com, a booking request is dispatched through the EAN API. The initial state of any booking is UNDEFINED and with most bookings, this state quickly resolves to CONFIRMED. So quick in fact that the status is returned with the response to our initial request. Some requests however take some time to resolve, which is why TenTwentyFour1024 had to implement a service that stores any unresolved bookings in a redis key-value store and regularly queries the EAN service for their state. For bookings that do not resolve after a pre-defined period, customers may choose to either cancel or get notified by mail once the state of their booking resolves.

Further Development
Get a detailed break-down of booking costs for each room.

While the site is up and running since April 2017, TenTwentyFour1024 is constantly adding new functionality and improving both the project’s scaffolding as well as stability.

When TenTwentyFour1024 inherited the project, it did not have any tests, unit or functional. Now that the site is both complete and, as such, starting to become more complex, we have begun adding functional tests using protractor, which makes us sleep better at night, knowing that new features are less likely to leave regressions undetected.

Including all dependencies and assets, the current code-base delivered to a client weighs in at around 4 whopping Megabytes! While the project is currently still using both node and bower components and browserify/gulp for the build process, TenTwentyFour1024 is planning to migrate to a webpack set-up in the short run in order to be able to profit from its tree-shaking optimization.

Who you gonna call?

With Flowey CMD, yourfreebooking.com, some WordPress sites and several projects in the pipeline, one can say that TenTwentyFour1024 has a package of expertise up their sleeves when it comes to taking over development and maintenance on existing projects.

Development, infrastructure and monitoring, all taken care of by TenTwentyFour1024.

If you or your company need a hand on a project that needs to be brought up to speed or a final touch, don’t hesitate to contact us!

Technologies used in building this application

MongoDB

MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. (+)

AngularJS

AngularJS is a frontend framework that eases creation of single page applications via concepts such as two-way binding that make developing client-side applications a pleasure. (+)

Express.js

Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. (+)

Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. (+)

Bootstrap

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web. Bootstrap makes creating good-looking website easy and allowed us to focus on the functional aspects of the application. (+)

Redis

Redis is an open source, in-memory data structure store, used as a database, cache and message broker. (+)

ElasticSearch

ElasticSearch is an easy to use, yet incredibly powerful and auto-sharding search-engine based on Lucene. ElasticSearch leverages a JSON interface and a simple http-based API for easy indexation and retrieval of documents. (+)

Protractor

Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would. (+)

JWT

JSON Web Token (JWT) is an open standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. (+)