This repository has been archived by the owner. It is now read-only.
Example todo app built with React+Redux upon sensenet
Switch branches/tags
develop greenkeeper/autoprefixer-9.0.0 greenkeeper/autoprefixer-9.0.1 greenkeeper/autoprefixer-9.0.2 greenkeeper/autoprefixer-9.1.0 greenkeeper/autoprefixer-9.1.1 greenkeeper/autoprefixer-9.1.2 greenkeeper/autoprefixer-9.1.4 greenkeeper/autoprefixer-9.1.5 greenkeeper/autoprefixer-9.2.0 greenkeeper/autoprefixer-9.2.1 greenkeeper/autoprefixer-9.3.0 greenkeeper/autoprefixer-9.3.1 greenkeeper/autoprefixer-9.4.0 greenkeeper/autoprefixer-9.4.1 greenkeeper/autoprefixer-9.4.2 greenkeeper/downshift-3.0.0 greenkeeper/downshift-3.1.0 greenkeeper/downshift-3.1.1 greenkeeper/downshift-3.1.2 greenkeeper/downshift-3.1.3 greenkeeper/downshift-3.1.4 greenkeeper/downshift-3.1.5 greenkeeper/material-ui-pickers-2.0.0 greenkeeper/material-ui-pickers-2.0.1 greenkeeper/material-ui-pickers-2.0.2 greenkeeper/material-ui-pickers-2.0.3 greenkeeper/material-ui-pickers-2.0.4 greenkeeper/@material-ui/core-3.0.0 greenkeeper/@material-ui/core-3.0.1 greenkeeper/@material-ui/core-3.0.2 greenkeeper/@material-ui/core-3.0.3 greenkeeper/@material-ui/core-3.1.0 greenkeeper/@material-ui/core-3.1.1 greenkeeper/@material-ui/icons-2.0.0 greenkeeper/@material-ui/icons-2.0.1 greenkeeper/@material-ui/icons-2.0.2 greenkeeper/@material-ui/icons-2.0.3 greenkeeper/@material-ui/icons-3.0.0 greenkeeper/@material-ui/icons-3.0.1 greenkeeper/monorepo.material-ui-20181209203131 greenkeeper/monorepo.material-ui-20181209204201 greenkeeper/monorepo.material-ui-3.0.0-alpha.18 greenkeeper/monorepo.material-ui-3.0.0-alpha.19 greenkeeper/monorepo.material-ui-3.0.0-alpha.20 greenkeeper/monorepo.material-ui-3.0.0-alpha.21 greenkeeper/monorepo.material-ui-3.0.0-alpha.22 greenkeeper/monorepo.material-ui-3.0.0-alpha.23 greenkeeper/monorepo.material-ui-3.0.0-alpha.24 greenkeeper/monorepo.material-ui-3.1.2 greenkeeper/monorepo.material-ui-3.2.0 greenkeeper/monorepo.material-ui-3.2.1 greenkeeper/monorepo.material-ui-3.2.2 greenkeeper/monorepo.material-ui-3.3.0 greenkeeper/monorepo.material-ui-3.3.1 greenkeeper/monorepo.material-ui-3.3.2 greenkeeper/monorepo.material-ui-3.4.0 greenkeeper/monorepo.material-ui-3.5.0 greenkeeper/monorepo.material-ui-3.5.1 greenkeeper/monorepo.material-ui-3.6.0 greenkeeper/monorepo.material-ui-3.6.1 greenkeeper/monorepo.react-16.6.2 greenkeeper/monorepo.react-16.6.3 greenkeeper/postcss-loader-3.0.0 greenkeeper/radium-0.24.1 greenkeeper/radium-0.25.0 greenkeeper/react-pin-16.6.1 greenkeeper/react-redux-6.0.0 greenkeeper/react-scripts-ts-2.17.0 greenkeeper/react-scripts-ts-3.1.0 greenkeeper/@sensenet/redux-5.0.0 greenkeeper/@sensenet/redux-5.0.1 greenkeeper/@sensenet/redux-5.1.0 greenkeeper/@sensenet/redux-5.1.1 greenkeeper/@sensenet/redux-5.1.2 greenkeeper/@types/node-10.10.0 greenkeeper/@types/node-10.10.1 greenkeeper/@types/node-10.10.2 greenkeeper/@types/node-10.10.3 greenkeeper/@types/node-10.11.0 greenkeeper/@types/node-10.11.1 greenkeeper/@types/node-10.11.2 greenkeeper/@types/node-10.11.3 greenkeeper/@types/node-10.11.4 greenkeeper/@types/node-10.11.5 greenkeeper/@types/node-10.11.6 greenkeeper/@types/node-10.11.7 greenkeeper/@types/node-10.12.0 greenkeeper/@types/node-10.12.1 greenkeeper/@types/node-10.12.2 greenkeeper/@types/node-10.12.3 greenkeeper/@types/node-10.12.4 greenkeeper/@types/node-10.12.5 greenkeeper/@types/node-10.12.6 greenkeeper/@types/node-10.12.7 greenkeeper/@types/node-10.12.8 greenkeeper/@types/node-10.12.9 greenkeeper/@types/node-10.12.10 greenkeeper/@types/node-10.12.11 greenkeeper/@types/node-10.12.12 greenkeeper/@types/node-pin-10.9.4 greenkeeper/@types/react-16.4.14 greenkeeper/@types/react-16.7.5 greenkeeper/@types/react-16.7.6 greenkeeper/@types/react-16.7.7 greenkeeper/@types/react-16.7.8 greenkeeper/@types/react-16.7.9 greenkeeper/@types/react-16.7.10 greenkeeper/@types/react-16.7.11 greenkeeper/@types/react-16.7.12 greenkeeper/@types/react-16.7.13 greenkeeper/@types/react-pin-16.7.4 greenkeeper/webpack-4.12.1 greenkeeper/webpack-4.12.2 greenkeeper/webpack-4.13.0 greenkeeper/webpack-4.14.0 greenkeeper/webpack-4.15.0 greenkeeper/webpack-4.15.1 greenkeeper/webpack-4.16.0 greenkeeper/webpack-4.16.1 greenkeeper/webpack-4.16.2 greenkeeper/webpack-4.16.3 greenkeeper/webpack-4.16.4 greenkeeper/webpack-4.16.5 greenkeeper/webpack-4.17.0 greenkeeper/webpack-4.17.1 greenkeeper/webpack-4.17.2 greenkeeper/webpack-4.17.3 greenkeeper/webpack-4.18.0 greenkeeper/webpack-4.18.1 greenkeeper/webpack-4.19.0 greenkeeper/webpack-4.19.1 greenkeeper/webpack-4.20.0 greenkeeper/webpack-4.20.1 greenkeeper/webpack-4.20.2 greenkeeper/webpack-4.21.0 greenkeeper/webpack-4.22.0 greenkeeper/webpack-4.23.0 greenkeeper/webpack-4.23.1 greenkeeper/webpack-4.25.0 greenkeeper/webpack-4.25.1 greenkeeper/webpack-4.26.0 greenkeeper/webpack-4.26.1 greenkeeper/webpack-4.27.0 greenkeeper/webpack-4.27.1 greenkeeper/webpack-dev-server-3.1.5 greenkeeper/webpack-dev-server-3.1.6 greenkeeper/webpack-dev-server-3.1.7 greenkeeper/webpack-dev-server-3.1.8 greenkeeper/webpack-dev-server-3.1.9 greenkeeper/webpack-dev-server-3.1.10 master nodejs-10
Nothing to show
Clone or download
Latest commit d818d1d Dec 11, 2018

