> ## Documentation Index
> Fetch the complete documentation index at: https://freelance-4888ed08.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup & Installation

> How to build and run the system

## Prerequisites

* **Docker Desktop** (with Docker Compose)
* **Git**
* **Hardware**: Minimum 8GB RAM recommended

## Installation

**1. Clone & Navigate**

Clone the repository and move to the ML application directory:

```bash theme={null}
git clone https://github.com/CollinsNyatundo/demand-forecasting-system.git
cd demand-forecasting-system/app-ml
```

**2. Configure Secrets**

Create your environment file from the template. **This is critical for Airflow and MinIO security.**

```bash theme={null}
cp .env.template .env
```

> [!TIP]
>
> Edit `.env` to set your `AIRFLOW__SMTP__SMTP_PASSWORD` if you want email alerts enabled.

**3. Launch Core Services**

Start the MLOps stack (Airflow, Model Server, MinIO):

```bash theme={null}
docker-compose up --build -d
```

> [!NOTE]
>
> First launch may take 5-10 minutes to build the optimized Airflow & Model Server images.

**4. Launch Dashboard**

The Analytics UI runs as a separate service. Open a new terminal:

```bash theme={null}
cd ../app-ui
pip install -r requirements.txt
python app.py
```

**5. Verify Installation**

Check that all containers are healthy:

```bash theme={null}
docker-compose ps
```

Then access the services:

* **Airflow Orchestrator**: [http://localhost:8080](http://localhost:8080) (`admin`/`admin`)
* **Analytics Dashboard**: [http://localhost:8050](http://localhost:8050)
* **Prediction API**: [http://localhost:8000/docs](http://localhost:8000/docs)
* **MinIO Storage**: [http://localhost:9001](http://localhost:9001)

## Troubleshooting

**Services fail to start?**

Check if ports `8080`, `8000`, or `5432` are occupied by other applications.

```bash theme={null}
docker-compose logs -f
```

**Email alerts not working?**

Ensure you are using an **App Password** for Gmail, not your login password. Check `.env` settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.