# Setting Up a Local Environment to Run GTP This document serves as a guide to setup a local environment in Windows 10 to run EY's Global Tax Platform. **Note:** For this guide, everything that goes after `$` is an executable command. Commands start after `$` so this symbol does not be considered as a part of the command syntax. ## Recommended Hardware Specs - RAM: 32 GB - CPU: Intel Core i7 2.60 GHz - Hard Drive: 500 GB GB ## Pre Requirements - Windows 10 - Git ## Pre Setup Steps 1. Install latest version of Node Version Manager (NVM). To install [click here](https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-setup.exe). 2. Use NVM to install NodeJS version 14.17.5. ``` $ nvm install 14.17.5 ``` 3. Use default version of Node Package Manager (NPM) to install NPM version 6.14.14. ``` $ npm install -g npm@6.14.14 ``` ## Setup Steps 1. Create a new directory directly in C:\ (ex: C:\GTPfrontend) and move into that directory. 2. Clone the [web-workspace repository](https://eyglobaltaxplatform.visualstudio.com/Global%20Tax%20Platform/_git/web-workspace) using https to avoid needing to setup an SSH key. ``` $ git clone https://eyglobaltaxplatform.visualstudio.com/Global%20Tax%20Platform/_git/web-workspace ``` 3. Run the following command to install the latest Angular-CLI globally: ``` $ npm install @angular/cli -g ``` 4. Run the following command to install the latest Nx-CLI globally: ``` $ npm install @nrwl/cli -g ``` 5. Run the following command to install the wsts-npm-auth package: ``` $ npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false ``` 6. Move into the repository path web-workspace\src. ``` $ cd web-workspace\src ``` 7. Run the following command to setup npm authentication: ``` $ vsts-npm-auth -config .npmrc ``` 8. Install all project dependencies. **Note:** GTP is a very heavy project, therefore this installation may take anywhere between 20 minutes to around 1 hour (could even be more) depending on internet connection and computer performance. ``` $ npm install ``` 9. Still in web-workspace\src, run the local server **Note:** Building GTP, especially the first time, could take anywhere between 20 to 40 minutes (could be more); not dependant on internet connection. ``` $ npm run serve ``` 10. Open localhost in a browser on port indicated in npm console, default port is 4200 (http://localhost:4200/). ## Troubleshooting - If there happens to be a memory related issue after running the `$ npm run serve` command, try the following steps: - Open the file `src\package.json` - Go to line 7 - Change `--max_old_space_size=16384` value to 4096 (`--max_old_space_size=4096`) or any value that your RAM capacity allows you. - Run `$ npm run serve` command again. ## EY Wiki Pages as Additional Resources - [Global Tax Platform - ReadMe](https://eyglobaltaxplatform.visualstudio.com/Global%20Tax%20Platform/_wiki/wikis/Web%20Workspace/8716/README) - [Tips & Tricks for the GTP Web Portal UI](https://eyglobaltaxplatform.visualstudio.com/defaultcollection/Global%20Tax%20Platform/_wiki/wikis/Global-Tax-Platform.wiki/12473/Tips-Tricks-for-the-GTP-Web-Portal-UI?anchor=set-apigee-key-in-.env.local-file)