Since we started our Youtube channel passed more than one year but there not so much videos. Right now we got more free time and quite good expertise in some technologies so going to share.
In this article I would like to talk about Service Workers (SW). SW allow us to make our application offline ready so that it works even if we have no internet connection. They also allow us to use a lot of other enhanced features, like push notifications or background synchronization. SW live on even after you close the browser, that is the service worker still keeps on running. It’s a background process. So let’s register our first service worker.
(In this article I’ll implement functionality related to SW in plain JS because the code is written in plain JS we can integrate in any JS frameworks such as Angular, React or Vue)
As the first step let’s add a file sw.js to your root project folder. In app.js we have to check if service worker is available in navigator, that is if service worker is supported by the given browser. Now since we know that service workers are available, we can execute navigator.serviceWorker.register() method to register a new service worker pointing the path to a file where our service worker sits. This method actually returns a promise. So in order to get informed once it is done, we can chain then after it.Read More
Often our customers have own servers where installed different OSs and sometimes there are some complications to configure and install web apps. Just to keep records on issues which we met I’ll post in the blog short description and solutions.
Today we got a server with CentOS 8 on the board, after installed all software few ports were closed by firewall.
In this case apply rules to firewall was not that difficult but it worse to share:
- Check current active zone (it’ll show something like dmz, public, etc.):
- In my case it was
public, so I run
firewall-cmd --zone=public --add-port=8080/tcp --permanent
- And after firewall reloaded
firewall-cmd --reloadthe port become open to the World.
Nowadays create new company, project, product is quite simple and first steps can be done very quickly. Usually when people got an idea in their mind and very exciting about make this idea real come to the point of MVP – Minimum Viable Product.
MVP helps to touch first sample of product, test the idea in real world, show it to someone (investors, potential customers, etc.) and gather early feedback usually without big financial expenses. There a lot of materials in public Internet how to create MVP from your idea, which key points you must keep but here I’ll talk about technical part of MVP and specifically related to Software + Hardware product.
MVP technical key points
- It should be as cheap as it can be (ideally free by money, only your own time spending)
- It must use tools, components, modules, frameworks which can provide desire quality with low efforts and be very flexible
- Development process must be agile with short iterations, end of each must test your idea in some real scenarios
- Libraries must be open sources and with free for commercial licenses
- Each element in the system must be simplified as much as it possible (when project start growing you can hire not very expensive engineers to help you with development)
- There are must be automatic Quality Control system (at least Unit tests)
Example of MVP tech stack for “Track my time” project
Lets imagine we have crazy good idea of time tracker mobile application. We want implement simple task creation process, task stop, resume, statistic of past tasks (how many are done, in progress, not start yet, how long time it took to make a task, what is average time spend of the task or grouped by some tags tasks). All data should be synchronized between all devices of account owner and one nice feature – share finished tasks on social media.
On this point we already see that on the market bigger part occupied by Android and iOS mobiles so need to decide what to support and if we need native apps or there is enough hybrid.
Native application – program which compiled into binary/byte code for specific platform, usually bind to some languages: Java/Kotlin for Android and Objective-C/Swift for iOS. Native apps have better performance and access to all available/permitted resources of the device but required more specialized programmers and in most cases a way more expensive then hybrid.
Hybrid application – web applications which run in native browsers on the devices, have limited access to the resources through bridges, can be cross platform and language agnostic, usually requires only knowledge in web page development. Very easy to start, all available platforms potentially can run one code, so development and maintenance may be done by one person.
My own prefers for MVP is develop hybrid applications and only after MVP tested and project started to grow then switch to native (and this is only if hybrid can not cover needs).
We have a lot of hybrid frameworks, some of them free (Ionic Framework, Flutter), some of them claimed to compile into native (Xamarin, React Native, Native Script) but they provide relatively simpler way to develop compare to native app. Most of mobile apps I’ve developed based on Ionic Framework, so far it really covered all my needs and for this sample application it has plenty of plugins and UI components, so can quickly develop something.
In few days possible to make mobile app design (you can use Adobe XD or Figma or anything what you prefer) and create hybrid mobile application with few screens (from standard UI components).
Finally we come to backend part, here everything also varying a lot, you can use Python, JS, TypeScript, Java, Kotlin, Go, etc. languages and each of the language has many frameworks and libraries. For my own prefers I would start backend part with Kotlin, based on Spring Boot.
It does not really matter (for this application) which DB we choose, it can be SQL or NoSQL, any you personally feel comfortable and have experience. And for MVP I would expect up to 1000 users (if there will be quick jump backend most probably will be down, but for this app I would not expect such situation). Server which can run backend project I would rent for around 30 EUR per month.
Very important is to setup correctly infrastructure (CI/CD, CVS, backups, Metrics and Alerts) – it’ll make your development process fast and flexible, any outages or failure will be alerted and developers can fix ASAP.
Cheapest pricing for MVC
- Domain name: 15 EUR/year
- VPS: 30 EUR/month
- Hybrid mobile application: 300-600 EUR
- Server application: 300-1000 EUR
- Infrastructure: 200-500 EUR
So, if MVP does not require any custom component, use hybrid technology, on backend side implemented simple CRUD then price of MVP could be less then 700 EUR and time is 1 week (+ up to 3 days for iOS app release to App Store).