How to organize Web Development using Git

Issue

Web Developers!

How do you go about organizing your Github projects for your front-end and back-end?

For example, I have a python script that generates a JSON file that the front end JavaScript consumes to generate data on the pages.

Would you create one repository with two directories labeled front-end and back-end?

Or would you make two different repositories?

I’m interested in what developers do in the wild. Because up until now I found myself having a complete clone of my website in a directory on my desktop PC, and just pushing individual files via SFTP from there.

I’m getting to the point where I have enough *.old files that I want to implement version control so I can view much older states of code with Metadata like date and user that edited it.

Solution

The answer is yes. Make two different github projects.

Just Like Michael W has stated, "[…] this is highly opinionated". What I find to be the most common approach is to implement a single github project when still in development and especially when you’re developing on your own. This is useful because you don’t have to switch up between repositories and/or branches, which saves time.

Another common approach is to split them up. However this approach is only possible when both projects can run independent from one and other. In your case it’s important to split the project logically. If the python project only generates JSON files and places them on a server location, then I would place that into it’s own github project, because the main purpose is to generate files, so the python application can run on a server seperate from the frontend. If the webapp only consumes the JSON files through maybe a rest call or through a connection to a FTP, then also that can be placed within it’s own project.

Answered By – Iliass Nassibane

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published