Web application structure #2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to develop the model for what we want our web app routing to look like.
Some of this is informed by the data models, some of this is informed by the intended design layout, they're all interconnected.
Let's build some early consensus on how we want this structured.
The last web dev way of doing for me was MVC model. It works, it keeps things neatly split.
I don't expect this product to have hundreds of handlers either. Obviously, instead of Controllers, we have handlers, but the practice is the same.
You already have a clear definition of your Models.
The View part is where everyone has a preference of how they want it tackled. I personally don't mind plain old js/html templating, but there are fancier frameworks that folks love htmx, react, etc.
Agreed - I'm not a huge fan of the current generation of front-end frameworks like React, and I'm more comfortable with non-single-page-apps in general, but I'm willing to defer to the frontend-leaning devs on the project in terms of the best tooling for the tasks at hand (although I really really hope that's not react haha)
Assuming that the server will be providing both a front end and a general-purpose API, a fairly typical pattern would be to prefix all of the API routes with
/api/1.0
.That leaves front end routes free to do whatever they want, in terms of server side loading/rendering of data, or consuming our own API routes via async fetches on the client side.