AI is all the rage right now. And it is here to stay. Yet, almost all the example you see out there are in Python. I like Python, but I love Go. Let’s use Go. How do we do AI? Running AI on a CPU is painfully slow. Running AI models on a GPU is much faster, although not instantaneous. There is the hard way. And then there is the easy way. The hard way is buying multiple powerful GPU machines and…
You are probably aware that SQLite is the most used database in the world. Every smartphone, iOS or Android, has it. Every app in those phones uses it. Every browser has it, on your desktop or any other device. But SQLite is actually amazing for the server side, too. I’ve been thinking about this for years. As web development is becoming more and more complex. Web stacks have tons of build tools…
In our recent article on Dependency Injection (DI) , I showed you how easy is to use DI in Android with Hilt . You just use a few annotations here and there and everything just works. However, sometimes this is not enough and it might not cover some of our use cases. Scoping By default every injection is unscoped. What?! It means that each time you receive a brand new instance of the class that…
Dependency Injection (DI) is not just a good practice. It solves real problems. The more complex your app gets the more your Activities, Fragments, ViewModels and all kinds of services depend on other components to get their job done. Initializing each dependency is tedious and can be forgotten (yay for NullPointerException). When it comes time for testing you realize that your carefully crafted…
Recently I showed you how to add a gallery to your iOS app . One that you can use as a base and make it your own. The code is on GitHub, too. However, there were a few things missing. First, there was no way to tell whether it was a video or an image just by looking at the thumbnails. Second, you could only choose a single picture. This time we are going to fix those issues by adding Video…
Almost every application needs a way for the user to select an image or a video. I already showed you how to do this on Android . This time I will show you how to do it on iOS, so that you can add a gallery to your iPhone or iPad app. It is nontrivial to add a gallery but it is essential (and I know that you can do it) There are several steps that you need to take. Ask for the user’s permission,…
Last time I showed you how to add a gallery to your Android app. Pretty much every app needs one. In that initial version you could only choose a single item. Yet, in the real world, most often than not you need to select multiple media items. This time we are going to make several improvements Multiple ordered selection Video duration The code in this article will not include everything, only the…
Dealing with images and other media is integral part of almost every app in the wild. It begins with choosing among the thousands of images and other media that you have. However, adding your own gallery to your Android app to fulfil this essential function is nontrivial. Nontrivial it is but it is also doable. You just have to follow the steps below. Ask for the user’s permission, both in…
You’ve heard that the cloud is the place to be. Run your enterprise apps or scale your startup. It is simple, easy to begin and inexpensive. You go to AWS, Azure, Google or maybe Digital Ocean. You sign up and for just a few dollars (euros, pounds, pick your currency) you have up and running servers and a thousand more services at your disposal. Your dream has come true and you can serve your…
You’ve probably seen many NodeJS articles. You always use NPM to install this or that package, but they never ever talk about it. This is true even for my own articles. We always take NPM for granted. Yet, what will you do if there was no NPM or no NPM registry? You will have to write always everything yourself or you will have to go trough the Internet to eventually find something useful. Even if…
A lot of web applications these days require fast and lightweigh real time communication. Real time analytics, real time measurement, games, chat applications, syncing with other devices, syncing with other people when coloborating on a document, etc. Last time I showed you a solution to all of those problems with WebSockets. It works, most of the time, but often it is too complex. What’s more it…
Web development is great, however traditional web technologies have some limits. You often need to exchange more information with the server once the web page is loaded. Then you probably use AJAX. However, you might soon discover that there are two limits with AJAX. First, you don’t get any information unless you ask for it. There is no way with AJAX with that, the server cannot initiate the…
You are often afraid that you can lose your contract work to an employee or to an in-house team of your client. Each time you are entering negotiations with a potential client, you trying to provide an offer which will cost them less than their employees. As a result your rate is often less than what an employee makes in the same amount of time, but hey you’ve got much more freedom and other…
Initially writing NodeJS and Express looks fun. It is JavaScript, it’s simple and it is super fast. However, the more your application complexity increases, you begin to notice the endless callbacks. You have one, inside there is another, inside it is one more and sometimes, even 5 or 6 more. Everything of course is indented, which makes it actually harder to read. This is also known as Callback…
Unit testing is great, but it doesn’t show you the whole picture. Integration tests are also nice, because you know that your components will work together as expected, but it is still missing some pieces. The fact is, that when you code is in production, your users still encounter bugs no matter how many unit and integration tests you have. You are still worried that when a real user hits your…
You are a freelancer or a consultant and naturally you want to earn more. You get as much work as you can, or even a little bit too much, rarely refusing work that comes your way. You have learned that by pricing your services based on the value they provide you can earn more from your time. However, you are still far from the numbers many consultants post on the Internet. You know that you can…
We all hate bugs in our code. Bugs can make you lose users and ultimately decrease your revenue. That is why you have tests, to keep your Node & Express application bug free. Initially, you run them only manually, but with time, as your app and team grow you realize that it is not enough. It is easy to forget to run them, especially when making small quick changes. Sometimes all your tests pass…
You have already seen how to test your models at Testing Your Mongo Models for Node & Express , but your Express controllers are also an integral part of your web application. When they don’t work, your users see 404 and 500 errors, and they might never come back. This is why your controllers deserve to be tested. No matter what your users throw at them, they should be able to handle it. They are…
Any good business requires new clients. Existing and returning clients are great but you need new people from time to time. However, when people talk about new clients, they don’t think about referrals most of time, because they take them for granted. Sometimes, they really come without efforts but you could get quite more of them. Not only that, but referrals are usually much better than other…
Everybody is talking about NoSQL, especially in the NodeJS world. Lot’s of people even associate Node with Mongo and other NoSQL databases. However, the world doesn’t end there. SQL databases like MySQL, PostgreSQL, Oracle or even SQL Server are battle tested in all kind of scenarios. Companies both large and small use them to run their mission critical systems. Moreover, if you are already…
ReactJS is great. It allows you to create easily complex web applications and user interfaces, without worrying how all is going to update. As any great technology it is very easy to start with. However, as soon as you begin writing more complex applications your React app begins to grow very quickly. A complex application has many different React components, each requiring a lot of code to be…
When your team grows and when your application complexity grows, there are many new obstacles that you face. One of them is that your app becomes much more difficult to modify and maintain. Adding new features or modifying old ones is much harder. Even adding tests is more difficult, because there are more tests cases than ever before. To avoid those problems, you have begun using early on the MVC…
Wouldn’t it be nice to earn a little bit more or maybe even a lot more? Yes, of course it would be. Everybody suggests to charge more because this is the best way to earn more for your freelance and consulting services. It sounds simple, but again when it comes to actually do it you don’t feel confident enough. Even when you overcome your doubts and try to charge more, your clients push back by…
Node is very easy to start with. Especially when you are using Express . During development you are runnign your app and your database on the same server, as well as anything else that you need. In fact, when you start you often have the same setup in production. Everything is on the same machine. To modify your configuration you just log in to the server and quickly change whatever you need. When…
Running your Node & Express apps on your machine is easy. However, once you put them in production there are some new problems. What if the app crashes? What if the server restarts? What if some other failure happens? We’ve already talked about deploying on Ubuntu and CentOS but today we are going to go a little bit more specific. You need your apps to be running forever, no matter what happens.…
Redis is a great database. I love it, I really do. It’s easy to use. It’s super powerful with its useful and easy to use structures. I can do anything with it. And above all it is FAST, extremely fast. Nothing else comes even close to it. Most of this speed comes from the fact that Redis is an in-memory database. Every data, every structure, everything is always in the memory. As a result, we…
Last time we’ve looked at uploading files locally . Uploading files locally is useful, but it has way too many limits for most applications. You have to think about back ups of your files, then you have to implement the back up strategy. In addition, your disk have a finite space and from time to time you have to add more disks. Handling many files from different disks is also a complex task. You…
File uploading is a requirement for a lot of web apps. Most of them at least need to be able to upload some pictures. Unfortunately, out of the box neither Node nor Express supports file uploading. Moreover, it is not trivial to implement this feature from scratch. However, there are some solutions which can help you. Let’s look at one very simple way to implement file uploading to local folder of…
Freelancing is rarely what you expect. Probably, when you begun freelancing you had in mind a lot of great stuff and freedom like: work when you want, work where you want, take a nap or a walk whenever you feel like it, no boss and many more like that. However, reality is a little bit different. You rarely have most of these perks and being a freelancer often requires you to work really hard.…
There are many interesting NoSQL solutions and more are created almost daily. One of the most popular is CouchDB . One of its main strengths is that it uses HTTP as its communication protocol which makes it very easy to use from any programming language. CouchDB is also the primary store behind NPM. We have also used CouchDB for many of our projects. For example Mehana is build entirely on…
Doing local development with Node is simple. All you have to do is node app.js in the folder where your source code is and your application is ready to serve. Where things get complicated is when you want to put your app in production, on a web server for the whole world to admire it. If you are coming from PHP or Ruby on Rails you might be used to having a very simple way of hosting & deploying…
It is hard to stay focused and be productive when you are working as an employee from an office, but it is even harder when you are freelancing. Maybe, by the end of the day you are asking yourself where did the time go, or maybe, you stay up until late at night to be able to accomplish all the tasks you have set. When freelancing, you are not just working, but you are also running a business,…
React Native is amazing. I have been using it for some time and I am preparing our first production application implemented entirely with it. The only drawback that you might have experienced currently is that there are not that many components to work with. Therefore you have two options if you need a particular kind of component. You can either take an existing Objective-C component and write…
Every web application needs a place to store its critical data. Node and Express apps are no exception. One of the most popular NoSQL databases in the last few years, especially when working with Node, is MongoDB. As you grow, your needs grow. You need more than just to connect to your database and get some stuff. You need to add some business specific logic. In this article we will look at how to…
Sometimes there are clients that you just don’t want to work with them anymore. They don’t pay on time, they constantly change what they want, they don’t value your work or their projects never seem to end, no matter what you do. We all know that the best solution in those cases is to fire them. This is what everyone out there is suggesting. Moreover, you know that it make sense and you believe…
Clients side frameworks are great. They can help you build interactive and fast web applications which users love to use. Unfortunately it is not all roses. There are several drawbacks, too. One of the main disadvantages is the initial loading speed. Client side frameworks receive very little HTML from the server, but they receive a lot of JavaScript. Then they have to request and wait for the…
Creating a portfolio with your work seems easy and natural. Every freelance designer, developer, copywriter, and any other kind has one. It usually has some pictures, a project or a client name, sometimes a few words and maybe a list of the technologies that you have used. This is how 99% of all portfolios look and they are almost useless. They don’t help their creators find more clients.…
React is a great library and can make developing web apps much easier. However, the first thing that anyone coming from Angular sees is the lack of two way binding by default. It is one of the reason why some developers don’t want to try it. Even though two way binding is a cool feature, it is not actually needed by most applications. Yet, there are cases when it can be really useful. Today, I…
Last time I talked about the Common Mistakes Freelancers Make when Selling Themselves Online and I tried to explain what is the problem with each of them. This time, we will look into what exactly is a better way to proceed when selling yourself online. There are different channels which you can use to find new clients. Your online presence is not only one of them, but it is also often used as…
There are a lot of ways to attract new clients while freelancing. You can go to networking events, you can do cold calling, there are online job boards and many more. No matter what you do, sooner or later your potential clients will come to your web site. It will play big part in their decision whether to work with you. That is why it is critical to optimize it for sales. I love learning from…
Doing local development with Node is simple. All you have to do is node app.js in the folder where your source code is and your application is working. Where things get complicated is when you want to put your app in production, on a web server for the whole world to admire it. If you are coming from PHP or Ruby on Rails you might be used to having a very simple way of hosting & deploying your…
There are clients you love to work with and then there those you dread to here from. Yet, it seems that some freelancers and consultants only get work with the former and never with the latter. Do they never work with horrible clients? Is there a way to replicate their success? For variety of reasons, sometimes bad clients are unavoidable. Sometimes you will realize how bad they are when you are…
Every business does it and everyone does it for a different reason. Freelancing is also a business and you are the boss of your freelancing business, should you do what everyone else is doing? In addition, sometimes there are clients that you really want to win and they ask for a discount. It’s very easy to agree just to close that deal. Once you teach them, it is impossible to unteach them Let’s…
Recently there has been a rather large outcry from UK and US SaaS companies about the changes of the VAT (Value Added Tax) in the European Union from January 1st, 2015. I am not an accountant or a lawyer, but I am business owner in Bulgaria which is in the European Union. All of my customers are from other countries and many of them are in the EU. Any VAT change always affects some of my business.…
Organizing your application structure and its routes is one of the first problems you will encounter while developing with Express . To help you with that version 4 added the Router class. Let’s use it to define some routes in a cars.js file. var express = require ( ' express ' ) , router = express . Router () // Car brands page router . get ( ' /brands ' , function ( req , res ) { res . send ( '…
Building a web application with a backend API and multiple clients is great. Everyone is using the same API and you can allow even other people to build clients, while you focus on the core. Like Twitter used to be. Not only that, but you can also improve your backend speed, or change your infrastructure without affecting your clients and without changing your client side code. Problems Then it…
Models are the base units of every application. When there is a bug in them they might affect the functionality of the entire app. As a result you will lose users and revenue. Therefore you should test your models, but this is not as trivial as it sounds. First, when testing a model you don’t know what was the state of the database before you run the test. When you don’t know what the initial…
If you are not building an extremely simple and static web site (like this one), you probably need your visitors to identify themselves somehow. This is called user authentication. User authentication is one of the first things you stumble upon while building a new web app. It’s purpose is not only to identify different users but to allow them access to specific resources and functionality. It…
Node and Express don’t come with a strict file and folder structure. Instead, you can build your web app any way you like. This is great, especially for small apps. It is easy to start, learn and experiment. However, as your application grows in size and complexity, things might get confusing. Your code becomes messy. As your team grows, it becomes harder to work on the same code base. You are…