The huge ecosystem is both a blessing and a curse; we are able to choose small isolated libraries which perfectly fit our needs while at the same time we will be spoiled for choice.
The goal of this blog post is to present all of our (current) choices to rapidly create new platforms and not to present a perfect tool setup which fits any software projects. Investing time in choosing the right tool by simply trying different tool sets and constantly making incremental adjustments is still the best choice for any project.
In the current setup costa is deployed to a RaspberryPi and only accessible when the client is in the same network. Though the mobile apps are able to store created costs locally and sync as soon as they are reconnected to the costa platform. The Web App is able to insert new costs and additionally to show/edit/delete all costs.
Finding the right level of abstraction is probably one of the greater problems in software architecture. A good is recipe is to start small and to evolve gradually, each project is different and should grow to the needed complexity. This is only achievable by constantly taking care of your code base and not splitting the development into specific new features phases and refactoring phases. If you see a small issue, fix it immediately, always review with your colleagues and quality rises naturally. Even if it’s tempting to prepare for future complexity upfront, focus on the right steep between creating new features and adding abstractions to your codebase.
"All problems in computer science can be solved by another level of indirection, …except for the problem of too many layers of indirection."
∼ Kevlin Henney
Costa provides unit and integration tests, it was mostly developed with the TDD (Test Driven Development) approach. All unit tests have the same name and are at the same place as their unit under test. they can be identified by their file ending .spec.js, which should facilitate to find them if needed and emphasizes that the unit tests are part of the source code. Integration tests can be found in a separate test folder. Currently we use mocha & chai as basic test framework, they provide the right balance of feature richness and an easy syntax. Enzyme is our main test tool with regards to React components and improves the readability of frontend unit tremendously. Test coverage is another interesting topic, here it’s more important to find untested corner cases early than to maximize the final coverage, istanbul is the current tools for this job.
As usual we start small, npm scripts are a mighty and easy-to-use tool. Plus, it’s easy to integrate them into build tools like gulp if you really need more control over your build process. Costa uses only one gulp task, almost everything is within 18 lines of npm scripts. These lines ensure a common code style with standard.js, transpile to ES6 code, run all tests, create test coverage reports, deploy the application and provide a development environment.
Our internal main applications follow advanced continuous delivery plans for the mobile apps, with the help of great tools like HockeyApp and CodePush. These tools allow us to deploy mobile apps directly to our customers as if they were usual web apps. Within costa only the web app and the server application have a deployment via pm2.
Summarizing, we want to thank all those open source contributors whose library we’re currently using and we’ll try to contribute by ourselves as much as we can. If you’re in a need for a cross-stack platform specifically tailored to your needs, please contact us.