S
S
Spbvx2017-03-10 19:05:25
Python
Spbvx, 2017-03-10 19:05:25

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

3 answer(s)
S
sim3x, 2017-03-10
@sim3x

One turnip
API versioning
There is no problem for a front-end developer to launch ./manage.py runserverand get a working application
There is too much water and ambiguity in the question
Need framework names and a project description

O
OnYourLips, 2017-03-10
@OnYourLips

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.

S
Spbvx, 2017-03-11
@Spbvx

Thank you all for your participation. Actually, I received the answer to my question from some speakers in this toast and from several articles.
One of them, who are interested: wbtech.ru/blog/frontend-and-backend-collaboration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question