We have a website with a lot of functionality, and we now start another one, which should have a lot of common code with the first one.
What would be the best approach to avoid code duplication?
Possible solutions we consider:
- put these projects within one parent directory (but in separate git repositories), and just use components of the first project from the second one
- move common functionality to separate repository (this would require for us the rewrite a lot of code)
- just copy code from one project to another
- do everything inside one directory and check
Hosthttp-header to separate logic for each site
- (maybe there are other variants)
What are the best practices for this situation?