4 ms·
That's how I prefer to structure my apps these days. It lends itself more naturally to the "disposable front-end" idea (a la Guy Kawasaki's writings). I prefer
by MalcolmDiggs 12y ago
That's how I prefer to structure my apps these days. It lends itself more naturally to the "disposable front-end" idea (a la Guy Kawasaki's writings). I prefer to push as much business-logic into the API as I can, and have the client be thin and quick. I also prefer to have the API be rock-solid (well tested, documented, etc) while the front-ends are more experimental and less stable.
In the very early stages of a startup (MVP phase) this might arguably be overkill. But as the team grows, you'll be happy that the backend and frontend folks are in different repos (as they probably have very different development methodologies). And as your userbase/traffic scales up, you'll be able to allocate server resources very efficiently.
An added benefit is that (depending on the front-end you use) porting to PhoneGap/Cordova and making a mobile app out of it is a breeze.
One word of caution as you jump into single-page front-ends: It's worth your time and effort to figure out an elegant SEO solution early on. I prefer prerender.io, but there are many good options.
- jfaucett 12y agoI would also add to your comments that it really depends on the startup idea I think. If its not anything that really needs to be realtime, or has minimum interactivity on the frontend and web is the only platform that matters, or if its an idea with lots of textual content i.e. newssite then separating it out into a pure frontend is probably not the right choice. I'd also add that running full integration tests and getting a continuous deployment solution working becomes a very non-trivial tasks the more separated your services are. Just something to keep in mind. Having said all that I agree in the general case and for everything I build these days as well its a backend api with various gui components (mobile/desktop/web) that consume it, which has all the benefits you enumerate.