We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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 (https://docs.phalcon.io/en/latest/reference/applications.html#multi-module) or better to make 3 apps with common config, models and library folder?

Thanks!



98.9k
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.