We are about to develop a web service, which will have some "social" features. We will need to create a (responsive) web site and apps for mobile (iOS/Android at least).
I have already developed web services which have APIs (for app access; generally not public). However, this time I was thinking about applying a different, reverted approach, and I would like some opinions about it.
Instead of developing the web site and then add APIs on top of it for letting the apps communicate with the service, I was thinking to start from the APIs and then build everything (including the web site) on top of it. There will, then, be a service (either a PHP or Node.js app) which communicates with the database, and both the web site (on server-side, not client-side) and the apps will communicate with this server.
Positive advantages of this approach:
However, I am also aware that this approach requires creating an extra layer between the web site and the database, and this could impact performances negatively.
What do you think? Do you have experience with this design, or case studies?
This is a perfectly suitable approach and one that is used successfully by many companies, including mine.
We tend to start with an API suite which permits access to Javascript/HTML web-applications. We predominantly use AngularJS to create the web application.
As an extra-layer (which you have identified) we sometimes also create more traditional server-side applications as clients of the web-service. This often feels like a lot more work than just creating seperate applications with different (but similar) subsystems, for example data-access, authentication. However once you have built these layers and "primary" applications you get the webservices for free! and you can publish the API suite with some documentation for integration partners to use, and you can build mobile applications on the same backend as your web-applications.
The major benefit we find is that there is less to test and maintain as the projects mature, whilst retaining heterogenous connecting clients.
Best of luck