All Projects → DominicTobias → Universal React

DominicTobias / Universal React

A universal react starter, with routing, meta, title, and data features

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Universal React

fastify-vite
This plugin lets you load a Vite client application and set it up for Server-Side Rendering (SSR) with Fastify.
Stars: ✭ 497 (+101.21%)
Mutual labels:  isomorphic, universal, server-side-rendering
universal-react-relay-starter-kit
A starter kit for React in combination with Relay including a GraphQL server, server side rendering, code splitting, i18n, SEO.
Stars: ✭ 14 (-94.33%)
Mutual labels:  isomorphic, universal, server-side-rendering
Beidou
🌌 Isomorphic framework for server-rendered React apps
Stars: ✭ 2,726 (+1003.64%)
Mutual labels:  universal, isomorphic, server-side-rendering
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (+170.85%)
Mutual labels:  universal, isomorphic, server-side-rendering
Go Starter Kit
[abandoned] Golang isomorphic react/hot reloadable/redux/css-modules/SSR starter kit
Stars: ✭ 2,855 (+1055.87%)
Mutual labels:  universal, isomorphic, server-side-rendering
react-ssr-hydration
Example of React Server Side Rendering with Styled Components and Client Side Hydration
Stars: ✭ 15 (-93.93%)
Mutual labels:  isomorphic, universal, server-side-rendering
Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (-52.63%)
Mutual labels:  universal, isomorphic, server-side-rendering
webpack-isomorphic-compiler
A compiler that makes your life easier if you are building isomorphic webpack powered apps, that is, single page applications with server-side rendering
Stars: ✭ 16 (-93.52%)
Mutual labels:  isomorphic, universal, server-side-rendering
Awesome Nextjs
📔 📚 A curated list of awesome resources : books, videos, articles about using Next.js (A minimalistic framework for universal server-rendered React applications)
Stars: ✭ 6,812 (+2657.89%)
Mutual labels:  universal, isomorphic, server-side-rendering
Universal React Demo
ES6 demo of a simple but scalable React app with react-router, code splitting, server side rendering, and tree shaking.
Stars: ✭ 50 (-79.76%)
Mutual labels:  universal, isomorphic, server-side-rendering
Universal React Router4
Demo app showing how to use react-router v4 for server- and client-side rendering
Stars: ✭ 216 (-12.55%)
Mutual labels:  isomorphic, server-side-rendering
React Redux Boilerplate
It is a boilerplate of React-Redux as the infrastructure, which helps to setup a Web APP quickly
Stars: ✭ 113 (-54.25%)
Mutual labels:  universal, isomorphic
Koa React Universal
lightweight React-Koa2 universal boilerplate, only what is essential
Stars: ✭ 112 (-54.66%)
Mutual labels:  universal, isomorphic
Sambell
wake me when it's quitting time
Stars: ✭ 101 (-59.11%)
Mutual labels:  universal, server-side-rendering
Use Ssr
☯️ React hook to determine if you are on the server, browser, or react native
Stars: ✭ 230 (-6.88%)
Mutual labels:  isomorphic, server-side-rendering
Razzle
✨ Create server-rendered universal JavaScript applications with no configuration
Stars: ✭ 10,547 (+4170.04%)
Mutual labels:  universal, isomorphic
Vuesion
Vuesion is a boilerplate that helps product teams build faster than ever with fewer headaches and modern best practices across engineering & design.
Stars: ✭ 2,510 (+916.19%)
Mutual labels:  server-side-rendering, universal
Universal React Tutorial
📓 How to build universal web apps with React.
Stars: ✭ 136 (-44.94%)
Mutual labels:  universal, isomorphic
React Prepare
Prepare you app state for async server-side rendering and more!
Stars: ✭ 100 (-59.51%)
Mutual labels:  universal, server-side-rendering
Marko
A declarative, HTML-based language that makes building web apps fun
Stars: ✭ 10,796 (+4270.85%)
Mutual labels:  isomorphic, server-side-rendering

Universal React

This boilerplate aims at solving the MVP (Minimal Viable Product) of a universal app while trying to keep the base unopinionated elsewhere and simple to read and extend.

Universal React on NPM Dependency Status

Features

  • Universal routing react-router
  • Redux
  • Hot reloading
  • Title, meta, css, and scripts overridable by each component react-helmet
  • Universal data fetching/rehydration on the client cross-fetch
  • No other templating engines - React from root down
  • 404 and redirect handling
  • Shared app config
  • Webpack and Babel

Since there are so many opinions on how to use css (vanilla, sass, less, react css modules etc) I've left it up to you.

## Install & run

npm i && npm start

Go to http://localhost:3000/.

Build

npm run build

This will create a dist/ folder with a app.min.js which will be used on any environment which isn't undefined (i.e. not local).

npm run start-prod

This will build and then run your app with environment set to production, so that app.min.js and config/production.js are used.

Adding routes

Add your routes in Routes.js.

<Route path="users" component={Users} />

Title and Meta

The parent App.js defines the base title and meta in a Helmet component. Any sub-component can override/add properties (even adding scripts and css). See the react-helmet docs for more info.

Config

You can store app settings under app/config/. A file matching process.env.NODE_ENV will be loaded, for example app/config/production.js. If process.env.NODE_ENV is undefined it will fallback to app/config/default.js. You can access the correct config with:

import config from './config';

Data fetching and client hydration

Read the Redux guide if you are new to redux. Write Redux actions and stores as normal, and if the action creator is asynchronous then it should return a Promise (or a Promise.all) in the inner function.

You should write dispatches for actions that must be called for the container to be ready:

static readyOnActions(dispatch, params) {
  return Promise.all([
    dispatch(UserActions.fetchUserIfNeeded(params.id))
  ]);
}

You should also invoke the actions in componentDidMount. This ensures that if the component is reached on the client, then the same actions will be invoked. It's up to the action to figure out if fetches for data need to be made or not:

componentDidMount() {
  User.readyOnActions(this.props.dispatch, this.props.params);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].