What should web developers avoid implementing
Tags: productivity
Published: 2020-10-27 07:19:21

Hi, I am a lazy frontend developer come from Vietnam, the man looking for original values.

---

Web development is complex with tons of things to do. Besides that, there are still something that we **should not do it by our hand**, nearly similar to reinvent the wheel.

Let's see my list for 2020 afterwards. This article is suitable for mid or above junior developers. Fresher or below junior developer should manually do because you will learn many things from that.

I have divided all issues into 3 different groups:
- The first group contain all works that involve from both side backend and frontend, or even has impact to architecture.
- The second group has smaller tasks where you can take much time to implement by yourself, but can do.
- The last group is reinvent the wheel jobs.

---

# The first group: try to avoid these tasks

## Authentication

This is the first thing I **MUST** mention.

### Problem with handling Authentication by yourself

Sign in, sign out, register, forgot password, etc is some very boring things that need to be done on almost websites. It is the most basic functionality that a website should have. But if you manually implement the authentication process, maybe you're wasting your whole team on this.

The reasons are:
- There is no clear benefit from the user's point of view when this function is completed. **What is the user actually need is a single button, and they get signed in after clicked it**.
- Authentication is complex and complicated also. For example, manually implement the algorithm for the JWT token, manage the token lifetime, invalidate the expired token, and so on might take a lot of time and effort.
- Every system has the same logic for Authentication from the past decade. You do not need to spend your resources on a very old problem that has many existing great solutions.
- Security issues might appear if your authentication process is not well handled.

So, in terms of the trade-off between team effort and the benefit, risk management, **do not implement authentication by yourself**.

### Solution

There are many good solutions out there such as:
- [Auth0](https://auth0.com/)
- [Firebase](https://firebase.google.com/)

I do not see any use case till now that one of each above product can not resolve. Please let me know if I am going wrong here.


## Authorization

If authentication is a key let somebody get in your house, authorization is a list of permissions you let them touch into something or go somewhere when they in. Compared to Authentication, Authorization is more complicated because it totally depends on specific business logic. In other words, you can not reuse the old authorization system in your previous project.

### Solution

There are many good solutions out there such as:
- [Hasura](https://hasura.io/) is the best candidate in my opinion.
- [Auth0](https://auth0.com/) is a good solution suite.
- [8base](https://www.8base.com/), but it is a full Backend-as-a-service.
- [Okta](https://www.okta.com/) is also a good solution at my first look.

---

# The second group: can do with much effort

This group has various kinds of problems that we already have a powerful solution. I have not much time to explain everything. The order of things does not matter. I have tried to not list many solutions it will take your time on the comparison.

## Email management

The reason why I recommend using an existing solution because the common use cases: the admins want to have dashboards for email management, and they can do lots of things with email template, email marketing and so on.

Solutions:
- [SendGrid](https://sendgrid.com/): not much thing to talk about, it just has everything you need.
- [Mailchimp](https://mailchimp.com/) is a good candidate for small business.

## Upload file

Let me go straight forward:
- We usually store media assets in cloud.
- It takes much effort on validation, UX and assets management.

Solutions: 
- If you use a CDN like [Cloudinary](https://cloudinary.com/), use [its upload widget](https://cloudinary.com/documentation/upload_widget) instead.
- [Uploadcare](https://uploadcare.com/) as its name, works in almost use cases.

## Analytics dashboard

Building a dashboard for analytics purpose is a generic use case. In fact, it is a crucial feature from product point of view.

Instead of manually connecting to data warehouse, parsing data into chart components, please forget these works. The same reason as Authentication.

Solutions:
- [Retool](https://retool.com/) is a good candidate but its performance is not wonderful for me.
- [Appsmith](https://www.appsmith.com/) is open source, still in development but I prefer it over Retool.
- [holistics.io](https://www.holistics.io/) is a powerful BI tool, perfect fit for enterprise.

## Chat and Notification System

Chat, push message, notification system are complex jobs in terms of performance. Yes you can totally find out a tutorial like "building your own chat in minutes" or so, but almost them are just for high level consideration only.

Solutions:
- [Sendbird](https://sendbird.com/) offers a good solution for chat, message and so on.
- [Intercom](https://www.intercom.com/) is kind of must-have for enterprise level.
- [Twilio](https://www.twilio.com/) also support phone call and more.

---

# The last group: Reinvent the wheel jobs

Like the title, sometimes if you try to do something in the below list, you are almost waste your life:
- Build your own custom UI components. [MaterialUI](https://material-ui.com/) is the most customizable UI framework. On the other side, I highly recommend **NOT** to try to customize [Antd](https://ant.design/).
- Build dashboards interface from scratch. There are tons of admin template out there.
- Build your own custom code generator. Depends on your actual business, but in most cases, you do not need it at all. Take a look at how [Hasura](https://hasura.io/) did, you will see the point.

---

# Dear my beloved readers

"Focusing on business logic" is the only thing I want to share if you are a developer. Not only your time, it is also how we could make better product.

Cheers and happy coding!