├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── babel.config.js ├── dist ├── css │ ├── app.css │ ├── app.css.map │ ├── app.min.css │ └── app.min.css.map └── js │ ├── app.js │ ├── app.js.map │ ├── app.min.js │ ├── app.min.js.LICENSE.txt │ └── app.min.js.map ├── ecosystem.config.js ├── package-lock.json ├── package.json ├── public ├── assets │ ├── images │ │ ├── blank.gif │ │ ├── demo-posts │ │ │ ├── abw.svg │ │ │ ├── afg.svg │ │ │ ├── ago.svg │ │ │ ├── aia.svg │ │ │ ├── ala.svg │ │ │ ├── alb.svg │ │ │ ├── and.svg │ │ │ ├── are.svg │ │ │ ├── arg.svg │ │ │ ├── arm.svg │ │ │ ├── asm.svg │ │ │ ├── ata.svg │ │ │ ├── atf.svg │ │ │ ├── atg.svg │ │ │ ├── aus.svg │ │ │ ├── aut.svg │ │ │ ├── aze.svg │ │ │ ├── bdi.svg │ │ │ ├── bel.svg │ │ │ ├── ben.svg │ │ │ ├── bes.svg │ │ │ ├── bfa.svg │ │ │ ├── bgd.svg │ │ │ ├── bgr.svg │ │ │ ├── bhr.svg │ │ │ ├── bhs.svg │ │ │ ├── bih.svg │ │ │ ├── blm.svg │ │ │ ├── blr.svg │ │ │ ├── blz.svg │ │ │ ├── bmu.svg │ │ │ ├── bol.svg │ │ │ ├── bra.svg │ │ │ ├── brb.svg │ │ │ ├── brn.svg │ │ │ ├── btn.svg │ │ │ ├── bvt.svg │ │ │ ├── bwa.svg │ │ │ ├── caf.svg │ │ │ ├── can.svg │ │ │ ├── cck.svg │ │ │ ├── che.svg │ │ │ ├── chl.svg │ │ │ ├── chn.svg │ │ │ ├── civ.svg │ │ │ ├── cmr.svg │ │ │ ├── cod.svg │ │ │ ├── cog.svg │ │ │ ├── cok.svg │ │ │ ├── col.svg │ │ │ ├── com.svg │ │ │ ├── cpv.svg │ │ │ ├── cri.svg │ │ │ ├── cub.svg │ │ │ ├── cuw.svg │ │ │ ├── cxr.svg │ │ │ ├── cym.svg │ │ │ ├── cyp.svg │ │ │ ├── cze.svg │ │ │ ├── demoflag.jpg │ │ │ ├── deu.svg │ │ │ ├── dji.svg │ │ │ ├── dma.svg │ │ │ ├── dnk.svg │ │ │ ├── dom.svg │ │ │ ├── dza.svg │ │ │ ├── ecu.svg │ │ │ ├── egy.svg │ │ │ ├── eri.svg │ │ │ ├── esh.svg │ │ │ ├── esp.svg │ │ │ ├── est.svg │ │ │ ├── eth.svg │ │ │ ├── fin.svg │ │ │ ├── fji.svg │ │ │ ├── flk.svg │ │ │ ├── fra.svg │ │ │ ├── fro.svg │ │ │ ├── fsm.svg │ │ │ ├── gab.svg │ │ │ ├── gbr.svg │ │ │ ├── geo.svg │ │ │ ├── ggy.svg │ │ │ ├── gha.svg │ │ │ ├── gib.svg │ │ │ ├── gin.svg │ │ │ ├── glp.svg │ │ │ ├── gmb.svg │ │ │ ├── gnb.svg │ │ │ ├── gnq.svg │ │ │ ├── grc.svg │ │ │ ├── grd.svg │ │ │ ├── grl.svg │ │ │ ├── gtm.svg │ │ │ ├── guf.svg │ │ │ ├── gum.svg │ │ │ ├── guy.svg │ │ │ ├── hkg.svg │ │ │ ├── hmd.svg │ │ │ ├── hnd.svg │ │ │ ├── hrv.svg │ │ │ ├── hti.svg │ │ │ ├── hun.svg │ │ │ ├── idn.svg │ │ │ ├── imn.svg │ │ │ ├── ind.svg │ │ │ ├── iot.svg │ │ │ ├── irl.svg │ │ │ ├── irn.svg │ │ │ ├── irq.svg │ │ │ ├── isl.svg │ │ │ ├── isr.svg │ │ │ ├── ita.svg │ │ │ ├── jam.svg │ │ │ ├── jey.svg │ │ │ ├── jor.svg │ │ │ ├── jpn.svg │ │ │ ├── kaz.svg │ │ │ ├── ken.svg │ │ │ ├── kgz.svg │ │ │ ├── khm.svg │ │ │ ├── kir.svg │ │ │ ├── kna.svg │ │ │ ├── kor.svg │ │ │ ├── kos.svg │ │ │ ├── kwt.svg │ │ │ ├── lao.svg │ │ │ ├── lbn.svg │ │ │ ├── lbr.svg │ │ │ ├── lby.svg │ │ │ ├── lca.svg │ │ │ ├── lie.svg │ │ │ ├── lka.svg │ │ │ ├── lso.svg │ │ │ ├── ltu.svg │ │ │ ├── lux.svg │ │ │ ├── lva.svg │ │ │ ├── mac.svg │ │ │ ├── maf.svg │ │ │ ├── mar.svg │ │ │ ├── mco.svg │ │ │ ├── mda.svg │ │ │ ├── mdg.svg │ │ │ ├── mdv.svg │ │ │ ├── mex.svg │ │ │ ├── mhl.svg │ │ │ ├── mkd.svg │ │ │ ├── mli.svg │ │ │ ├── mlt.svg │ │ │ ├── mmr.svg │ │ │ ├── mne.svg │ │ │ ├── mng.svg │ │ │ ├── mnp.svg │ │ │ ├── moz.svg │ │ │ ├── mrt.svg │ │ │ ├── msr.svg │ │ │ ├── mtq.svg │ │ │ ├── mus.svg │ │ │ ├── mwi.svg │ │ │ ├── mys.svg │ │ │ ├── myt.svg │ │ │ ├── nam.svg │ │ │ ├── ncl.svg │ │ │ ├── ner.svg │ │ │ ├── nfk.svg │ │ │ ├── nga.svg │ │ │ ├── nic.svg │ │ │ ├── niu.svg │ │ │ ├── nld.svg │ │ │ ├── nor.svg │ │ │ ├── npl.svg │ │ │ ├── nru.svg │ │ │ ├── nzl.svg │ │ │ ├── omn.svg │ │ │ ├── pak.svg │ │ │ ├── pan.svg │ │ │ ├── pcn.svg │ │ │ ├── per.svg │ │ │ ├── phl.svg │ │ │ ├── plw.svg │ │ │ ├── png.svg │ │ │ ├── pol.svg │ │ │ ├── pri.svg │ │ │ ├── prk.svg │ │ │ ├── prt.svg │ │ │ ├── pry.svg │ │ │ ├── pse.svg │ │ │ ├── pyf.svg │ │ │ ├── qat.svg │ │ │ ├── reu.svg │ │ │ ├── rou.svg │ │ │ ├── rus.svg │ │ │ ├── rwa.svg │ │ │ ├── sau.svg │ │ │ ├── sdn.svg │ │ │ ├── sen.svg │ │ │ ├── sgp.svg │ │ │ ├── sgs.svg │ │ │ ├── shn.svg │ │ │ ├── sjm.svg │ │ │ ├── slb.svg │ │ │ ├── sle.svg │ │ │ ├── slv.svg │ │ │ ├── smr.svg │ │ │ ├── som.svg │ │ │ ├── spm.svg │ │ │ ├── srb.svg │ │ │ ├── ssd.svg │ │ │ ├── stp.svg │ │ │ ├── sur.svg │ │ │ ├── svk.svg │ │ │ ├── svn.svg │ │ │ ├── swe.svg │ │ │ ├── swz.svg │ │ │ ├── sxm.svg │ │ │ ├── syc.svg │ │ │ ├── syr.svg │ │ │ ├── tca.svg │ │ │ ├── tcd.svg │ │ │ ├── tgo.svg │ │ │ ├── tha.svg │ │ │ ├── tjk.svg │ │ │ ├── tkl.svg │ │ │ ├── tkm.svg │ │ │ ├── tls.svg │ │ │ ├── ton.svg │ │ │ ├── tto.svg │ │ │ ├── tun.svg │ │ │ ├── tur.svg │ │ │ ├── tuv.svg │ │ │ ├── twn.svg │ │ │ ├── tza.svg │ │ │ ├── uga.svg │ │ │ ├── ukr.svg │ │ │ ├── umi.svg │ │ │ ├── ury.svg │ │ │ ├── usa.svg │ │ │ ├── uzb.svg │ │ │ ├── vat.svg │ │ │ ├── vct.svg │ │ │ ├── ven.svg │ │ │ ├── vgb.svg │ │ │ ├── vir.svg │ │ │ ├── vnm.svg │ │ │ ├── vut.svg │ │ │ ├── wlf.svg │ │ │ ├── wsm.svg │ │ │ ├── yem.svg │ │ │ ├── zaf.svg │ │ │ ├── zmb.svg │ │ │ └── zwe.svg │ │ └── logo-colorful.png │ └── json │ │ ├── PostDetail.json │ │ └── Posts.json └── index.html ├── src ├── client │ ├── actions │ │ ├── demoListActions.js │ │ └── demoListDetailActions.js │ ├── client.js │ ├── components │ │ └── Buttons │ │ │ ├── README.md │ │ │ ├── index.tsx │ │ │ └── styles │ │ │ └── index.scss │ ├── reducers │ │ ├── demoListDetailReducer.js │ │ ├── demoListReducer.js │ │ └── index.js │ ├── router │ │ ├── App.js │ │ ├── RoutesConfig.js │ │ └── index.js │ └── views │ │ ├── _html │ │ ├── include-footer.html │ │ ├── include-header.html │ │ └── index.html │ │ └── _pages │ │ ├── 404 │ │ └── index.js │ │ ├── Home │ │ └── index.js │ │ ├── NestedRoutes │ │ ├── NestedRoutesDetail.js │ │ └── index.js │ │ ├── Posts │ │ ├── PostDetail.js │ │ ├── PostItem.js │ │ └── index.js │ │ └── Todos │ │ ├── LoginPage.js │ │ └── index.js ├── server │ ├── app.js │ ├── renderer.js │ └── server.js └── store │ └── createStore.js ├── test └── sum.test.js ├── tsconfig.json ├── tsconfig.tsbuildinfo └── webpack.config.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # vuepress build output 72 | .vuepress/dist 73 | 74 | # Serverless directories 75 | .serverless 76 | 77 | # FuseBox cache 78 | .fusebox/ 79 | 80 | # misc 81 | .DS_Store 82 | src/.DS_Store 83 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # For more information about the configurations used 2 | # in this file, please see the Travis CI documentation: 3 | # https://docs.travis-ci.com 4 | language: node_js 5 | 6 | node_js: 7 | - 10 8 | 9 | before_install: 10 | - npm install rimraf -g 11 | - rimraf node_modules 12 | - npm config set package-lock false 13 | - npm cache clean --force 14 | 15 | 16 | script: 17 | - npm install --dev 18 | - npm view build 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | #### = 0.1.2 (September 1, 2022) = 4 | 5 | * Tweak: Added solutions to problems that may occur when deploying the application on cloud server. 6 | 7 | 8 | #### = 0.1.1 (August 29, 2022) = 9 | 10 | * Tweak: Optimized TypeScript interfaces and types in components. 11 | * Tweak: Optimize webpack configuration. 12 | * Tweak: Upgrade Node dependencies. 13 | 14 | 15 | 16 | #### = 0.1.0 (October 13, 2021) = 17 | 18 | * Tweak: Optimized redux patterns for ensuring good performance. 19 | * Tweak: Changed the test API of Posts. 20 | 21 | 22 | #### = 0.0.16 (June 10, 2021) = 23 | 24 | * Tweak: Optimized the structure of redux. 25 | 26 | 27 | #### = 0.0.12 (April 26, 2021) = 28 | 29 | * Tweak: Detail optimization. 30 | * Tweak: Refine the README documents. 31 | 32 | 33 | #### = 0.0.11 (April 16, 2021) = 34 | 35 | * Supports directories and custom aliases for specific files when the express server is running. 36 | * Router Pages optimization. 37 | 38 | 39 | #### = 0.0.10 (April 15, 2021) = 40 | 41 | * Add Nested Routes demo. 42 | * Minor adjustment of the Router directory structure. 43 | 44 | 45 | #### = 0.0.9 (April 6, 2021) = 46 | 47 | * Added some important notes. 48 | * Optimized some business logic of redux. 49 | 50 | 51 | #### = 0.0.8 (April 2, 2021) = 52 | 53 | * Update production environment dependencies. 54 | * Adjusted the directory structure of `src/client/`. 55 | 56 | 57 | #### = 0.0.75 (March 30, 2021) = 58 | 59 | * Add `pm2` configuration file for server-side deployment. 60 | 61 | 62 | 63 | #### = 0.0.72 (March 29, 2021) = 64 | 65 | * Set React Router Default Route Redirect to /index. 66 | * Modify the server-side command `npm run dev` to `npm run server`. 67 | 68 | 69 | 70 | #### = 0.0.6 (April 30, 2020) = 71 | 72 | * Further optimize SSR performance. 73 | * Handling 404 pages (catch all routes). 74 | 75 | 76 | #### = 0.0.5 (April 27, 2020) = 77 | 78 | * Using Redux with server rendering. 79 | 80 | 81 | #### = 0.0.4 (April 24, 2020) = 82 | 83 | * Add Simple React Login Form. 84 | 85 | 86 | 87 | #### = 0.0.3 (April 9, 2020) = 88 | 89 | * Adjusted the place of global variables. 90 | * Modify router callback. 91 | * Change the directory structure for easier identification. 92 | * Use redux as a state container. 93 | * Fixed the state of navigation activation. 94 | 95 | 96 | #### = 0.0.1 (April 8, 2020) = 97 | 98 | * First release. 99 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Full-Stack React SSR Application Template 2 | 3 | Hi, there! 4 | 5 | * [Communication](#communication) 6 | * [Resources](#res) 7 | 8 | 9 | ## Communication 10 | 11 | * Website: https://uiux.cc 12 | * Twitter: https://twitter.com/uiux_lab 13 | 14 | 15 | 16 | ## Resources 17 | 18 | Full-Stack React SSR Application Template bundles the following third-party resources: 19 | 20 | - [redux](https://redux.js.org/) 21 | - [nodemon](https://nodemon.io/) 22 | - [React](https://reactjs.org/) 23 | - [Babel](https://babeljs.io/) 24 | - [Express](http://expressjs.com/) 25 | - [axios](https://github.com/axios/axios) 26 | 27 | 28 | All photos uploaded to the site are released under Creative Commons - CC0 and do not require attribution. No more hassle trying to figure out whether you can use photos for commercial use and whether you need to provide attribution. (http://www.gratisography.com, https://stocksnap.io ) Part of the image and videos used in the demo are not distributed with the theme. They are all licensed under Creative Commons and credited to their respective creator/owner. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 UIUX Lab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "presets": [ 3 | 4 | [ 5 | "@babel/preset-env", 6 | { 7 | "targets": { 8 | "node": "current" 9 | } 10 | } 11 | ], 12 | [ 13 | "@babel/preset-react" 14 | ], 15 | [ 16 | "@babel/preset-typescript" 17 | ] 18 | ], 19 | "plugins": [ 20 | ["@babel/plugin-transform-runtime", 21 | { 22 | "regenerator": true 23 | } 24 | ], 25 | [ 26 | "@babel/plugin-proposal-class-properties" 27 | ], 28 | ["module-resolver", { 29 | "root": ["./src"], 30 | "alias": { 31 | "@/config": "./src/config", 32 | "@/components": "./src/client/components", 33 | "@/router": "./src/client/router", 34 | "@/helpers": "./src/client/helpers", 35 | "@/services": "./src/client/services", 36 | "@/reducers": "./src/client/reducers", 37 | "@/pages": "./src/client/views/_pages", 38 | "@/actions": "./src/client/actions", 39 | "@/server": "./src/server", 40 | "@/store": "./src/store" 41 | } 42 | }] 43 | 44 | ] 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /dist/css/app.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * 3 | * DO NOT OVERRIDE THIS FILE. 4 | * Generated with "npm run build" 5 | * 6 | * ## Project Name : Full-Stack React SSR Application Template 7 | * ## Project Description : This repository is a full-stack sample web application based on React+TypeScript+Babel+Webpack+Jest (+Redux+Express) that creates a simple whole-website architecture with Server-Side Rendering (SSR). 8 | * ## Project URL : https://uiux.cc 9 | * ## Version : 0.1.2 10 | * ## Based on : fullstack-react-ssr-app-template (https://github.com/xizon/fullstack-react-ssr-app-template#readme) 11 | * ## Last Update : September 1, 2022 12 | * ## Created by : UIUX Lab (https://uiux.cc) (uiuxlab@gmail.com) 13 | * ## Released under the MIT license. 14 | * 15 | */ 16 | button { 17 | border: 0; 18 | margin: 5px; 19 | border-radius: 3px; 20 | padding: 5px 15px; 21 | } 22 | 23 | button:hover { 24 | filter: Invert(); 25 | } 26 | 27 | 28 | /*# sourceMappingURL=app.css.map*/ -------------------------------------------------------------------------------- /dist/css/app.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"../css/app.css","mappings":";;;;;;;;;;;;;;;AAAA;EACC,SAAS;EACT,WAAW;EACX,kBAAkB;EAClB,iBAAiB;ACClB;;ADLA;EAOE,gBAAgB;ACElB","sources":["webpack:///./src/client/components/Buttons/styles/index.scss","webpack:///index.scss"],"sourcesContent":["button {\n\tborder: 0;\n\tmargin: 5px;\n\tborder-radius: 3px;\n\tpadding: 5px 15px;\n\t\n\t&:hover {\n\t\tfilter: Invert();\n\t}\n}\n","button {\n border: 0;\n margin: 5px;\n border-radius: 3px;\n padding: 5px 15px;\n}\n\nbutton:hover {\n filter: Invert();\n}\n"],"names":[],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/css/app.min.css: -------------------------------------------------------------------------------- 1 | button{border:0;border-radius:3px;margin:5px;padding:5px 15px}button:hover{filter:Invert()} 2 | /*# sourceMappingURL=app.min.css.map*/ -------------------------------------------------------------------------------- /dist/css/app.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"../css/app.min.css","mappings":"AAAA,OACC,QAAS,CAET,iBAAkB,CADlB,UAAW,CAEX,gBCCD,CDLA,aAOE,eCEF","sources":["webpack:///./src/client/components/Buttons/styles/index.scss","webpack:///index.scss"],"sourcesContent":["button {\n\tborder: 0;\n\tmargin: 5px;\n\tborder-radius: 3px;\n\tpadding: 5px 15px;\n\t\n\t&:hover {\n\t\tfilter: Invert();\n\t}\n}\n","button {\n border: 0;\n margin: 5px;\n border-radius: 3px;\n padding: 5px 15px;\n}\n\nbutton:hover {\n filter: Invert();\n}\n"],"names":[],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/js/app.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /*! 8 | * 9 | * DO NOT OVERRIDE THIS FILE. 10 | * Generated with "npm run build" 11 | * 12 | * ## Project Name : Full-Stack React SSR Application Template 13 | * ## Project Description : This repository is a full-stack sample web application based on React+TypeScript+Babel+Webpack+Jest (+Redux+Express) that creates a simple whole-website architecture with Server-Side Rendering (SSR). 14 | * ## Project URL : https://uiux.cc 15 | * ## Version : 0.1.2 16 | * ## Based on : fullstack-react-ssr-app-template (https://github.com/xizon/fullstack-react-ssr-app-template#readme) 17 | * ## Last Update : September 1, 2022 18 | * ## Created by : UIUX Lab (https://uiux.cc) (uiuxlab@gmail.com) 19 | * ## Released under the MIT license. 20 | * 21 | */ 22 | 23 | /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ 24 | 25 | /** @license React v0.20.2 26 | * scheduler.production.min.js 27 | * 28 | * Copyright (c) Facebook, Inc. and its affiliates. 29 | * 30 | * This source code is licensed under the MIT license found in the 31 | * LICENSE file in the root directory of this source tree. 32 | */ 33 | 34 | /** @license React v16.13.1 35 | * react-is.production.min.js 36 | * 37 | * Copyright (c) Facebook, Inc. and its affiliates. 38 | * 39 | * This source code is licensed under the MIT license found in the 40 | * LICENSE file in the root directory of this source tree. 41 | */ 42 | 43 | /** @license React v17.0.2 44 | * react-dom.production.min.js 45 | * 46 | * Copyright (c) Facebook, Inc. and its affiliates. 47 | * 48 | * This source code is licensed under the MIT license found in the 49 | * LICENSE file in the root directory of this source tree. 50 | */ 51 | 52 | /** @license React v17.0.2 53 | * react-is.production.min.js 54 | * 55 | * Copyright (c) Facebook, Inc. and its affiliates. 56 | * 57 | * This source code is licensed under the MIT license found in the 58 | * LICENSE file in the root directory of this source tree. 59 | */ 60 | 61 | /** @license React v17.0.2 62 | * react.production.min.js 63 | * 64 | * Copyright (c) Facebook, Inc. and its affiliates. 65 | * 66 | * This source code is licensed under the MIT license found in the 67 | * LICENSE file in the root directory of this source tree. 68 | */ 69 | -------------------------------------------------------------------------------- /ecosystem.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "apps": [ 3 | { 4 | //App name 5 | "name": "fullstack-react-ssr-app-template", 6 | //The path of the executable file 7 | "script": "./src/server/server.js", 8 | "env": { 9 | "COMMON_VARIABLE": "true" 10 | }, 11 | "env_production": { 12 | "NODE_ENV": "production" 13 | } 14 | } 15 | ], 16 | "deploy": { 17 | "production": { 18 | //Server user 19 | "user": "username", 20 | //server address 21 | "host": ["localhost"], 22 | //Server port 23 | "port": "3000", 24 | "ref": "origin/master", 25 | //git ssh 26 | "repo": "https://github.com/xizon/fullstack-react-ssr-app-template.git", 27 | //project destination path of the server 28 | "path": "/Applications/MAMP/htdocs/fullstack-react-ssr-app-template", 29 | //hook 30 | 'post-deploy' : 'npm install && npm run build && pm2 reload ecosystem.config.js --env production', 31 | "env": { 32 | //environment 33 | "NODE_ENV": "production" 34 | } 35 | } 36 | } 37 | }; -------------------------------------------------------------------------------- /public/assets/images/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xizon/fullstack-react-ssr-app-template/f38a61eba575af6cb63cf2a0618334ed67ca645d/public/assets/images/blank.gif -------------------------------------------------------------------------------- /public/assets/images/demo-posts/abw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ago.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/aia.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ala.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/are.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/arm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/atf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/atg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/aus.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/aut.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/aze.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bdi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ben.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bfa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bgd.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bgr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bhr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bhs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bih.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/blr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Belarus 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bol.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/brb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Barbados 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bvt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/bwa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/caf.svg: -------------------------------------------------------------------------------- 1 | Flag of the Central African Republic 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/can.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/che.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/chl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/chn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/civ.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cmr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cod.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cok.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/col.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/com.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cpv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cri.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cub.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cuw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cxr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/cze.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/demoflag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xizon/fullstack-react-ssr-app-template/f38a61eba575af6cb63cf2a0618334ed67ca645d/public/assets/images/demo-posts/demoflag.jpg -------------------------------------------------------------------------------- /public/assets/images/demo-posts/deu.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Flag of Germany 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/dji.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/dnk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/dza.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/esh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/est.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/eth.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/fin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/fra.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/fro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/fsm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gab.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gbr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/geo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ggy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gha.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gmb.svg: -------------------------------------------------------------------------------- 1 | 2 | Flag of The Gambia 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/gnb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/grc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of Greece 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/grd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/grl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/guf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 13 | 14 | 15 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/guy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/hkg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/hmd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/hnd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/hun.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/idn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ind.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/irl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/irn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/irq.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/isl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/isr.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | Flag of Israel 8 | 9 | 20 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ita.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/jam.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/jor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/jpn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ken.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/kgz.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/kir.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/kna.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/kor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of South Korea 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/kwt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lao.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lbr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lby.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lca.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lso.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ltu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lux.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/lva.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/maf.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mco.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mdg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mdv.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mhl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of the Marshall Islands 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mkd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mli.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mmr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mng.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mrt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mtq.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mwi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Malawi 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/mys.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nam.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ncl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of New Caledonia 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 24 | 25 | 31 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ner.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nga.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/niu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Flag of Niue 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/npl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Nepal 5 | Coding according to the official construction in "Constitution of the Kingdom of Nepal, Article 5, Shedule 1", adopted in November 1990 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nru.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/nzl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/pak.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Pakistan 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/pan.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/per.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/phl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of the Philippines 5 | Coding according to the official "description and specification of the FILIPINO flag" in Executive Order No. 23 from 1936 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/plw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/png.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of Papua New Guinea 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/pol.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/pri.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | the star is in the center of gravity of the triangle, so the x-pos is irrational (tan(30 deg) * 15) 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/prk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/pse.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/qat.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/reu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/rou.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/rus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/rwa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Rwanda 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sdn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sen.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sgp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sjm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/slb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/som.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ssd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of South Sudan 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/stp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/sur.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/svk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flag of Slovakia 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/svn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Slovenia 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/swe.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/syc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/syr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tcd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tgo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tha.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tjk.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Flag of Tajikistan 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tkl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tls.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ton.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tto.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tun.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tur.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tuv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/twn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/tza.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ukr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/umi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ury.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flag of Uruguay 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/usa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/uzb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/vct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/ven.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/vnm.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Flag of Vietnam 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/vut.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/wlf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/wsm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/yem.svg: -------------------------------------------------------------------------------- 1 | 2 | flag of Yemen 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/assets/images/demo-posts/zaf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/assets/images/logo-colorful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xizon/fullstack-react-ssr-app-template/f38a61eba575af6cb63cf2a0618334ed67ca645d/public/assets/images/logo-colorful.png -------------------------------------------------------------------------------- /public/assets/json/PostDetail.json: -------------------------------------------------------------------------------- 1 | [{"name":"Demo Name","topLevelDomain":[".af"],"alpha2Code":"AF","alpha3Code":"AFG","callingCodes":["93"],"capital":"Kabul","altSpellings":["AF","Afġānistān"],"region":"Asia","subregion":"Southern Asia","population":27657145,"latlng":[33.0,65.0],"demonym":"Afghan","area":652230.0,"gini":27.8,"timezones":["UTC+04:30"],"borders":["IRN","PAK","TKM","UZB","TJK","CHN"],"nativeName":"افغانستان","numericCode":"004","currencies":[{"code":"AFN","name":"Afghan afghani","symbol":"؋"}],"languages":[{"iso639_1":"ps","iso639_2":"pus","name":"Pashto","nativeName":"پښتو"},{"iso639_1":"uz","iso639_2":"uzb","name":"Uzbek","nativeName":"Oʻzbek"},{"iso639_1":"tk","iso639_2":"tuk","name":"Turkmen","nativeName":"Türkmen"}],"translations":{"de":"Afghanistan","es":"Afganistán","fr":"Afghanistan","ja":"アフガニスタン","it":"Afghanistan","br":"Afeganistão","pt":"Afeganistão","nl":"Afghanistan","hr":"Afganistan","fa":"افغانستان"},"flag":"/assets/images/demo-posts/demoflag.jpg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"AFG"}] -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Full-Stack React SSR Application Template 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
{{reactApp}}
47 | 48 | 49 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/client/actions/demoListActions.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const actionCreators = () => { 4 | 5 | // The function defined by async will return the value of a `Promise()` object resolve by default, 6 | // so the `then()` can be used directly, and the returned value is the params of the `then()` 7 | return async (dispatchFunction) => { 8 | 9 | const res = await axios.get( `https://restcountries.com/v2/all` ); 10 | //const res = await axios.get( `../../assets/json/Posts.json` ); 11 | 12 | 13 | //The Redux store has a method called `store.dispatch()`. 14 | const action = { 15 | type: 'RECEIVE_DEMO_LIST', 16 | payload: res.data 17 | } 18 | 19 | dispatchFunction(action); 20 | 21 | } 22 | } 23 | 24 | export default actionCreators; -------------------------------------------------------------------------------- /src/client/actions/demoListDetailActions.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const actionCreators = (id) => { 4 | 5 | // The function defined by async will return the value of a `Promise()` object resolve by default, 6 | // so the `then()` can be used directly, and the returned value is the params of the `then()` 7 | return async (dispatchFunction) => { 8 | 9 | const res = await axios.get( `https://restcountries.com/v2/name/${id}` ); 10 | //const res = await axios.get( `../../assets/json/Posts.json` ); 11 | 12 | 13 | //The Redux store has a method called `store.dispatch()`. 14 | const action = { 15 | type: 'RECEIVE_DEMO_LISTDETAIL', 16 | payload: res.data 17 | } 18 | 19 | dispatchFunction(action); 20 | 21 | } 22 | } 23 | 24 | export default actionCreators; 25 | -------------------------------------------------------------------------------- /src/client/client.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { Provider } from 'react-redux'; 4 | import Router from './router/index.js'; 5 | 6 | // 7 | import { createStore, applyMiddleware } from 'redux'; 8 | import thunk from 'redux-thunk'; 9 | import rootReducer from './reducers/index.js'; 10 | 11 | 12 | //All we need to do is grab the initial state from window.__PRELOADED_STATE__ and pass 13 | //it to our createStore() function as the initial state. 14 | const state = window.__PRELOADED_STATE__; 15 | delete window.__PRELOADED_STATE__; 16 | 17 | 18 | const store = createStore(rootReducer, state, applyMiddleware(thunk)); 19 | 20 | // 21 | ReactDOM.hydrate( 22 | 23 | 24 | , 25 | document.querySelector('#app') 26 | ); 27 | 28 | -------------------------------------------------------------------------------- /src/client/components/Buttons/README.md: -------------------------------------------------------------------------------- 1 | # @/components/Buttons 2 | 3 | ![MIT license](https://badgen.now.sh/badge/license/MIT) 4 | 5 | [Source](https://github.com/xizon/fullstack-react-ssr-app-template/tree/main/src/components/Buttons) 6 | 7 | 8 | ## Examples 9 | 10 | ```js 11 | import React from 'react'; 12 | import Button from '@/components/Buttons'; 13 | 14 | let spreadOperator = { 15 | bgColor: 'info', 16 | btnName: 'Spread Operator', 17 | }; 18 | 19 | 20 | export default () => { 21 | return ( 22 | <> 23 | 85 | )} 86 | 87 | 88 | ) 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/client/components/Buttons/styles/index.scss: -------------------------------------------------------------------------------- 1 | button { 2 | border: 0; 3 | margin: 5px; 4 | border-radius: 3px; 5 | padding: 5px 15px; 6 | 7 | &:hover { 8 | filter: Invert(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/client/reducers/demoListDetailReducer.js: -------------------------------------------------------------------------------- 1 | //initialize state 2 | const initialState = { 3 | detail: null 4 | }; 5 | 6 | export default (state = initialState, action) => { 7 | switch (action.type) { 8 | 9 | case 'RECEIVE_DEMO_LISTDETAIL': { 10 | return { ...state, detail: action.payload }; 11 | } 12 | 13 | default: 14 | return state; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /src/client/reducers/demoListReducer.js: -------------------------------------------------------------------------------- 1 | //initialize state 2 | const initialState = { 3 | items: null, 4 | }; 5 | 6 | export default (state = initialState, action) => { 7 | switch (action.type) { 8 | 9 | case 'RECEIVE_DEMO_LIST': { 10 | return { ...state, items: action.payload }; 11 | } 12 | 13 | default: 14 | return state; 15 | } 16 | }; -------------------------------------------------------------------------------- /src/client/reducers/index.js: -------------------------------------------------------------------------------- 1 | import {combineReducers} from 'redux'; 2 | import demoListReducer from './demoListReducer.js'; 3 | import demoListDetailReducer from './demoListDetailReducer.js'; 4 | 5 | export default combineReducers({ 6 | listData: demoListReducer, 7 | listDetailData: demoListDetailReducer 8 | }); -------------------------------------------------------------------------------- /src/client/router/App.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import { 3 | Route, 4 | Switch, 5 | NavLink, 6 | Redirect, 7 | useLocation 8 | } from 'react-router-dom'; 9 | import customRoutesConfig from './RoutesConfig.js'; 10 | 11 | 12 | export default (props) => { 13 | 14 | //Click the route to trigger the event 15 | const theLocation = useLocation(); 16 | React.useEffect(() => { 17 | console.log( 'theLocation(): ', theLocation ); 18 | 19 | //create a style element and append to head 20 | const $style = document.createElement("style"); 21 | document.head.appendChild($style); 22 | $style.innerHTML = ` 23 | nav { 24 | display: block; 25 | margin-bottom: 50px; 26 | } 27 | 28 | nav ul { 29 | list-style: none; 30 | } 31 | 32 | nav li { 33 | float: left; 34 | padding: 1rem 2rem; 35 | } 36 | 37 | nav li a { 38 | color: #2075EF; 39 | text-decoration: none; 40 | font-size: 16px; 41 | text-transform: uppercase; 42 | border: 1px solid rgba(0, 0, 0, 0); 43 | padding: 0.5rem 1rem; 44 | } 45 | 46 | nav li a.active { 47 | background: #F7F6F0; 48 | border: 1px solid #EFE4E5; 49 | padding: 0.5rem 1rem; 50 | } 51 | 52 | nav::after { 53 | content: ""; 54 | display: block; 55 | clear: both; 56 | } 57 | 58 | .content { 59 | display: block; 60 | padding: 15px; 61 | background: #F7F6F0; 62 | border: 1px solid #EFE4E5; 63 | box-shadow: 0px 10px 5px -12px rgb(0 0 0 / 21%); 64 | margin: 10px 70px; 65 | border-radius: 15px; 66 | }`; 67 | 68 | 69 | }); 70 | 71 | 72 | return ( 73 | 74 | 94 | 95 | 96 | 97 | {/* A looks through its children s and 98 | renders the first one that matches the current URL. 99 | The express configuration associated with the file webpack.config.js 100 | */ 101 | /* 102 | 103 | Directly display the content of the homepage component when there is no redirect. 104 | 105 | } 109 | /> 110 | */ 111 | } 112 | 113 | 114 | {/* Set React Router Default Route Redirect to `/index` */} 115 | { 119 | return ( 120 | 121 | ) 122 | }} 123 | /> 124 | 125 | 126 | {/* Loop through an array to create routes in react router` */} 127 | { 128 | customRoutesConfig[0].routes.map((item,index) => { 129 | 130 | return ( 131 | 137 | ); 138 | 139 | }) 140 | } 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | ); 149 | 150 | }; -------------------------------------------------------------------------------- /src/client/router/RoutesConfig.js: -------------------------------------------------------------------------------- 1 | import App from './App.js'; 2 | // 3 | import Home from '../views/_pages/Home/index.js'; 4 | import Posts from '../views/_pages/Posts/index.js'; 5 | import PostDetail from '../views/_pages/Posts/PostDetail.js'; 6 | import Todos from '../views/_pages/Todos/index.js'; 7 | import NoMatch from '../views/_pages/404/index.js'; 8 | import NestedRoutes from '../views/_pages/NestedRoutes/index.js'; 9 | 10 | 11 | const routesConfig = [ 12 | { 13 | component: App, 14 | routes: [ 15 | { 16 | path: "/", 17 | component: Home, 18 | exact: true 19 | }, 20 | 21 | { 22 | path: "/index", 23 | component: Home 24 | }, 25 | 26 | /* 27 | important!! 28 | Fixed: Nested routes not working 29 | Add a new route of /posts/:post_id and add an `exact` property to the current route: 30 | */ 31 | 32 | { 33 | path: "/posts", 34 | component: Posts, 35 | exact: true 36 | }, 37 | { 38 | path: '/todos', 39 | component: Todos 40 | }, 41 | { 42 | path: '/posts/:post_id', 43 | component: PostDetail 44 | }, 45 | 46 | /* In order to make nested routes valid, do not add the exact attribute here */ 47 | { 48 | path: '/nested-routes', 49 | component: NestedRoutes 50 | }, 51 | { 52 | path: '*', 53 | component: NoMatch 54 | } 55 | 56 | ] 57 | } 58 | ]; 59 | 60 | 61 | export default routesConfig; -------------------------------------------------------------------------------- /src/client/router/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BrowserRouter } from 'react-router-dom'; 3 | import { renderRoutes } from 'react-router-config'; 4 | import customRoutesConfig from './RoutesConfig.js'; 5 | 6 | export default () => { 7 | return ( 8 | 9 |
{renderRoutes(customRoutesConfig)}
10 |
11 | ); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /src/client/views/_html/include-footer.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/client/views/_html/include-header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @@{website_title} 6 | 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/client/views/_html/index.html: -------------------------------------------------------------------------------- 1 | 2 | @@include('./src/client/views/_html/include-header.html') 3 | 4 | 5 | 6 | 7 | 8 |
{{reactApp}}
9 | 10 | 11 | @@include('./src/client/views/_html/include-footer.html') -------------------------------------------------------------------------------- /src/client/views/_pages/404/index.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | 3 | export default ({ staticContext = {} }) => { 4 | staticContext.status = 404; 5 | 6 | return ( 7 | 8 | 9 |
10 |

404 - Not found

11 |
12 | 13 | 14 |
15 | ); 16 | }; -------------------------------------------------------------------------------- /src/client/views/_pages/Home/index.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import Button from '@/components/Buttons/index.tsx'; 3 | 4 | 5 | let spreadOperator = { 6 | bgColor: 'info', 7 | btnName: 'Spread Operator', 8 | }; 9 | 10 | 11 | 12 | export default ({ staticContext = {} }) => { 13 | staticContext.status = 200; 14 | 15 | return ( 16 | 17 | 18 |
19 |

This repository is a full-stack sample web application based on React+TypeScript+Babel+Webpack+Jest (+Redux+Express) that creates a simple whole-website architecture with Server-Side Rendering (SSR), and provides the foundational services, components, and plumbing needed to get a basic web application up and running.

20 | 21 |

Component Import:

22 |
29 | 30 | 31 |
32 | ); 33 | }; -------------------------------------------------------------------------------- /src/client/views/_pages/NestedRoutes/NestedRoutesDetail.js: -------------------------------------------------------------------------------- 1 | import React, { Component, Fragment } from 'react'; 2 | import { 3 | useParams, 4 | useLocation 5 | } from 'react-router-dom'; 6 | 7 | import customRoutesConfig from '../../../router/RoutesConfig.js'; 8 | 9 | 10 | 11 | //Might have mismatching versions of React and the renderer (such as React DOM) 12 | function HookScript() { 13 | 14 | // The that rendered this component has a 15 | // path of `/nested-routes/:topicId`. The `:topicId` portion 16 | // of the URL indicates a placeholder that we can 17 | // get from `useParams()`. 18 | let { topicId } = useParams(); 19 | 20 | //Click the route to trigger the event 21 | const theLocation = useLocation(); 22 | React.useEffect(() => { 23 | console.log( 'topicId: ', topicId ); 24 | 25 | }); 26 | 27 | return ( 28 | <> 29 | ) 30 | 31 | } 32 | 33 | 34 | function HookTopicId() { 35 | 36 | 37 | // The that rendered this component has a 38 | // path of `/nested-routes/:topicId`. The `:topicId` portion 39 | // of the URL indicates a placeholder that we can 40 | // get from `useParams()`. 41 | let { topicId } = useParams(); 42 | 43 | return topicId; 44 | } 45 | 46 | 47 | //--- 48 | class NestedRoutesDetail extends Component { 49 | 50 | render() { 51 | 52 | return ( 53 | 54 | 55 | 56 | 57 |

