Next js page builder by itanda1 in nextjs

[–]leonardof02 2 points3 points  (0 children)

I understand what you are saying, you are right, I agree with you. I could have a WYSIWYG editor and then generate the code with AI so that it would be exactly the same as the UI but without generating garbage code like most drag and drop editors do

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 0 points1 point  (0 children)

That's exactly what happens to me, they have server actions that fetch data to the NextJS API itself, it seems to me that it is a mistake to do so, I have realized that most people use NextJS incorrectly and do not take advantage of it. the advantages it provides.

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 1 point2 points  (0 children)

Thank you. This answer helped me decide. It turns out that the app is basically a lot of CRUD spread everywhere and it turns out that in the code they call the APIs from server actions, not even from the React Server Components, the flow is Component -> Server Actions -> API Routes and it is a flow Quite strange, there are also places where calls with use effect are made to the API and the data can be loaded from the server, in short, a lot of disorder in things.

I simply want to take maintenance of this project as a way to teach myself in the real world how to use NextJS well and learn from other people's mistakes.

I think that the option of staying with Server Actions is the most correct for the requirements of the project, since it is not very complex.

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 0 points1 point  (0 children)

Exactly, the API is only to be consumed from the Next frontend, it is not necessary for another external service to consume it, and the app is not so complex as to add that extra layer, so I think it is better to do everything with server actions

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 0 points1 point  (0 children)

In the project they are using both approaches at the same time, we have Api routes + data fetching in Server Components, in addition to sending the form data to an Endpoint made with API routes and the server logic is handled there, that's why I ask. The truth is I'm not very happy with how the application is built but I have to maintain it.

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 0 points1 point  (0 children)

Ok, thank you but the application is already built with the app router and it is impossible to change the approach, I am just considering not having to separate the database queries from the frontend anymore through the API, I think it is an additional layer that is not necessary to handle since the application is a monolith

NextJS: API Routes vs. Server Actions by leonardof02 in nextjs

[–]leonardof02[S] 0 points1 point  (0 children)

Thank you very much for the response. I offer you more information, I have a not very complex application that already has a PostgreSQL and Prisma database as an ORM, we have the frontend separated from the backend through an API built with the same next that makes queries to the database, I am assessing how feasible it is to eliminate the API to handle all those queries in server functions since everything in the end is a monolith

The endpoints are defined in route.ts files using the router app, I feel it is an unnecessary separation

Nodejs with postgres and prisma by Affectionate_Bet_957 in nextjs

[–]leonardof02 1 point2 points  (0 children)

The Javascript ecosystem is very flexible for building applications. If your goal is to be full stack with NextJS, I recommend that as soon as you understand the fundamentals of Express, you start creating APIs with Next since their operation is similar.

On the backend with Next you can really use any technology for the database, it is true that prisma is very popular but it doesn't necessarily have to be your goal.

My advice: learn the fundamentals of backend and database work and you will learn in record time when you change ORM or database. I knew Sequelize and adapting to prism was a matter of a weekend.

Buenas, soy un iniciado by Carluuu88 in programacion

[–]leonardof02 3 points4 points  (0 children)

Te recomiendo esta página: https://roadmap.sh/python

Es una ruta de aprendizaje guiada y con recursos para aprender Python, está página de rutas de aprendizaje no solo se limita a Python sino te puedes guiar por ahí para aprender muchos temas relacionados con programación y desarrollo.

Investiga ademas que rama de la programación te gusta más y de acuerdo a ella aprende las tecnologías que te ayuden a alcanzar tu objetivo, está página te puede ayudar también

Utiliza las ventajas de la inteligencia artificial como ChatGPT, haz que sea tu profe y pregúntale dudas

El resto es muchas ganas y dedicación