Answer the question
In order to leave comments, you need to log in
How to separate front-end development from back-end development?
Good day.
Earlier, when implementing simple projects, we had 2 developers, they are the same frontend, they are the backend, they are the same fairies who set up the network, proxy, etc.
The project code was stored in one repository, respectively, all views and statics were stored in it. Accordingly, all developers see all the code. The structure is classical - mvc.
At the controller level, it was decided to render html or give json. Everything is logical and understandable. With such a structure, there were no problems either during development or during testing, because when making changes to the template or view, you could immediately see the result.
At the moment, the task is to implement a more or less serious project. After reading the Internet on the topic of labor development, there were more questions than it was.
The main issue of frontend / backend separation.
How to implement the project structure in such a way that the frontend developer does not have access to the backend server code.
Let's say there are 2 frontend/backend repositories.
With the backend, everything is clear, let's say there are two methods behind the login /tasks - which returns html and /tasks/list - which returns json.
Frontend is not very clear.
A frontend developer assembles templates and views using primer, bow and other goodies on his machine. Now he needs to check how /tasks will look like. Not only is there no template engine on its side that, for example, will roll data from the session (First Name, Last Name, Avatar, etc.) onto the template, but also a route to /tasks/list that flies via ajax after the page is loaded.
The first option that came to mind is to write some kind of fakeServer for testing, which would give synthetics along routes similar to a combat server. But this option is long, "expensive", and stupid as it seems to me.
The second option that came to mind is to make the frontend a separate http server, which in turn accesses the backend via api. Not a very kosher option as it seems. part of the logic can go to the frontend and all rendering will go to this http server, respectively. However, I would like to hear opinions on this.
The third option I want to get from those who have already eaten this cactus.
Thank you.
Answer the question
In order to leave comments, you need to log in
One turnip
API versioning
There is no problem for a front-end developer to launch ./manage.py runserver
and get a working application
There is too much water and ambiguity in the question
Need framework names and a project description
Everything has already been invented for you.
Each project is in its own repository.
There is a dev server for the frontend (with live reload, etc.). Which connects to a real backend on a remote server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question