Detail topicId:

58 |
59 | ) 60 | 61 | 62 | } 63 | 64 | } 65 | 66 | export default NestedRoutesDetail; 67 | -------------------------------------------------------------------------------- /src/client/views/_pages/NestedRoutes/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component, Fragment } from 'react'; 2 | import { 3 | Route, 4 | Switch, 5 | NavLink, 6 | useRouteMatch, 7 | useParams 8 | } from 'react-router-dom'; 9 | import customRoutesConfig from '../../../router/RoutesConfig.js'; 10 | 11 | import NestedRoutesDetail from './NestedRoutesDetail.js'; 12 | 13 | 14 | 15 | //Might have mismatching versions of React and the renderer (such as React DOM) 16 | function HookContent() { 17 | 18 | // The `path` lets us build paths that are 19 | // relative to the parent route, while the `url` lets 20 | // us build relative links. 21 | let { path, url } = useRouteMatch(); 22 | 23 | 24 | return ( 25 | 26 | 27 |

Nested Routes Page

28 | 29 |
> click here to display Topic One
30 |
> click here to display Topic Two
31 |
> click here to display Topic Three
32 | 33 |
34 | 35 |
Content:
36 | 37 | 38 | 39 |

None.

40 |
41 | 42 | 43 | 44 |
45 |
46 | ) 47 | 48 | } 49 | 50 | 51 | class NestedRoutes extends Component { 52 | 53 | render() { 54 | 55 | return ( 56 | 57 | 58 | {/* 59 | 61 | */} 62 |
63 | 64 | 65 | 66 |
67 | 68 | 69 |
70 | ); 71 | 72 | } 73 | 74 | } 75 | 76 | export default NestedRoutes; 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/client/views/_pages/Posts/PostItem.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import { NavLink } from 'react-router-dom'; 3 | 4 | export default ({ name, flag }) => { 5 | 6 | return ( 7 | 8 | 9 |
10 | 11 | 12 |

{name}

13 |
14 | 15 |
16 | 17 |
18 | 19 | ); 20 | }; -------------------------------------------------------------------------------- /src/client/views/_pages/Todos/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component, Fragment } from 'react'; 2 | import LoginPage from './LoginPage.js'; 3 | 4 | 5 | class Todos extends Component { 6 | constructor(props) { 7 | 8 | //You are extending the React.Component class, and per the ES2015 spec, 9 | //a child class constructor cannot make use of this until super() has 10 | //been called; also, ES2015 class constructors have to call super() 11 | //if they are subclasses. 12 | super(props); 13 | //console.log(this.props) //props will get logged. 14 | 15 | 16 | } 17 | 18 | 19 | /** 20 | * componentDidMount() is invoked immediately after a component 21 | * is mounted (inserted into the tree). 22 | * Initialization that requires DOM nodes should go here. 23 | * If you need to load data from a remote endpoint, this 24 | * is a good place to instantiate the network request. 25 | */ 26 | componentDidMount() { 27 | //do shmething 28 | 29 | 30 | } 31 | 32 | 33 | render() { 34 | 35 | return ( 36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 |
44 | 45 | ); 46 | } 47 | 48 | } 49 | 50 | export default Todos; -------------------------------------------------------------------------------- /src/server/renderer.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { renderToString } from 'react-dom/server.js'; 3 | import { Provider } from 'react-redux'; 4 | import { StaticRouter } from 'react-router-dom'; 5 | import { renderRoutes } from 'react-router-config'; 6 | import customRoutesConfig from '../client/router/RoutesConfig.js'; 7 | 8 | 9 | //As we can not use BrowserRouter on server side, we will use StaticRouter . 10 | //Also we have same set up as frontend, but wrap it all by renderToString function 11 | //from react-dom/server library. 12 | export default (pathname, store, context, template) => { 13 | const content = renderToString( 14 | 15 | 16 |
{renderRoutes(customRoutesConfig)}
17 |
18 |
19 | ); 20 | 21 | if ( template != null && template != '' && typeof template != typeof undefined ) { 22 | template = template.replace('{{reactApp}}', content ) 23 | .replace('{{preloadedState}}', JSON.stringify(store.getState()) ); 24 | } 25 | 26 | 27 | return template; 28 | 29 | 30 | }; -------------------------------------------------------------------------------- /src/server/server.js: -------------------------------------------------------------------------------- 1 | //In order to ensure the normal compilation function of babel 2 | require( '@babel/register' ); 3 | require( '@babel/polyfill' ); 4 | 5 | //A babel/register style hook to ignore style imports when running in Node when you try to run the project in Node. 6 | require( 'ignore-styles' ).default(['.sass', '.scss']); 7 | 8 | //Remount the code that uses the express service 9 | //!important: Cannot use custom aliases 10 | require( './app.js' ); 11 | -------------------------------------------------------------------------------- /src/store/createStore.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware } from 'redux'; 2 | import thunk from 'redux-thunk'; 3 | import rootReducer from '../client/reducers/index.js'; 4 | 5 | export default () => { 6 | const store = createStore(rootReducer, {}, applyMiddleware(thunk)); 7 | return store; 8 | }; 9 | -------------------------------------------------------------------------------- /test/sum.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Do this as the first thing so that any code reading it knows the right env. 4 | process.env.NODE_ENV = 'test'; 5 | 6 | // Makes the script crash on unhandled rejections instead of silently 7 | // ignoring them. In the future, promise rejections that are not handled will 8 | // terminate the Node.js process with a non-zero exit code. 9 | process.on('unhandledRejection', err => { 10 | throw err; 11 | }); 12 | 13 | 14 | //--- 15 | 16 | function sum(a, b) { 17 | return a + b; 18 | } 19 | 20 | test('1 + 2 = 3', () => { 21 | expect(sum(1, 2)).toBe(3); 22 | }); 23 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "commonjs", 16 | "moduleResolution": "node", 17 | "isolatedModules": true, 18 | "resolveJsonModule": true, 19 | "noEmit": true, 20 | "jsx": "react", 21 | "sourceMap": true, 22 | "declaration": true, 23 | "noUnusedLocals": false, 24 | "noUnusedParameters": false, 25 | "incremental": true, 26 | "noFallthroughCasesInSwitch": true, 27 | "noImplicitAny": false, 28 | "baseUrl": "./src", 29 | "paths": { 30 | "@/components/*": ["client/components/*"] 31 | } 32 | }, 33 | "include": [ 34 | "src/**/*.ts", "src/**/*.tsx" 35 | ], 36 | "exclude": ["node_modules"] 37 | } 38 | --------------------------------------------------------------------------------