How to make Pdf in React, Next js quickly

I have some data, and I’d like to make a PDF file for that data. How can I make a PDF file as a quick way in React. In this post, I will try to do it fast as possible in React using PdfMake library. Requirements This is a part of PDF file that I want to make in this post. Before I go forward, I would like to remind you that everything in PdfMake is table....

September 19, 2021 · 6 min · Phan Công Thắng

Build address search component in React

In this post, I’m going to build an address search component using React. Requirements In the component, I have a postcode value, and every time I click the search button, I can get the address. It will have two cases of the result: Return one address. Return many addresses. If the result is one address, I will set the value for the addresses inputs(disabled) otherwise I have to show the address list for the user....

September 12, 2021 · 7 min · Phan Công Thắng

Play with CORS using AWS Cognito, API Gateway

I’m standing in domain A, I’d like to call an API that was hosted in domain B. Normally, I can’t do it without setting CORS for the API. In this post, I’m going to do it using API Gateway and AWS Cognito. Basic concept API Gateway I assume I already have had many resources(API), but I didn’t set up the access permission yet. In this case, API Gateway is so helpful, I can config the middleware for whatever API I would like to control....

September 11, 2021 · 6 min · Phan Công Thắng

How to Persist Data in Nextjs App

In my app, I do have many screen flows that user has to input the previous step before they can move on next step. And I’d like to persist the data in the previous step and get them in the next step. We have a lot of methods to persist data as using: localStorage, cookies, firebase, dynamoDB, etc.. But I chose redis in order to achieve this goal. Because of the data that was saved in the memory of the computer, we can get it faster than these methods above....

September 4, 2021 · 8 min · Phan Công Thắng

Did Eslint Only Love My Pc

My leader: Thang, Let’s config eslint for our app. Me: Ok, I will do it immediately. Then as my leader said I went to config eslint for our project. While doing this work, I encountered an interesting problem that I would like to share with you. Problem My project is a react app, and we need to have eslint-plugin-react in order to lint React code. There are two things that I thought It was interesting....

August 28, 2021 · 2 min · Phan Công Thắng

How to deploy a nextjs app to AWS EC2 with Github Action

I want to deploy an application to AWS. In the first time, I was overwhelmed with the architecture of AWS and couldn’t find tutorials for people without knowledge AWS. So I wrote this post for people who don’t want to spend too much time on cloud. Basic concepts AWS ECR AWS ECR is where consists of all encrypted docker images. AWS ECS will consume these docker images. AWS ECS AWS ECS controls the way your images is run....

August 22, 2021 · 5 min · Phan Công Thắng

How do I resolve problems in an effective way?

A problem usually includes issues and many small issues(I call sub-issues) in it. So the effective way to resolve the problem is resolving sub-issues. It’s very difficult to resolve a big problem. We need to divide that problem into many small pieces. Template Every morning, I usually take time to write down the issues that I’d like to resolve and analyze. I have been using the issues template below that I thought it helps me a lot....

3 min · Phan Công Thắng