GIT Repository structure recomendation for a microservices application

Hi,
I’m building my device and I would like to organize my Balena IoT Device repository and I would like to have some recommendations based on your experience.

My project is composed of the following containers:

  1. Backend
  2. Frontend
  3. video processing application
  4. (in the future device performance agent)

I have the following options

  1. Create my base project that defines the 4 containers and each repository of the different microservices is added as a git clone directory and manage each repository separated.
  2. Use Git Submodules (Which I have never use, so If you know that is clearly working or is the best choice let me know)
  3. Copy the files and have a single project with all the sources in a unique repertory? ( I don’t know why, but for example, some conflicts founded in your experience?)

Personally, at the start of a project I would much prefer to keep all my code in one repository, as this makes early phase development much quicker and streamlined. As a project matures I would consider moving to an approach that uses git submodules.
All of this does depend on what programming language you are using and how easy it is for you to manage and test your different services from one place.

thanks @lucianbuzzo, well the different projects are already developed and we are just porting them to Balena.

  1. Backend (python)
  2. Frontend (node.js REACT + REDUX)
  3. Video processing application ( c++ + openCV3 + realsense 2 compiled in a multi stage build)

I think it has a kind of complesity already.

So what do you think?

Using git submodules would be a solid approach. You could take a look at this thread where @imrehg posted some good suggestions - Cloning git submodules when pushing to resin.io

1 Like