In a web app forms are the most easy and well known way of taking input from user. But with forms, comes validation. There are many ways of incorporating validation with forms. Here we will see how to use vee-validate in a VueJS project where bootsrap-vue is used as ui framework.
First of all let’s create a layout of a form containing 3 fields: name, email, phone number.
<b-form> <b-form-group> <b-form-input placeholder="Enter Name" required type="text" ></b-form-input> </b-form-group> <b-form-group label="Email address:" > <b-form-input placeholder="Enter email" required type="email" ></b-form-input> </b-form-group> <b-form-group label="Phone Number:" > <b-form-input placeholder="Enter Phone Number" required type="text" ></b-form-input> </b-form-group>…
Firestore is a managed, scalable document storage available in Firebase platform. Why I like it? You can start using it and get 20K reads and writes per day whithout paying a dime event without sharing your credit card info. 20K read writes are more than enough for experimenting and creating a small to medium application.
Firebase have already provided some feature rich client packages for different programming languages. There is also one for Java too, and its documentation is well written to get started with. …
In micro-service architecture it is common that one micro-service communicates with another by consuming REST APIs. In the spring ecosystem a popular REST client is Feign because of its declarative style and DRY approach for adding different configuration.
In this post I will talk about enabling retry mechanism for feign Client. By instinct what we can do is update our business code where we wrote the statement for api call inside a try catch and while loop and write code for another API call until our condition is met. …
Django was the first web framework that I’ve learned. It helped me to land my first job. So I have a special place for Django in my heart. Whenever I work with a new framework or coding practice, I instinctively try to think- If I were using Django, how would I be doing it.
Right now I use Java, specifically Spring-boot for most of my tasks. The transition was a bit hard. I missed Django shell most for quickly testing or prototyping a piece of code. For a way around I learned to write Tests , not really full fledged…
AWS provides us a tonnes of services to reduce development and maintenance hassle. Those who need to stream and store(maybe analyze too!) lots of data in real-time, they can avail kinesis services. Of-course if you want to build your own pipeline then no one is stopping you… but there goes a say:
If I have seen further than others, it is by standing upon the shoulders of giants
In my case it was just putting the data to kinesis data firehose, which will periodically dump those data after some threshold in an s3 bucket. Pretty basic need. But after I…
Abstract factory is a creational pattern. This pattern provides an interface for creating families of related or dependent objects without describing their concrete classes.
In my last writeup about Factory Pattern I described a situation of an imaginary programmer who just created a motorbike sharing platform. Within few days his platform got so popular that customers started demanding for cars too. Instead of re-writing his whole codebase we saw how he implemented Factory pattern to accumulate both car and bike rides in his platform.
Today he is planning to add a new feature in his platform. He want to give…
Factory pattern is a creational pattern. It defines an interface for creating different type of object on the run-time. Enough jargon! let’s see an example.
Imagine you are have created a motorbike sharing app. As days gone by, your app become so much popular that users are also requesting to enable car sharing too!
Though you are happy and enjoying the excitement of upcoming success, but what about the code? Right now your code has only Bike class, and all the other methods and classes are intertwined with this class. If you need to add another class like Car you…
There is no doubt how important is the logs for a production grade application. Operational problems can be avoided and business decisions can be improved by collecting and analyzing adequate logs.
Recently I’ve been working on a Java project where I had to use the jSMPP library. Two of it’s dependencies are SLF4J and Log4J. Though it can work without then just fine for development, but as I got used to the library the uncool warning messages started to bother me. So I went there to add them in the dependencies. …
We all know how easy it is to start a project in Django. After installing Django you just need to issue one command:
django-admin sartproject myproject
This will create a myproject directory in your current directory which will contain some initial settings, database configurations etc. and the structure is as follows:
Here you can see there is a myproject on top of all, which contains another myproject inside. This inside myproject will contain the settings and configurations.
Somehow I’ve developed a bit of compulsion towards this structure…
There are many layer of security for your web project. Today I’m going to write about a form of application layer security which I think also a form of secure by design.
There was a service I was working on. Different other services was using that service. Initially all the other services had access to both reading and writing data to that service. But after a redesign and implementing more granularity it appeared that only two services are writing with POST and PUT and other are reading with GET method.
Though those services were using proper credentials but I though…