Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

Nico769/mir-challenge

Repository files navigation

MIR Challenge

A FastAPI service for generating fashion outfit images using Ollama based on users preferences ingested via Apache Airflow for data processing.

Prerequisites

Before getting started, ensure you have:

  • Docker & Docker Compose
  • Python 3.14+
  • Ollama - Running with the x/flux2-klein:4b model pulled

Project Structure

fastapi-test/
├── app/                         # FastAPI application
│   ├── main.py                  # App entry point
│   ├── models.py                # SQLAlchemy ORM models
│   ├── api/
│   │   └── routers/
│   │       ├── users.py             # User endpoints
│   │       └── generate_images.py   # Image generation endpoints
│   └── core/
│       ├── config.py            # App config
│       ├── db.py                # PostgreSQL db setup
│       └── __init__.py
├── dags/                        # Apache Airflow DAGs
│   ├── create_staging_tables.py
│   └── files/
│       └── gen_fake_outfit_profiles.py  # Test data generator
├── docker-compose.yaml      
├── Dockerfile     
├── requirements.txt  
└── README.md

Quick Start

1. Clone & Setup Environment

git clone https://github.com/Nico769/mir-challenge.git
cd fastapi-test
cp env.sample .env

Edit .env with your local settings.

2. Initialize Airflow

Follow this guide for setting up Airflow through Docker in local

3. Configure Airflow Database Connection

  1. Make sure Airflow is running and go to Airflow UI → Admin → Connections
  2. Create new connection:
    • Connection ID: postgres_default
    • Connection Type: PostgreSQL
    • Host: postgres
    • Database: airflow
    • Login/Password: airflow
  3. Test & Save

4. Generate Test Data

python dags/files/gen_fake_outfit_profiles.py

5. Add Test Users

Connect to PostgreSQL and add users matching user_outfit_profiles table IDs:

docker compose exec postgres psql -U admin -d airflow -c \
  "INSERT INTO users (id) VALUES (1);"

6. Trigger Airflow DAG

  1. In Airflow UI, locate process_user_outfit_profiles DAG
  2. Click play icon to trigger it
  3. Monitor execution in the DAG details view

7. Start FastAPI service, PostgreSQL, and Airflow containers

docker compose up --build

8. Test the API

  1. Make sure Ollama is running
  2. Go to http://localhost:8080/docs to access FastAPI Swagger UI.

License

See LICENSE for details.

About

A FastAPI service for generating fashion outfit images using Ollama based on users preferences ingested via Apache Airflow for data processing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors