Prerequisites
For the development of the frontend application we will use the React.js library and we will work in the TypeScript language. Typescript is a scripting language, a more typed dialect of JavaScript. We recommend using TypesScript instead of JavaScript for several reasons:
- Prevents many errors at runtime if data types are used incorrectly like in a weakly typed context.
- It is easier to modify and maintain the code since data dependencies can be known where a certain type of data is used.
- Data types also serve as documentation for those who will use the code.
If you are not familiar with JavaScript/TypeScript go through the introduction to TypeScript.
Tools
Before starting the actual development, you will need to prepare the following:
- Install an LTS version of Node.Js (version 18)
- Install an IDE for web applications: VSCode or WebStorm, for VSCode you need to install plugins for HTML, JavaScript/Typescript, React.js and Node.Js, with WebStorm these are already included.
ποΈ Introduction to TypeScript
We will give a brief introduction to the TypeScript language to develop front-end applications. The way of working with Typescript is much the same as with JavaScript but it benefits from the fact that the syntax is constrained by the declared data types. The existence of data types, even if in this case they are only checked at the transpiling stage where the TypeScript code is transformed into normal JavaScript code, helps developers to avoid common mistakes in poorly typed languages. We will go through the specific syntax of TypeScript, for those familiar with C-like and object-oriented languages ββthe syntax is easy to learn but differs in the way of use compared to these languages.
ποΈ Introduction to Node.Js and React.js
What is React.js?
ποΈ HTML and CSS in the context of React
HTML
ποΈ Communication between components and routing
Communication between components
ποΈ Material UI
Material UI is a component library for React that provides a collection of pre-styled UI components to help create modern and attractive user interfaces. These components are based on Google's Material Design styles and design principles, which were developed to provide a consistent and familiar look and feel to web and mobile applications.
ποΈ Asincronicitate in React
What is async and why is it important in React?
ποΈ ReactQuery
What is ReactQuery?
ποΈ OpenAPI Generator
What is OpenAPI?
ποΈ State management
In this section we will go into detail about managing application state using hook and Redux Toolkit functions. The reason application state management is needed is that certain components in different locations of the application need to share the same data. One possibility to propagate data to multiple components is for a parent component to pass data to its descendants via child-to-child properties, but this approach can clutter components and lead to hard-to-maintain code. The best alternative is to make data shared by different components available through a global state accessible via hook functions.
ποΈ Forms
Many times you will need to create forms to add/modify data on the backend. In HTML you have many elements that work as inputs for forms, for example select, textbox, checkbox etc. For React, UI libraries such as Material UI expose these inputs already stylized and with attributes that can help you to control the respective components.