by ArtTimeInvestor · 5y ago · 0 comments
If your backend only takes in requests and spits out data, you can build the backend without spending any thoughts on user experience, layout, templates etc. All you do is design a database structure and API endpoints.
Because you can then derived a good architecture from that, but never the other way around.
But UI means dealing with those messy humans, while the backend is this nice quiet place where you can whisper to orderly computers.
As a backend dev, my projects started to get way better once I learned to not start with the database model and start to test some mock up on users first. Yet it's so tempting...
Say the backend developer coded a bunch of Django views where they output json data. They say "Job done. There are API endpoints for everything now.".
Now how does the frontend developer bring their templates into play so the json gets rendered "on the server side"?
https://docs.djangoproject.com/en/3.2/ref/class-based-views/...
This pattern seems to have declined in popularity, but it can really win in speed and simplicity over a frontend/API split.
In a setup where the frontend is doing the rendering, you can give the frontend developer access to a directory with static assets that get output to the browser verbatim.
How do you give them the ability to "have a Django template filter" without them having the ability to mess with the rest of the backend? Or do you set up a second server that talks to the APIs of the first server?