We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is there any example to show REST api that with backend & frontend structures?

Hi, I'm new to REST api, I've seen the example here https://docs.phalcon.io/en/3.2/tutorial-rest

And is there any example to show REST api that with backend & frontend structures? OR what's directory structure looks like?

edited Aug '17

Well, backend should be separate - so you only have one structure for that REST backend part. Frontend could be anything or anywhere. Mobile app, Hybrid app, AngularJS, you name it.

But sure, you can have your self hosted FE app on same server with REST API as backend. Only views are different then as REST API does not render/produce any views per se, but only data layer.



31.3k
edited Aug '17

I want to build an app with phalcon+vuejs. My "backend" means admin-part that administrators can manage the robots data (as an example), and the "frontend" means users can list or search the robots data. Both of them hosted on same server.

What's the best practice and the directory structrue?

You can try to use my lib or look at how I made the rest api system
https://github.com/corentin-begne/phalconTool



31.3k

Thanks!

But I'm not sure whether your case suitable for me

You can try to use my lib or look at how I made the rest api system
https://github.com/corentin-begne/phalconTool