NotionCommotion Posted February 17, 2019 Share Posted February 17, 2019 I have two related websites which utilize the same database: Main website for public use. Admin website for administration purposes. Currently, I have both located in /var/www/combined-app which is a single git repository and contains the following: /var/www/combined-app/ public/ public-admin/ src/ main/ admin/ vendor/ composer.json bootstrap.php Alternatively, I could have done the following: /var/www/combined-app/ main/ public/ src/ vendor/ composer.json bootstrap.php admin/ public/ src/ vendor/ composer.json bootstrap.php Or maybe something else all together? Is one approach typically better than the other? If so, please provide reasons why. If my second example, would you recommend separate git repositories for main and admin? Thanks Quote Link to comment Share on other sites More sharing options...
ginerjm Posted February 17, 2019 Share Posted February 17, 2019 What happened to your last hugely complex and incomprehensible posted topic? I was reading it just to see what it ended up being but didn't see a resolution. On to a new topic to confound your readers already? Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 17, 2019 Author Share Posted February 17, 2019 @ginerjm, I have yet to see a single comment from you that provides any value. Please refrain from responding to any of my posts. Thank you Quote Link to comment Share on other sites More sharing options...
kicken Posted February 17, 2019 Share Posted February 17, 2019 If you're developing them as essentially separate sites I'd probably give them separate repositories as well. I'd also use separate domains such as www.example.com and admin.example.com, which would then end up being separate folders on disk such as /var/www/www.example.com/ and /var/www/admin.example.com/ Whatever works best for you and makes sense is probably fine though. I'm currently working on an API for an existing site. Like you the API and the site share the same database but are separate things more or less. The API has it's own git repository and is stored on a separate folder on the server. Since I don't control to domain it'll end up just being a sub-folder of the current site via an Alias /api /var/www/example-api in the server configuration. Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted February 17, 2019 Author Share Posted February 17, 2019 Thanks kicken, I currently use separate domains but will also go with separate repositories as you recommend. I was original thinking the Domain (I've been going down the ORM journey and I am currently thinking the domain consists of the Entities and Repositories) would need to exist under both the main and admin apps, but now am thinking it should exist independent of each and exist on its own as it reflects the business logic and database which is used by both sites. On a related note, I was reading this post which promotes organizing by "module"... src/ BasketModule/ Basket.php BasketService.php BasketRepository.php ORM/ Basket.orm.yml ProductModule/ Product.php ProductService.php ProductRepository.php ORM/ Product.orm.yml instead of the "classical" layout... src/ Entity/ Product.php Basket.php Service/ ProductService.php BasketService.php Repository/ ProductRepository.php BasketRepository.php Resources/ ORM/ Product.orm.yml Basket.orm.yml At first I thought it was a good idea, but now am thinking the Repository script can possibly span multiple entities and I will probably keep with a modified classical layout. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.