Giter Site home page Giter Site logo

saeedsheikhi / elegant-react-ssr Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 6.0 588 KB

Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk boilerplate, without ejecting CRA

JavaScript 93.07% HTML 1.71% CSS 5.22%
ssr react create-react-app server-side-rendering zero-config css-in-js react-router redux redux-thunk

elegant-react-ssr's Introduction

Elegant-React-SSR

Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk boilerplate, without ejecting CRA. this boilerplate is heavily inspired by this medium article, and using under the hood React-Frontload. reach out for docs.

Client render Server render

Server-side rendering in Create React App

SSR with all the goodies, without ejecting.

Goals

  • Zero modifications to your existing CRA application
  • Create React App without ejecting
  • React 16 (fiber, baby!)
  • React Router v4 (with Thunk)
  • Full SEO support via React Helmet
  • Preloaded page data via async/await and React Frontload
  • Code splitting via React Loadable

Getting Started

Clone the repo:

git clone https://github.com/SaeedSheikhi/elegant-react-ssr.git
cd elegant-react-ssr

Install yarn:

npm install -g yarn

Install dependencies:

yarn

Set environment (vars):

cp .env.example .env.development
cp .env.example .env.production

Run application:

# Start on SSR mode on Unix machines
yarn build:unix && yarn serve:unix
# Start on SSR mode on Windows machines
yarn build:win && yarn serve:win

# Start on CSR mode
yarn start

Why?

Server-side rendering is a requirement for many modern web applications to appear correctly in search engines and social media parsers.

Question: Have you ever created a web application with multiple pages only to find out that your meta descriptions weren't page specific?
Answer: Server-side rendering

Question: Have you ever created a web application where users had individual profile pages that required pre-loading of metadata?
Answer: Server-side rendering

Question: Have you ever created a web application with a lot of content on your page that ends up taking a long time for your users to load in poor Internet conditions?
Answer: Server-side rendering

Contribute

Do what you normally do - fork and PR.

elegant-react-ssr's People

Contributors

saeedsheikhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.