{"id":68,"date":"2024-08-13T08:08:53","date_gmt":"2024-08-13T08:08:53","guid":{"rendered":"https:\/\/research.binus.ac.id\/geoecoai\/?p=68"},"modified":"2024-08-21T15:54:16","modified_gmt":"2024-08-21T15:54:16","slug":"install-and-setup-react","status":"publish","type":"post","link":"https:\/\/research.binus.ac.id\/geoecoai\/2024\/08\/13\/install-and-setup-react\/","title":{"rendered":"1. Install and Setup React"},"content":{"rendered":"<h3 class=\"ud-heading-xxl text-viewer--main-heading--pPafb\">Installing Visual Studio Code<\/h3>\n<p class=\"ud-heading-xxl text-viewer--main-heading--pPafb\"><strong>If you have Visual Studio Code or an IDE you are comfortable using, feel free to skip to the next lesson.<\/strong><\/p>\n<div class=\"article-asset--container--IvjZK\">\n<div class=\"article-asset--content--H92b2 rt-scaffolding\" data-purpose=\"safely-set-inner-html:rich-text-viewer:html\">\n<p>If you are new to coding, I recommend you download and install Visual Studio Code. In this course, I will be using VS Code as the IDE for the code along videos. You can\u00a0<a href=\"https:\/\/code.visualstudio.com\/download\" target=\"_blank\" rel=\"noopener noreferrer\">download it for your particular operating system here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<h3>Installation NodeJs<\/h3>\n<p>Before you can work with the project, you need to have Node.js installed on your computer. Node.js is a JavaScript runtime that allows you to run JavaScript code on the server side. It also comes with npm (Node Package Manager), which is used to manage dependencies for your project.<\/p>\n<h4>a. Download and Install Node.js<\/h4>\n<ol>\n<li>Go to the <a href=\"https:\/\/nodejs.org\/\" target=\"_new\" rel=\"noopener\">Node.js download page<\/a>.<\/li>\n<li>Choose the LTS (Long Term Support) version for stability.<\/li>\n<li>Download the installer appropriate for your operating system (Windows, macOS, or Linux).<\/li>\n<li>Run the installer and follow the on-screen instructions. The installer will also install npm.<\/li>\n<\/ol>\n<h4>b. Verify the Installation<\/h4>\n<p>After installing Node.js, verify that it has been installed correctly by opening a terminal or command prompt and running the following commands:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">    node -v<\/code><\/div>\n<\/div>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">    npm -v<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><\/code><code class=\"!whitespace-pre hljs language-bash\"><\/code><\/div>\n<\/div>\n<p>These commands will display the installed versions of Node.js and npm, respectively.<\/p>\n<h3>Cloning the Repository and Setting Up the React Frontend<\/h3>\n<p>In this section, you&#8217;ll learn how to clone the <code>Geobee-ICCSCI<\/code> repository and set up the React frontend application using <code>npm ci<\/code>. This process involves downloading the project files, navigating to the project directory, installing dependencies, and running the application locally.<\/p>\n<p>GitHub Repository: <a href=\"https:\/\/github.com\/syauqiakmal\/Geobee-ICCSCI\">Geobee_Dashboard<\/a><\/p>\n<h4>1. Clone the Repository<\/h4>\n<p>First, clone the Geobee_Dashboard repository to your local directory:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">    git <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/syauqiakmal\/Geobee-ICCSCI.git<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"> <\/code><\/div>\n<\/div>\n<p>This will download the entire repository into a folder named <code>Geobee-ICCSCI<\/code>.<\/p>\n<h4>2. Navigate to the Project Directory<\/h4>\n<p>Once the repository is cloned, navigate into the project directory:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><span class=\"hljs-built_in\">    cd<\/span> Geobee-ICCSCI\/react-app<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><br \/>\n<\/code><\/div>\n<\/div>\n<h4>3. Install Node Modules Using <code>npm ci<\/code><\/h4>\n<p>Instead of using <code>npm install<\/code>, we will use <code>npm ci<\/code> to install the dependencies. This command installs the exact versions of packages listed in the <code>package-lock.json<\/code> file, ensuring consistency across environments.<\/p>\n<p>Run the following command:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">    npm ci<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><br \/>\n<\/code><\/div>\n<\/div>\n<p>This command will clean the previous <code>node_modules<\/code> (if any) and install all the dependencies based on the <code>package-lock.json<\/code> file. It&#8217;s faster and ideal for CI\/CD environments or development setups that require guaranteed consistency in dependencies.<\/p>\n<h4>4. Running the Application<\/h4>\n<p>After the installation is complete, run the React application with:<\/p>\n<div class=\"dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">    npm start<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><br \/>\n<\/code><\/div>\n<\/div>\n<p>The app will run on a local server, and you can access it in your browser at <code>http:\/\/localhost:3000<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Visual Studio Code If you have Visual Studio Code or an IDE you are comfortable using, feel free to skip to the next lesson. If you are new to coding, I recommend you download and install Visual Studio Code. In this course, I will be using VS Code as the IDE for the code [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":85,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-frontend"],"_links":{"self":[{"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":15,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/posts\/68\/revisions\/260"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/media\/85"}],"wp:attachment":[{"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/research.binus.ac.id\/geoecoai\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}