Last active
September 10, 2023 14:12
-
-
Save rikukissa/726bb514d42a85fbb43bd9e70c25f3db to your computer and use it in GitHub Desktop.
Revisions
-
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,6 @@ **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. This is to make your life within the project as easy as possible. As most increments require changes both in the API and the UI, it makes sense to treat them as one --- -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,10 @@ **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. This is to make your life within the project as easy as possible. As most increments require changes both in the API and the UI, it makes sense to treat them as one <br /> --- <br /> Put all subprojects of the same system (e.g. a web app) to the same repository: -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ # Should I have my UI and my API in separate repositories? <br /> **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. This is to make your life within the project as easy as possible. As most increments require changes both in the API and the UI, it makes sense to treat them as one <br /> <br /> @@ -16,10 +17,7 @@ Put all subprojects of the same system (e.g. a web app) to the same repository: my-project/ ui/ api/ ``` I tend to use [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) when working a project like this. In most cases, you can go without. It is only when you have co-dependent subprojects that share the same dependencies as React. -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,11 @@ **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. <br /> <br /> --- <br /> <br /> Put all subprojects of the same system (e.g. a web app) to the same repository: -
rikukissa revised this gist
Jul 14, 2020 . No changes.There are no files selected for viewing
-
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ # Should I have my UI and my API in separate repositories? <br /> **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. <br /> <br /> <br /> -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,16 @@ # Should I have my UI and my API in separate repositories? <br /> <br /> **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. <br /> <br /> <br /> <br /> --- <br /> <br /> <br /> <br /> Put all subprojects of the same system (e.g. a web app) to the same repository: -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,13 @@ # Should I have my UI and my API in separate repositories? **Keep the number of repositories as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. <br /> <br /> --- <br /> <br /> Put all subprojects of the same system (e.g. a web app) to the same repository: ``` -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Should I have my UI and my API in separate repositories? **Keep the number of repository as small as possible**. <br />You can easily start with just one repository and move some code to another when needed. --- -
rikukissa revised this gist
Jul 14, 2020 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,10 @@ # Should I have my UI and my API in separate repositories? **Keep the number of repository as small as possible**. You can easily start with just one repository and move some code to another when needed. --- Put all subprojects of the same system (e.g. a web app) to the same repository: ``` my-project/ -
rikukissa revised this gist
Jul 13, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Should I have my UI and my API in separate repositories? My personal view is that in most cases **it's best to have everything in just one repository**. Keep it simple. You can easily start with just one repository and move some code to another when needed. ``` my-project/ -
rikukissa revised this gist
Jul 13, 2020 . 1 changed file with 12 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,27 @@ # Should I have my UI and my API in separate repositories? My personal view is that in most cases it's best to have everything in just one repository. Keep it simple. You can easily start with just one repository and move some code to another when needed. ``` my-project/ ui/ api/ ``` This is to make your life within the project as easy as possible. As most increments require changes both in the API and the UI, it makes sense to treat them as one. I tend to use [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) when working a project like this. In most cases, you can go without. It is only when you have co-dependent subprojects that share the same dependencies as React. **Pros of having all subprojects in one repository** - Much nicer to navigate the project and make changes - Easy to come up with descriptive commit messages. "Add a logout feature" vs backend: "Add an endpoint for removing user's session" + frontend: "Add a logout button" - You see all changes you've made with `git status` - You can run tests for all projects at once - No risk of deploying non-matching / incompatible versions of the project **Cons of having all projects in one repository** - Some tools are not made with monorepos in mind. Especially all tools that build your project (CI tools, static site hosts) sometimes make assumptions of where your "`public`" directory is. Most of these can be configured these days tho. - If you are building a multipurpose standalone API meant to be used in many projects (that cannot be in the same monorepo), this might not be the best approach. I'd suggest you use a monorepo if the subprojects are clearly linked and depend on each other. -
rikukissa revised this gist
Jul 13, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Should I create separate repositories for my frontend and backend? My personal view is that in most cases it's best to have everything in just one repository. ``` my-project/ -
rikukissa revised this gist
Jul 13, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Should I create separate repositories for my frontend and backend? My personal view is that in most cases is best to have everything in just one repository. -
rikukissa renamed this gist
Jul 13, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rikukissa created this gist
Jul 13, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # Is it a good practive to have separate repositories for backend and frontend? My personal view is that in most cases is best to have everything in just one repository. ``` my-project/ frontend/ backend/ ``` This is to make the daily work within the project as easy as possible. This makes sense as most features require changing both how the frontend and the backend works. **Pros of having all projects in one repository** - Much nicer to navigate the project and make changes - Easy come up with descriptive commit messages + you see all changes you've made with `git status` - You can run tests for all projects at once - No risk of deploying non-matching / incompatible versions of the project **Cons of having all projects in one repository** - Some tools are not made with monorepos in mind. Especially all tools that build you project (CI tools, static site hosts) sometimes make assumptions of where your "`public`" directory is. Most of these can be configured these days tho. - If you are building a multipurpose standalone API meant to be used in many projects (that cannot be in the same monorepo), this might not be the best approach. I'd suggest you use a monorepo if the subprojects are clearly linked and depend on each other. **Cons of using 2 separate repositories:** - You need to create 2 separate commits for each increment - Changes are reviewed in two separate PRs - 2 repositories can easily get out of sync when one PR is accepted before the other one is ready - "Why isn't this feature working? 🤔" "Ah, I forgot to pull in the latest changes from the backend repo"