{"id":36,"date":"2019-09-25T04:28:58","date_gmt":"2019-09-25T04:28:58","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/reactify\/?page_id=36"},"modified":"2019-10-10T07:18:22","modified_gmt":"2019-10-10T07:18:22","slug":"installation","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/reactify\/installation\/","title":{"rendered":"Installation"},"content":{"rendered":"\n<h4 id=\"installation-prerequisites\">Installation prerequisites:<a href=\"#installation-prerequisites\"><\/a><\/h4>\n\n\n\n<ol><li><strong>Install Node.js and NPM :<\/strong> Download Node.js from official <a rel=\"noreferrer noopener\" href=\"https:\/\/nodejs.org\/en\/download\/\" target=\"_blank\">website<\/a>  and install it on your system. <strong>Reactify works well with Node.js 10.x <\/strong>. NPM comes bundled with Node.js.<\/li><li><strong>Install NPM packages : <\/strong>Once you install node on your system, open terminal or command prompt on your system, go to your project root directory &amp; run the following command, it will download all the dependencies under node_modules folder. Please wait for it to finish.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install <\/pre>\n\n\n\n<blockquote class=\"wp-block-quote blockquote-warning\"><p><strong>Before starting development server please make sure you have copied all the project files including hidden files too like .babelrc and .eslintrc <\/strong><\/p><\/blockquote>\n\n\n\n<h5 id=\"running-development-server\">Running development server :<a href=\"#running-development-server\"><\/a><\/h5>\n\n\n\n<p>Run following command to run dev server, wait for it to finish and once it finishes access <a rel=\"noreferrer noopener\" href=\"http:\/\/localhost:3000\/\" target=\"_blank\"><code>http:\/\/localhost:3000\/<\/code><\/a> to run your app\/project on browser. The app will automatically reload if you make any changes in any of the source file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm start<\/pre>\n\n\n\n<h5 id=\"production-building\">Production building:<a href=\"#production-building\"><\/a><\/h5>\n\n\n\n<p>Run following command to build the project and wait for it to finish. The build will be stored in the <code>dist\/<\/code> directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm run build<\/pre>\n\n\n\n<h4 id=\"making-a-production-build-in-different-folder-sub-directory\">Making a Production Build in Different Folder(Sub-Directory):<a href=\"#making-a-production-build-in-different-folder-sub-directory\"><\/a><\/h4>\n\n\n\n<p>If you want to make your production build in different folder or sub directory. Like, if you want that the template run on the <code>test.com\/dist<\/code> rather then <code>test.com<\/code> then you need to follow the steps given below:<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Open <code>.webpack.config.js<\/code> file and search for <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const publicPath = '\/'; <\/pre>\n\n\n\n<p>and set your path as per requirement like: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const publicPath = '\/dist\/'; <\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> Now go to <code>src&gt;App.js<\/code> file and set the <code>Router basename<\/code> to <code>dist<\/code> like following code: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;Router basename={'\/dist'}&gt;<br>    &lt;Switch&gt;<br>         &lt;Route path=\"\/\" component={App} \/&gt;<br>    &lt;\/Switch&gt;<br>&lt;\/Router&gt;  <\/pre>\n\n\n\n<p><strong>Step 3:<\/strong> Open <code>.htaccess<\/code> file and set the roots for subdirectory: We have added the screenshot for the <code>.htaccess<\/code> file location and also the code of the file.\n\n<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"461\" height=\"228\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/htaccess.png\" alt=\"\" class=\"wp-image-37\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/htaccess.png 461w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/htaccess-300x148.png 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><figcaption>.htaccess File <\/figcaption><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\"># To be inside the \/Directory<br> <br>&lt;IfModule mod_rewrite.c&gt;<br>    RewriteEngine On<br>    RewriteBase \/dist\/<br>    RewriteRule ^index\\.html$ - [L]<br>    RewriteCond %{REQUEST_FILENAME} !-f<br>    RewriteCond %{REQUEST_FILENAME} !-d<br>    RewriteRule . \/dist\/index.html [L]<br>&lt;\/IfModule&gt; <\/pre>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"36\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">3    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"36\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\">2<\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Installation prerequisites: Install Node.js and NPM : Download Node.js from official website and install it on your system. Reactify works well with Node.js 10.x . NPM comes bundled with Node.js. Install NPM packages : Once you install node on your system, open terminal or command prompt on your system, go to your project root directory [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/36"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":6,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/36\/revisions"}],"predecessor-version":[{"id":358,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/36\/revisions\/358"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/media?parent=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}