Using Single Page Application in Umbraco CMS - umbraco

I know we can use ASP.NET MVC or Web Form in Umbraco CMS but is it Possible to use Single Page Application(SPA) in Umbraco CMS?
If yes, How can I do it?

You can refer to this post which contains the use of Umbraco as datasource for SPA.

One approach I've used in the past could be to expose the underlying Umbraco data as a web service by creating a Web Api controller, as described in the documentation.
You may then build an SPA application that consumes this RESTful web service. Have a look at this tutorial for an example.

Related

How to create a common frontend for multiple microservices in ASP.NET?

I've been reading up on microservices for a bit and started to develop some small services in ASP.NET web framework in the MVC pattern. What I'm struggling to figure out though is, how to create a shared UI for these services?
Currently every microservice has their own views and css, but I'd like a common frontend so I can use a single css for every service.
I'd be happy about any ideas on how to approach this problem, book recommendations to read up on it or maybe some example applications. Thank you.
As far as I can see there is no consensus on the best way of doing this securely, but I have worked in an org that used this pattern:
https://learn.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/microservice-based-composite-ui-shape-layout
Looks like you are using .Net MVC template that would create View and CSS . Microsservices are normally WebAPIs. Frontend (MVC or Single Page App) will use those Web APIs over http to render UI.
So you need to create a single front-end be it Single Page Application using Angular/ReactJs or Web view using .Net MVC. The front-end will query the backend microservices to retrieve the data and render UI.

Should I use asp.net Mvc with Angular 4 Cli ?

I am a beginner to angular4 wanted to integrate angular with asp.net MVC,
Should I use the only Angular to develop web Application or with MVC ?
AngularJS is a Client Side web (for browser) development framework, and it has nothing to do with the server-side stuff (eg. database related operations or managing user session).
You can use ASP.NET MVC with angular, but it's a good practice to use WEB API, because the View part from MVC will be taking care by the angular framework.
It shouldn't be a problem. You'll need to add a json api to your .net app but people do it all the time. As with everything, right tools for the right job though.

How to integrate WebAPI to an MVC application

I am developing an MVC5 application and use Entity Framewerok 6 code first on this. Now we we will also develop an android application that will interact with the MVC application (CRUD operations) by using the web services. At this stage I want to be clarified about the issues below:
1) I think WebAPI is better option for us as we use the services on android apps. What do you suggest?
2) In order to integrate WebAPI to an MVC project, which changes should be made? On the other hand, can we use the same controller and data layer methods (i.e. SaveChanges, etc.) by making some modifications i.e. inheritance? Or do we have to create a seperate methods for web services? Could you give an example by code?
3) Does integrating WebAPI to the MVC project affect the MVC project's abilities or methods? I mean that is there any disadvantage integrating WebAPI to an MVC project?
Any help would be appreciated.
1) That's a good idea. Web API is easy to implement and consume
2) You don't need to make changes to intergate Web API in your application: just start using it. As you want to expose CRUD operations from EF a good idea would be to implement ODATA services. Or use something like Breeze (depending on how you want to consume the services). See "MVC and Web API" bwelow
3) Web API doesn't affect at all the MVC part, unless you make a mistake setting the routes. Although they run in the same host, they work completely independent of each other.
MVC and Web API
Unless you need to do something special, like exposing Web API in a different URL or "domain name", MVC and Web API are implemented in the same web application project. To start using Web API in your MVC project simply add a new controller. Perhaps you'll have to include also the WEB API route configuration, and some other Web API configuration.
If you want to expose the EF model throug Web API you simply have to follow the instructions in the link to create an ODATA controller, which will expose the EF model as a RESTful service, allowing you to execute the CRUD operations to the EF model through URLs.
NOTE: What you want to do is a very frequesnt pattern in MVC applications: MVC is used for generating the views, and Web API fos exposing functionalities that can be easily consumed from the views usin Javascript + AJAX. Don't be afraid to use it. You'll find no problems at all

What could be best MVC project structure with web API?

I am an MVC.NET developer but never used API web service before in an MVC project.
I just want to know like for WCF services we use different project in the application usually. Likewise, what is best practice likewise for web API services and how they work with proxy design patterns extra?
In my current application I am using WCF services but I am keen to learn if API web service can replace it and how?
yes , you can replace with API service.
For your project structure , you can refer below link content.
Implement ASP.Net Web API in ASP.Net MVC 5
http://www.c-sharpcorner.com/UploadFile/4b0136/implement-Asp-Net-web-api-2-in-Asp-Net-mvc-5/

Is it possible to post from an external RoR site to Sitecore

Looking into possibly doing an integration with a blog that is powered by Sitecore. Is there anyway to use data from our site (RoR) to create a post on an external Sitecore blog? I guess something analogous to the Wordpress XML-RPC api or the Tumblr Restful API.
Thanks!
You should look into using the Sitecore Item Web API module, it's officially support by Sitecore and will give you CRUD access to Sitecore items.
You can restrict access to operations using standard Sitecore Security and passing in the user credentials when building the request. Additionally, like all things Sitecore, you can extend the API with pipeline processors to add anything else you require.
You could use the Visual Sitecore Service to create new items from your RoR website.
The Visual Sitecore Service is a webservice that is standard installed in Sitecore which enables you to read/write/create to and from Sitecore.
See this link for more information about the Visual Sitecore Service webservice.
You could also create your own webservice in Sitecore, that is what I mostly prefer to gain full control of the functionalities of the webservice.
Another option could be to read the data (periodically or realtime) from a JSON (or other) service from your RoR website and save it in Sitecore or XML format in file or custom database table. Whatever you prefer and fits your requirements.

Resources