godfreyd / react-ssr-platforms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSR

Server side rendering.

Usage

Development mode:

// 1. Run Node.js 14+
nvm use
// 2. Install requiments
npm install
// 3. Start the project
npm run dev

Production mode:

// 1. Run Node.js 14+
nvm use
// 2. Install requiments
npm install
// 3. Build project
npm run build
// 4. Start project
npm run start

If you don't have NVM, install it.

File structure

build/                          # Server bundle
configs/                        # Different configs (StyleLint, TsLint)
docker                          # Docker instructions
docs/                           # Docs
public/                         # Client bundle
scripts/                        # Оffline scripts for database modification, index creation, etc.
server/                         # BFF
    ├── lib/                    # Libs for routers
    ├── middlewares/            # Middlewares
    ├── routers/                # Express routers API
    │    ├── v1/
    │    │    ├──android.ts
    │    │    ├──ios.ts
    │    │    └──web.ts
    │    └── common.ts
    ├──app.ts                   # Express app initialization, loading routers
    └──index.ts                 # Input for BFF
src/                            # SSR sources 
    ├── client/
    │   ├── bundles/            # Templates for pages                 
    │   ├── components/         # Components
    │   ├── hooks/              # Hooks
    │   ├── lib/                # Libs
    │   ├── pages/              # Pages
    │   ├── redux/              # States
    │   │    ├── actions/       # Actions 
    │   │    ├── reducers/      # Редьюсеры
    │   │    ├── saga/          # Saga
    │   │    ├── selectors/     # Redux selectors
    │   │    ├── state.ts       # getInitialState
    │   │    └── store.ts       # Store
    │   ├── theme/              # CSS variables
    │   ├── App.tsx             # App component
    │   ├── App@desktop.tsx     # Root file of desktop client application
    │   ├── App@mobile.tsx      # Root file of mobile client application
    │   └── Routes.ts           # Routes
    └── helpers/
        ├── createStore.ts      # Helper for create store
        └── renderer.tsx        # Helper for render
static/                         # Static files
webpack/                        # Webpack configs
    └── loaders/                # Loaders
tsconfig.json                   # TypeScript config for development
tsconfig.production.json        # TypeScript config for production

Formating

// CSS
npm run format:css
// TS
npm run format:js
// Markdown
npm run format:md

ESLint

npm run eslint

About


Languages

Language:TypeScript 63.0%Language:JavaScript 26.2%Language:SCSS 10.7%Language:Shell 0.0%