README.md

Todo App example with SN7, React and Redux


This package is not under active development. You can find our latest packages in the sensenset/sn-client monorepo.


Greenkeeper badge

Build status Coverage Codacy Badge License semantic-release Commitizen friendly

This example is simple todo app built with React+Redux upon sensenet which has been prepared to demonstrate how to use the new sensenet related libraries sn-client-js and sn-redux. The app and a steps of the related tutorial are based on two awesome Redux courses of Dan Abramov: Getting Started with Redux and Building React Applications with Idiomatic Redux. These two courses are extremely helpful and essential, recommended for everyone who is interested in building scalable apps with Redux.

Quick start

$ git clone https://github.com/SenseNet/sn-react-redux-todo-app.git
$ cd sn-react-redux-todo-app
$ npm install
$ npm start

Settings

To use this example you'll need a sensenet portal. To connect the app with the portal create a repository and set its RepositoryUrl

import { Repository } from 'sn-client-js';

const repository = new Repository.SnRepository({
  RepositoryUrl: 'https://sn-services/'
});

If you've created your app, with sn-client-cli you can set the RepositoryUrl in the related config file (sn.config.js in your projets root) too.

{
    RepositoryUrl: "https://sn-services/"
}

In this case you can define your repository the following way:

import { Repository } from 'sn-client-js';
import * as snConfig from './sn.config.js';

const repository = new Repository.SnRepository(snConfig);

To allow outer origins go to your portal's Portal.setting (/Root/System/Settings/Portal.settings). To get the app working you have to add the app's domain as an allowed origin so that the app can send requests to the portal and get or set data.

{
   AllowedOriginDomains: [ "localhost:13505" ]
}

For further information about CORS in sensenet check this article.

The example app uses a TaskList Content that should be created in sensenet portal. In the downloadable example it is '/Root/Sites/Default_Site/tasks' so if you want to try it with your custom sensenet install (no matter which one, eg, services, webpages, etc), you can create it at the same path, or modify it in the VisibleTodoList.tsx and the App.tsx files.

The example app demonstrates not only how to fetching data but also Content creation, edit and delete. The app provides authentication (for further information please check the docs with the 'jwt' tag), please check that the permission of the users are set correctly to run the mentioned applications.

If you are not familiar with sensenet's permission system check the following wiki articles:

Deployment

The app became now create-react-app based, which means you can use its great tools with no extra configurations. Since all our related projects are written in Typescript we used here [create-react-app-typescript].(https://github.com/wmonk/create-react-app-typescript).

To build the project run

npm build

It will transpile the .ts and .tsx files to JavaScript and copy them along with the sourcemaps to the dist folder along with the .css files.

To run the tests

npm test

Related documents