I've have sf2 based api and admin apps, it's separated. But it uses one database. Now api works with database through doctrine entities and admin project is using native sql calls. And it's very annoying.
So my decision is to make common code reachable for 2 application. Mostly it will be doctrine entities.
Maybe someone have made something like that and have a good mechanizm. Ideas are welcome too.
For now I have only one idea, putt the entities in some other dir(synced with 3d repository) and config both projects to use it. But I can't get rid of thoughts that it can be made in simpler way.
A common and convenient way to share code between several applications is using Composer packages:
To be able to edit and commit code for your new private library directly in the vendor/
directory of your apps, use the --prefer-source
flag when you run composer install
or update
.
But here, you should ask yourself if it really make sense to have separate apps and repositories for the API and admin.