Frontend Beer [EN]
8 subscribers
11 photos
19 links
Let's discuss frontend over a craft beer

RU version: https://yangx.top/frontendbeer

Author: @dipiash
加入频道
Today I want to share information about the Schema First approach which is a part of the API First strategy. This approach plays a crucial role in frontend application development, especially when the API is being developed in parallel with the interface

In simple terms, the Schema First approach involves creating a contract (schema) between frontend and backend developers. This contract defines the data structure and endpoints that will be available on the server

From my experience, in 90% of cases, this contract remains stable and doesn't require significant changes in the future. This allows frontend developers to work on the interface, even if the API is not fully implemented yet

If you are using TypeScript in your project, tools like openapi-typescript can help you generate types automatically based on the provided contract. This ensures not only type safety but also quick detection of changes in the schema if the contract ever changes. TypeScript will guide you on where to adjust your code when checking types

Following the Schema First approach is possible if you strictly version your API or aim to avoid breaking changes. This method simplifies communication between teams and contributes to a more efficient and faster development of frontend applications

#FrontendBeer #openapitypescript #schemafirst #apifirst (c) Frontend Beer
👍1