Loklak Webclient would be the biggest SPA repo I have ever seen. Probably because of these two reasons:
- Application structure was designed to be scalable from the beginning.
- Application is as much independent as possible from external APIs
As the first reason is covered the in the previous part, this week we will take a look at the second version.
There are three API we are using locally in for Loklak Webclient
- Iframely: To render data with rich content, we needed a service to debug the resource. Iframely was chosen because it’s open source and its node js implementation fits our repo perfectly.
- Loklak GeoLocation: this is a developing service at Loklak Server Api. At first we used OSM/GoogleMap APIs, however their implementation involves the whole library for a very small use of geo location, so we decided to look for another ways. Meanwhile, Loklak server cache are getter bigger and bigger so GeoLocation is more than just possible. Try this query!
Other than APIs, an application can’t “flourish” without external libraries. There are three place libraries are included in our application
- If a node package is available, it is saved in node_modules and included with the help of Browserify
- If not
- If it is required for other operations than the angular application, include it in a script tag, before the angular script.
- Else, include in app/components/ to be bundled together with the angular application
This way, with the help of build tools, we are able to minimize the number of http requests and the bandwidth to load Loklak Webclient, and make the world a better place 🙂