Giter Club home page Giter Club logo

reactumbracoexample's Introduction

Umbraco React Example Site

Live demo: http://umbraco-react.systempioneer.com/

Live demo screenshot

What is this?

This is the default Umbraco Fanoe starter kit re-imagined as a badass single-page app, powered by React. It's an example of how Umbraco and React can come together beautifully.

Built with love for our Umbraco friends by the dev team at SystemPioneer

Features

  • React components are rendered server-side within the Umbraco pipeline
  • Content is rendered by Umbraco grid, you can edit content in the backoffice just like a regular Umbraco site
  • Use of ES6 syntax & a build pipeline will be immediately familiar to React developers
  • Bundled with Webpack with 90% code re-use between server and client bundles

Disclaimer: This is new project and shouldn't be used yet for production. It's unstable and APIs will change

Technical Overview

Incoming requests are handled by a custom RenderMvcController, which is registered as the default controller and always renders the Master.cshtml template. In that template React server rendering is achieved using Reactjs.NET. An initial state for the React app is constructed using UmbracoHelper and passed as a prop to the root component.

On the client side we use react-router and construct route handlers programatically, using what we know about the Umbraco content nodes from the initial state. Every route renders a ContentPage component, which uses the fetch api to make a request to a custom SurfaceController called RenderContentController. RenderContentController returns a JSON object containing a "Content" property, which is HTML rendererd by Umbraco and is used by React to update the page. It also returns a "Name" property which is used by react-helmet to update the page title.

Contributing

We're definitely open for PRs! The project maintainer doesn't sleep and can merge a PR anytime. This is a new project and was built quickly as a proof-of-concept. There's a lot of hacky code and we want to refactor everything.

Still to do (at least):

  • Refactor logic out of the Master view
  • The ViewFromContentId method is referenced in a hacky way in the Master template, and should probably go in the service layer
  • The react code needs to be gone over to be refactored for readability
  • Let's write unit tests for the js and .NET

License

Copyright 2017 SYSTEMPIONEER LIMITED

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

reactumbracoexample's People

Contributors

glcheetham avatar wildgingerx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.