0

I have a project that is made in flask (python). I want to be able to easily separate the frontend from the backend, into multiple git repos. I've tried making 2 repos in the same folder, but that's a pain to do and needs a lot of configuration. My current directory has

  • static
  • storage
  • templates
  • other files such as app.py and .env

I want to sort them like this:

Frontend Repo Backend Repo
static storage
templates other files

I would be fine with changing some configuration inside the flask app that changed where it looks for the template/static folders, but I'm stuck on how to implement that.

BobDotCom
  • 319
  • 1
  • 8

1 Answers1

1

What you could do is have one repository with 3 or 4 branches. master, develop (optional), develop_backend and develop_frontend.

Starting from an empty repository you could now commit backend files to the backed branch and frontend files to the frontend one. Then merge them to either master or the joined develop branch whenever it makes sense.

For a visualization see the vizualization of the general merging approch see the image from this question.

enter image description here

[update]

You say you want your devs to have only access to frontend or backend. What you could do is creating dedicated downstream repositories which clone only the frontend branch.

Details see on how to clone only single branches see here

user_na
  • 2,154
  • 1
  • 16
  • 36