# Development Guide

This guide provides instructions for building, running, and testing the IGP Fan Reference project.

## Prerequisites
- [.NET 8.0 or 10.0 SDK](https://dotnet.microsoft.com/download)
- [PowerShell](https://github.com/PowerShell/PowerShell) (for running scripts)
- [Node.js](https://nodejs.org/) (required for Playwright tests)

## Getting Started

1.  **Clone the repository**:
    ```bash
    git clone <repository-url>
    cd IGP-Fan-Reference
    ```

2.  **Restore dependencies**:
    ```bash
    dotnet restore
    ```

3.  **Run the application**:
    Navigate to the `IGP` project folder and run:
    ```bash
    cd IGP
    dotnet watch run
    ```
    The application will be available at `https://localhost:5001` (or the port specified in your output).

## Running Tests

The project uses **Playwright** for E2E testing, located in the `TestAutomation` project.

1.  **Install Playwright browsers**:
    ```bash
    dotnet build TestAutomation
    pwsh TestAutomation/bin/Debug/net8.0/playwright.ps1 install
    ```

2.  **Execute tests**:
    ```bash
    dotnet test TestAutomation
    ```

## Project Structure and Maintenance

- **Adding a new Unit/Building**: Update the `Entity` models and data providers in the `Model` project.
- **Modifying UI**: Most common UI elements are in the `Components` library or the `IGP/Pages` directory.
- **Business Logic**: Changes to game mechanics or calculations should be made in `Services.Immortal`.

## Deployment

The site is configured as a Static Web App. Deployment settings can be found in `staticwebapp.config.json` and the `.github/workflows` directory for automated CI/CD.
