Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Modules or Single Apps?

Hello!

Most of operations in app that I develop based on angularjs that gets json responses from RESTful API write with Phalcon. So I have 3 parts: API without views, Frontend with ui for users and Backend with ui for admins.

And all parts of app uses common models, libraries and settings (db and some services).

Should I use multi-module structure (http://docs.phalconphp.com/en/latest/reference/applications.html#multi-module) or better to make 3 apps with common config, models and library folder?

Thanks!



85.3k
Accepted
answer

I would go for 3 different apps, you can design a bootstrap that specifically work for every environment without unnecessary components/features/checks. For example, you can use a micro app for the Restful API and a single app for the backend and frontend. Libraries can be shared using a common autoloader.

Don't mean to reopen a thread, but it's been a few years since some significant changes to Phalcon. Does the recommendation still stand?

Thanks.

I would go for 3 different apps, you can design a bootstrap that specifically work for every environment without unnecessary components/features/checks. For example, you can use a micro app for the Restful API and a single app for the backend and frontend. Libraries can be shared using a common autoloader.