Repository structure to accommodate frontend code #53
Replies: 2 comments 5 replies
-
I think option 1 is best for our use case. The frontend and backend are a single product, it's not like the frontend is just a client of the backend. We do not want to release them separately, we just want a single version of Mathesar, and coordinating across repositories will make that harder. In addition, we should use the backend to pre-render data on the frontend and avoid network calls wherever possible, and that's going to be easiest if they are in a single repo. |
Beta Was this translation helpful? Give feedback.
-
My default choice would be (2), but only because if we're wrong, it's easier (in my experience) to make the change (2) -> (1) or (2) -> (3) than it is to make a change like (1) -> (2). I'm not overly worried either way, though. |
Beta Was this translation helpful? Give feedback.
-
This discussion is regarding how we are going to structure our repository for frontend code.
Requirements:
Approaches:
1. Mono-repo
We could have a mono repo with frontend code within a subfolder of the Mathesar repo.
This folder could contain different tooling, and config files of it’s own and would function independent, as needed for frontend development. The build scripts of the frontend would ensure that the built assets are moved to the static folder of the backend web server.
Pros:
Cons:
2. Individual repositories
We could have a completely different repo for the frontend. docker-compose can have a step to download the latest/specific supported frontend build and place it within the webserver’s static folder.
Pros:
Cons:
3. Using Git Submodules
We could use git Submodules to have a mixed structure. Mathesar can have a submodule that references to the mathesar client repo. This allows tracking, and being able to access/work on the submodule repo from the parent repo.
Pros:
Cons:
Currently, I’m inclined with approach 2, which will offer clean separation of concerns, and it allows us to shift easily to approach 3 in the future, if such a need is warranted.
I may have overlooked some requirements/approaches here. I’d like to hear more of your thoughts around this.
Beta Was this translation helpful? Give feedback.
All reactions