Tuesday, May 9, 2023

React menus

So far in React tutorials I have seen only tiny applications with a very simple menu system.
Menus are simply hardcoded, maybe using React Router to simplify a bit the navigation.

A real life enterprise application will be MUCH more complex than that.

I have asked ChatGPT:
"I need to build a large UI application with a complex menu system. What is the current industry standard to maintain the menu items?"

Here is the answer - which is quite decent IMHO:

There are several approaches to maintaining menu items in a large UI application with a complex menu system, and the industry standard can vary depending on the specific requirements and technologies used in the project. However, here are a few common approaches:

Data-driven menus: In this approach, the menu items are stored in a database or other data source and retrieved dynamically by the application at runtime. This allows for greater flexibility in managing the menu items, as changes can be made to the data source without having to update the application code.

Component-based menus: Another approach is to build the menu system as a set of reusable components that can be composed and reused across different parts of the application. This can make it easier to maintain the menu items, as changes can be made to the components and propagated throughout the application.

Configuration-based menus: In this approach, the menu items are defined in configuration files or other external files that can be easily modified without having to modify the application code. This can make it easier to maintain the menu items, as changes can be made without requiring a code release.

Code-based menus: Finally, some applications may choose to maintain the menu items directly in code. While this can be more difficult to maintain, it can also provide greater control and customization over the menu system.

Ultimately, the best approach will depend on the specific requirements and constraints of the project. It may be helpful to consult with experienced UI developers and architects to determine the most appropriate approach for your particular use case.


Saturday, May 6, 2023

Swagger 2.0 vs OpenAPI 3.0, conversion

https://swagger.io/docs/specification/2-0/basic-structure/ Swagger 2.0 specifications

https://swagger.io/docs/specification/basic-structure/ OpenAPI 3.0 specifications

https://editor.swagger.io/ Swagger Editor, it contains a menu to translate 2.0 into 3.0, but this works by sending the yaml to a remote conversion service, so it might not work in your premises. You can also install the container with swagger-editor https://hub.docker.com/r/swaggerapi/swagger-editor/ , but make sure that external connectoins are legal in your company.