afshintalebi / RSSR-Documentation

Document Of RSSR boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation

document of RSSR (React Server Side Rendering) Boilerplate.

Table of Contents

Overview

RSSR is a SSR boilerplate for React js and contian:

  • SSR (Server Side Rendering)
  • User Authentication Structure
  • SEO optimization utilities
  • SCSS Style Namespace
  • and more …

Usage Tips

  • run commands at root of project.

Run as Development

  1. Run npm i (install npm packages)
  2. Run npm run dev in other next terminal (start running project for development)
  3. stay for initial build to can see App overlocalhost:8000 (App will be opened in browser automatically).

remove fake API

in real project you must remove fakeApi.

  1. go to ~/provider/server/development.js, find require('../setup/fakeApi')(app) and remove it.
  2. go to ~/provider/setup and remove fakeApi.js file.
  3. change API_HOST_IN_CLIENT and API_HOST_IN_SERVER in .env file.

Run as Production

  1. pull changes from Git
  2. Run npm i (install npm packages)
  3. Run npm run build (building the project and inject it in to /dist directory at root of project)
  4. Run one of below commands

initial start:

  • npm run start for start project with node runner (recommends for testing production).
  • npm run start-pm2-low for start project with pm2 tools and run production server over one core of CPU.
  • npm run start-pm2 is like npm run start-pm2-low but run over all CPU core. (learn more about it in PM2 cluster) (Recommend for Main production)

Updating:

  • npm run up-low, mix of delete available process and npm run start-pm2-low (once CPU core)
  • npm run up,like npm run up-low but over all CPU core (Recommend for Main production)

Structure

CSS

See the CSS documentation for more information.

JS

See the JS documentation for more information about the JavaScript side of things.

SEO

We use react-helmet for managing document head tags. Examples on how to write head tags can be found here. Also we use rssr-seo-optimization that redirect domains starting with www to non-www and remove slash at the end of URL for improve SEO

Testing

About

Document Of RSSR boilerplate