Structure for combined ServiceStack services and website

121 Views Asked by At

With Razor support, ServiceStack is a complete framework for creating both REST-services and websites.

When making both a website and services, how would you structure this? Not unnecessarily complex, but with an option to scale when the codebase gets large (and to make it easier for multiple developers to keep from working on the same files).

I've found bits and pieces, but would like a complete recipe/best practice.

Bits and pieces I have found:

  • Plugins, but can a whole website with static content and razor be contained within?
  • Move .cshtml files to another project, then include with the VirtualPathProvider parameter to the RazorFeature plug-in (combine multiple FileSystemVirtualPathProvider in a MultiVirtualPathProvider). Don't think static content is included.
  • Razor files can also be included as compiled views
  • Separate projects/solutions: the website calls the services via HTTP of the service-project (much like a single-page app would do with AJAX). Feels ineffective though, to involve HTTP when it's residing on the same host.
  • Single-page app calling the web-services and building content with JS instead of Razor (has a steep learning curve and no intellisense?). The SPA could be in a separate project, as all communication with the services are via WS HTTP.

PS: I know this has similarities with my other question, hope it's okay though.

0

There are 0 best solutions below