React Custom Hook tutorial with example

In addition to the familiar Hooks like useState, useEffect, useRef…, React also allows us to create custom Hooks with unique features that extracts component logic into reusable functions. Let’s learn how to write a Custom Hook for API call in React through a simple useAxiosFetch example.

More Practice:
React Hooks CRUD example with Axios and Web API
React Hooks File Upload example with Axios
React Form Validation with Hooks example
React Hooks: JWT Authentication (without Redux) example
React + Redux: JWT Authentication example
React Hooks + Firebase Realtime Database: CRUD App
React Hooks + Firestore example: CRUD app
React Custom Hook in Typescript example

Read More

React Axios example – Get/Post/Put/Delete with Rest API

Axios is a promise-based HTTP Client Javascript library for Node.js and Browser. In this tutorial, we will create React example that use Axios to make Get/Post/Put/Delete request with Rest API and JSON data in a React functional component (with Hooks).

Related Posts:
React Custom Hook
Axios Tutorial: Get/Post/Put/Delete request example
React CRUD example with Axios, React Router and Rest API
React Hooks: JWT Authentication & Authorization (without Redux) example
React Hooks + Redux: JWT Authentication & Authorization example

Together with React Query:
React Query and Axios example with Rest API

Read More

Spring Boot JdbcTemplate example: CRUD Rest API

In this tutorial, we’re gonna build a Spring Boot Rest CRUD API example that use Spring JdbcTemplate to interact with H2 database. You’ll know:

  • How to configure Spring Data JDBC to work with Database
  • How to define Data Models and Repository interfaces
  • Way to create Spring Rest Controller to process HTTP requests
  • Way to use Spring JdbcTemplate to interact with H2 Database

Exception Handling:
Spring Boot @ControllerAdvice & @ExceptionHandler example
@RestControllerAdvice example in Spring Boot

Unit Test:
Spring Boot – Rest Controller Unit Test with @WebMvcTest
Or Documentation: Spring Boot + Swagger 3 example (with OpenAPI 3)

Using Spring Data JPA instead:
Spring Boot JPA + H2 example: Build a CRUD Rest APIs

Read More

Dart/Flutter Future tutorial with examples

Asynchronous programming allows a program to do work while waiting for something else to complete. In this tutorial, we’ll show you how to work with Future in Dart (also in Flutter). At the end, you’re gonna know:

  • Introduction to Dart Future
  • How to create Future, Future delayed and value methods
  • Basic Future usage: then, catchError and callback
  • Way to use Future async-await
  • Future multiple await/then for chain of multiple asynchronous methods
  • Equivalent of ‘finally’: Future whenComplete
  • Future wait for multiple futures complete

Related Posts:
Dart/Flutter Constructors tutorial with examples
Dart/Flutter String Methods & Operators tutorial with examples
Dart/Flutter List Tutorial with Examples
Dart/Flutter Map Tutorial with Examples
Dart/Flutter – Sort list of Objects

Read More

Docker MERN stack with Nginx example – Docker Compose

Docker provides lightweight containers to run services in isolation from our infrastructure so we can deliver software quickly. In this tutorial, I will show you how to dockerize MERN stack Application (React + Node.js + Express + MongoDB) example using Docker Compose and Nginx.

Related Posts:
React + Node.js + Express + MongoDB example: CRUD App
React + Node.js Express + MongoDB: User Authentication with JWT example
Integrate React with Node.js Express on same Server/Port

Read More

Deploy Spring Boot App on AWS – Elastic Beanstalk

AWS (Amazon Web Services) is one of the most widely used cloud computing platforms which provides a whole range of managed cloud services. In this tutorial, I will show you step by step to deploy Spring Boot Application with MySQL on AWS EC2 Instance using Elastic Beanstalk (for free).

Related Posts:
Spring Boot, Spring Data JPA: Rest API example
Spring Boot JdbcTemplate with MySQL: Rest API example
Spring Boot Token based Authentication with Spring Security & JWT
– Documentation: Spring Boot + Swagger 3 example (with OpenAPI 3)
– Dockerize with Docker Compose: Spring Boot and MySQL example

Read More

React Typescript – Multiple Image Upload example (with Preview)

In this tutorial, I will show you way to Upload Image Image (with Preview) to a Rest API using React Typescript and Hooks. The React App uses Axios and Multipart File for making HTTP requests, Bootstrap for progress bar. You also have a display list of images’ information (with download url).

More Practice:
React Typescript CRUD example
React Hook Form Typescript example with Validation
React Custom Hook in Typescript example
React Query and Axios (Typescript) example
Spring Boot + React Typescript example

Serverless with Firebase:
React Typescript Firebase CRUD with Realtime Database
React Typescript Firestore CRUD example with Cloud Firestore

Read More

Upload Image in React Typescript example (with Preview)

In this tutorial, I will show you way to Upload Image (with Preview) to a Rest API using React Typescript and Hooks. The React App uses Axios and Multipart File for making HTTP requests, Bootstrap for progress bar. You also have a display list of images’ information (with download url).

More Practice:
React Typescript Multiple Image Upload example (with Preview)
React Typescript CRUD example
React Hook Form Typescript example with Validation
React Custom Hook in Typescript example
React Query and Axios (Typescript) example
Spring Boot + React Typescript example

Serverless with Firebase:
React Typescript Firebase CRUD with Realtime Database
React Typescript Firestore CRUD example with Cloud Firestore

Read More

Spring Boot, MongoDB, Reactive CRUD example

In this tutorial, we’re gonna build a Spring Boot MongoDB Reactive example – CRUD application that uses Maven, Spring Data Reactive MongoDB to interact with MongoDB database and Spring WebFlux for Reactive Rest API. You’ll know:

  • How to configure Spring Data to work with MongoDB Database
  • How to define Data Model and Repository interface
  • Way to create Spring Rest Controller to process HTTP requests
  • Way to use Spring Data Reactive MongoDB to interact with Database

More Practice:
Spring Boot + GraphQL + MongoDB example with Spring Data & graphql-java
Spring Boot, MongoDB: JWT Authentication with Spring Security
Spring Boot MongoDB Pagination example with Spring Data

Exception Handling:
Spring Boot @ControllerAdvice & @ExceptionHandler example
@RestControllerAdvice example in Spring Boot

Fullstack:
Angular 8 + Spring Boot + MongoDB example
Angular 10 + Spring Boot + MongoDB example
Angular 11 + Spring Boot + MongoDB example
Angular 12 + Spring Boot + MongoDB example
Angular 13 + Spring Boot + MongoDB example
Angular 14 + Spring Boot + MongoDB example
Angular 15 + Spring Boot + MongoDB example
React + Spring Boot + MongoDB example
Vue.js + Spring Boot + MongoDB example

Read More