Forms are a very important part of any application. Forms are used everywhere from login to search.

Image for post
Image for post
Photo by Tim Gouw on Unsplash

List Of Content

  • Introduction to Formik
  • Introduction to Yup
  • Creating a Simple Form Markup
  • Using Formik With Simple Form
  • Adding Reset Button
  • Adding Validation
  • Handling Submit
  • Conclusion

Useful tip: Use Bit to encapsulate components with all their dependencies and setup. Build truly modular applications with better code reuse, simpler maintenance and less overhead.

Introduction

ReactJS is a library. It does not include a pre-baked solution to handle the form’s state and actions. Forms in the ReactJS can be a pain with all those repetition and business logic at the same time.


Everybody says that python is best for scraping but I always wonder why we don't use NodeJs for Scraping?

Image for post
Image for post
Photo by Ali Yahya on Unsplash

The answer is clear scraping is CPU intensive task since NodeJs is single threaded so scraping blocks the main thread. I have one solution for the problem worker threads. We would scrap the IMDB website for the data.

Our goal is to extract all the data from this page. We would scrap all the details of the tv show, all awards won by the tv show, the cast of the tv show, episodes, seasons and much more.

The data provided from scraping is way more than provided by our script and would be more than provided by any third-party API. …


There are many tools for getting a boilerplate code generated available for reactjs. The most popular tool used by many developers is create-react-app, which comes with many configuration options.

Image for post
Image for post
source:scoth.io

Content

  • Introduction to babel and webpack
  • Configuring webpack
  • Using babel with webpack
  • Using css and file loader with webpack
  • Using webpack dev server

Introduction

This guide will show how can we set up own react project using babel and webpack. We would configure webpack to use babel to compile the jsx to js and run a development server for serving the compiled files.

Webpack

Webpack is used to compile JavaScript modules. Once installed, you can interface with webpack either from its CLI or API. If you’re still new to webpack, please read through the core concepts and this comparison to learn why you might use it over the other tools that are out in the community. …


Let’s build a stateless solution for authentication

Image for post
Image for post
Photo by Charles Deluvio on Unsplash

Introduction

Traditional authentication strategy makes use of sessions and cookies, but scaling these solutions is very difficult — as some kind of state is maintained by the server. JWT, on the other hand, provides a stateless solution for authentication, and stateless applications are pretty easy to scale.

Advantages of JWT

  • Provides a stateless authentication solution
  • Very popular and used by many OAuth service providers, like Google and Facebook
  • It’s very easy to verify a JWT token
  • More trustworthy than cookies and sessions
  • Authentication can be outsourced, or an authentication service can be used
  • Have many applications other than authentication — for instance, it can be used for…


Image for post
Image for post
Let us remove wheels of library and add our wheels

In the last part we only had a look at basic skeleton of the web server we would write.In this we will look at more detailed look at different aspect of a complete web server.

Let us optimize our response first

Node.js comes with many utilities like fs , os etc which are a great way of interacting with underling operating system.Most interesting utility is zlib it is module which provide you with a simple and easy to use steam based interface for compressing data.Data can be anything it could be string or music video or image.Zlib support many compressing format including gzip and deflate which are two format supported by most of web browser these days.We …


Image for post
Image for post
Just An Image 😎

Introduction

Hi my name is Anshul Goyal .I am a JavaScript enthusiast .This is my first blog.So if I screw up do not be mad at me and please leave a review comment .

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.Node.js provide the programmer insane amount flexibility and productivity when it comes to writing robust code.The Node.js run time comes with many inbuilt modules which help us to write our web servers.In this article we would write a web server using only core libraries.

What is a web server?

A very lame question,isn’t it.A web sever is a computer which server dynamic as well as static resources for websites.According to me a web server is just some logic or code which takes a string as input and gives another string as output.Ok, a web server can takes any string as input?There is set of rules for this string to be constructed.These rules are defined by protocols like HTTP , HTTPS , FTP , WEBRTC , WEBSOCKETS etc to name few. …

About

Anshul Goyal

A coder just for fun.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store