This is an example for react-redux apollo/graphql application, with passport backend support using a fake dev-only in-memory user storage.
It provides server-side rendering.
It's based on mtiger2k's starterkit. I replaced their mongodb user store with a dummy store to keep things simple for experimentation. Also I changed a bunch of code layout & style.
I added a couple authentication examples: Log in as
user1 with password
pass1 and use the remote counter. Then, try using the remote counter as
pass2 -- note the error messages. See api/schema.js.
Also, I added an example of filtering subscription events in api/subscriptions.js -- by choosing which events propagate to which clients you can save a lot of computing & network traffic.
Finally I added in server-side rendering for the bits that make sense -- not the forms, yet, though!
This is a starter boilerplate app I've put together using the following technologies:
- React Router
- Redux's futuristic Flux implementation
- React Router Redux Redux/React Router bindings.
- redux-form to manage form state in Redux
- graphql GraphQL is a query language and execution engine tied to any backend service.
- graphql-server-express GraphQL Server is a community-maintained open-source GraphQL server.
- react-apollo Use your GraphQL server data in your React components, with the Apollo Client.
- Babel for ES6 and ES7 magic
- Webpack for bundling
- Webpack Dev Middleware
- Webpack Hot Middleware
- Redux Dev Tools for next generation DX (developer experience). Watch Dan Abramov's talk.
- style-loader, sass-loader and less-loader to allow import of stylesheets in plain css, sass and less,
Running Dev Server
This will start the API server, webpack builder, and web server:
Use react-apollo and apollo-client to fetch data via graphql api.
Express with apollo server, using passport to authenticate.
Thanks for checking this out.
Mongo version by Scott, Tian, [firstname.lastname@example.org]