# Project Setup Instructions

## Prerequisites
Ensure you have the following installed:
- Node.js (install via [nvm](https://github.com/nvm-sh/nvm) to manage multiple versions)
- npm (comes with Node.js)
- PhpStorm or your preferred IDE
- Google Chrome (for extensions)

## Setting Up Your Development Environment

### Node Version Management
1. **Install nvm**:
    - Follow the instructions at [nvm GitHub page](https://github.com/nvm-sh/nvm).
    - Reload your terminal after installation.

2. **Set Node version for the project**:
    - Navigate to your project root.
    - Run `nvm install node` to install the latest version of Node.js.
    - Execute `nvm use` to switch to the project's Node version.

### IDE Configuration
1. **Configure PhpStorm Encoding**:
    - Press `Ctrl + Shift + S`.
    - Navigate to `Editor` -> `File Encodings`.
    - Set "Project Encoding" to `UTF-8`.
    - Click `Apply`.

### Dependency Management
1. **Install project dependencies**:
    - Run `npm install` in the project root.

### Development Tools
1. **Install Chrome Extensions**:
    - [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools)
    - [Redux DevTools](https://chrome.google.com/webstore/detail/redux-devtools)
    - [Moesif Origin & CORS Changer](https://chrome.google.com/webstore/detail/moesif-origin-cors-change) (specific version v.91.0.4472.164) to fix CORS errors locally. Restart your computer after installation.

## Running and Building the Project
1. **Start a local development server**:
    - Run `npm run start`.

2. **Build the project for deployment**:
    - Run `npm run build`.

## Deployment with Deployer
### Requirements
- PHP 8.2.*
- cURL

### Commands
1. **Install PHP dependencies**:
    - Run `composer install`

2. **Deploying**:
    - Available environments: dev, qa, candidate, prod.
    - Deploy to a specific environment using `./vendor/bin/dep deploy stage=ENV --branch=BRANCH_NAME -p -vvv`

3. **Rollback**:
    - Rollback in preprod environment with `./vendor/bin/dep rollback stage=ENV -p -vvv`

## Additional Libraries
- **react-infinite-scroll-component**:
    - `throttle-debounce`
- **react-svg-star-rating**:
    - `classnames`
    - `lodash`
    - `prettier`

## Notes
- There is no server-side Node.js, as it is a static web app built with React. Node.js is used to install and manage npm libraries.
