Skip to content

About

πŸ‘• Mobile app to digitise your wardrobe: add clothes from an AI-analysed photo and get Gemini-generated outfits based on the weather and the occasion. React Native (Expo) + FastAPI + MySQL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘• Armario Virtual

Your wardrobe in your pocket: digitise your clothes with a photo and let AI suggest what to wear based on the weather and the occasion.

Armario Virtual ("Virtual Wardrobe") is a mobile app with its own API for managing your personal wardrobe. You can add clothing items by hand or from a photo analysed by AI, check the weather where you are, and build outfits manually or have Gemini generate them from a natural-language description.

React Native Expo Redux Python FastAPI MySQL Gemini Firebase

ℹ️ The app UI, API routes and code are in Spanish (e.g. prendas = clothing items).


πŸ“‘ Table of Contents


πŸŽ₯ Video Demo

TFG.-.Video.demo.-.Trim.mp4
TFG.-.Video.demo.-.Trim2.mp4

✨ Features

  • πŸ” Authentication: sign-up, login and persistent sessions with Firebase Authentication.
  • πŸ‘š Clothing items:
    • Manual entry: name, type, colours, warmth level and elegance level.
    • AI entry: take a photo or pick one from your gallery; it is uploaded to Cloudinary and Gemini analyses it to fill in every field automatically.
  • πŸ§₯ Outfits:
    • Manual creation by combining items from your wardrobe.
    • AI generation: describe the occasion ("dinner with friends", "job interview"...) and the AI picks items from your catalogue, taking the current weather into account.
  • 🌦️ Live weather: the home screen shows the weather at your location (OpenWeatherMap + expo-location).
  • πŸ—‚οΈ Gallery and details: view, edit and delete items and outfits.
  • πŸ‘€ Account: edit your name and sign out.

πŸ€– How the AI Works

All AI features run on Gemini (gemini-2.5-flash-lite by default) with structured output: the model returns JSON that is validated against a Pydantic schema before anything is saved to the database.

Clothing items are rated on two 1–5 scales:

Level Warmth Elegance
1 Very light (> 30 Β°C) Sporty / Loungewear
2 Light (20–25 Β°C) Casual
3 Medium (15–20 Β°C) Smart casual
4 Warm (5–15 Β°C) Semi-formal
5 Very warm (< 5 Β°C) Formal / Black tie
  • Item from image (POST /api/prendas/desde-imagen-ia): Gemini receives the photo and the list of colours in the database, and returns the name, type, colours, warmth level and elegance level.
  • Outfit from text (POST /api/outfits/generar-desde-ia): Gemini receives your description, your clothing catalogue and, if you send coordinates, the temperature and "feels like" temperature. If the description and the weather conflict, the description wins. The chosen items are then checked to make sure they exist and belong to you.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Mobile app (Expo)  β”‚  HTTP  β”‚   FastAPI API        β”‚  ORM   β”‚  MySQL   β”‚
β”‚ React Native + Redux β”‚ ─────▢ β”‚ routers β†’ crud β†’     β”‚ ─────▢ β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚ models / schemas     β”‚        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚ photos                    β”‚        β”‚
           β–Ό                           β–Ό        β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚ Cloudinary β”‚             β”‚  Gemini  β”‚ β”‚ OpenWeatherMap β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Firebase Auth handles sign-in from the app.

πŸ› οΈ Tech Stack

Area Technology
Mobile app React Native 0.81, Expo SDK 54, Expo Router, Redux Toolkit, expo-image-picker, expo-location
Authentication Firebase Authentication
Images Cloudinary
Backend Python, FastAPI, SQLAlchemy 2, Pydantic 2, pydantic-settings
Database MySQL (PyMySQL)
AI Google Gemini (google-genai) with structured JSON output
Weather OpenWeatherMap API
Tests Pytest
Package managers pnpm (frontend), pip (backend)

πŸ”Œ API

Interactive docs (Swagger) at http://localhost:8000/docs.

Resource Endpoints
Users /api/usuarios GET /, GET /{id}, GET /{id}/prendas, GET /{id}/outfits, POST /, PUT /{id}, DELETE /{id}
Items /api/prendas GET /, GET /{id}, POST /, POST /desde-imagen-ia, PUT /{id}, DELETE /{id}
Outfits /api/outfits GET /, GET /{id}, POST /, POST /generar-desde-ia, PUT /{id}, DELETE /{id}
Colours /api/colores GET /, GET /{id}, POST /, PUT /{id}, DELETE /{id}
Weather /api/clima GET /actual?lat=...&lon=...

πŸ“ Project Structure

ArmarioVirtual/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ core/config.py        # Environment variables
β”‚   β”‚   β”œβ”€β”€ database/database.py  # SQLAlchemy engine and session
β”‚   β”‚   β”œβ”€β”€ models/               # User, Item, Outfit, Colour and join tables
β”‚   β”‚   β”œβ”€β”€ schemas/              # Pydantic request/response schemas
β”‚   β”‚   β”œβ”€β”€ crud/                 # Business logic + AI (ia_utils, prenda_ia_crud, outfit_ia_crud)
β”‚   β”‚   β”œβ”€β”€ routers/              # REST endpoints
β”‚   β”‚   └── main.py
β”‚   β”œβ”€β”€ tests/                    # User, item, outfit and colour tests
β”‚   └── requirements.txt
└── frontend/
    β”œβ”€β”€ app/                      # Expo Router routes
    β”‚   β”œβ”€β”€ (tabs)/               # home, items, outfits, account
    β”‚   β”œβ”€β”€ prendas/              # item detail, edit, manual and AI creation
    β”‚   └── outfits/              # outfit detail, edit, manual and AI creation
    └── src/
        β”œβ”€β”€ features/             # auth, home, prendas, outfits, usuarios (api, screens, state)
        β”œβ”€β”€ shared/               # HTTP client, Firebase, Cloudinary, theme, components
        └── store/                # Redux store

πŸš€ Getting Started

Requirements

  • Node.js 18+ and pnpm
  • Python 3.10+
  • A MySQL server
  • Expo Go on your phone, or an emulator (Android Studio / Xcode)
  • API keys for Gemini, OpenWeatherMap, Firebase and Cloudinary

1. Backend

cd backend
python -m venv venv

# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

pip install -r requirements.txt

Create a .env file in backend/:

DATABASE_URL=mysql+pymysql://<user>:<password>@localhost:3306/<database>
GEMINI_API_KEY=<your_gemini_api_key>
GEMINI_MODEL=gemini-2.5-flash-lite
OPENWEATHER_API_KEY=<your_openweather_api_key>

Start the server (tables are created automatically on startup):

uvicorn app.main:app --host 0.0.0.0 --port 8000

Run the tests (they use an in-memory SQLite database, no MySQL needed):

pytest

2. Frontend

cd frontend
pnpm install

Set the variables in a .env file (or in app.json):

EXPO_PUBLIC_BACKEND_URL=http://<BACKEND_LOCAL_IP>:8000
EXPO_PUBLIC_CLOUDINARY_CLOUD_NAME=<your_cloud_name>
EXPO_PUBLIC_CLOUDINARY_UPLOAD_PRESET=<your_upload_preset>
EXPO_PUBLIC_CLOUDINARY_UPLOAD_FOLDER=<your_upload_folder>

EXPO_PUBLIC_FIREBASE_API_KEY=<your_firebase_api_key>
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=<your_firebase_auth_domain>
EXPO_PUBLIC_FIREBASE_PROJECT_ID=<your_firebase_project_id>
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=<your_firebase_storage_bucket>
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=<your_firebase_messaging_sender_id>
EXPO_PUBLIC_FIREBASE_APP_ID=<your_firebase_app_id>

Start the app and scan the QR code with Expo Go (Android) or the Camera app (iOS):

pnpm start

πŸ’‘ Use your computer's local IP in EXPO_PUBLIC_BACKEND_URL (not localhost) so your phone can reach the backend.


Made by Francisco RamΓ­rez CaΓ±adas

About

πŸ‘• Mobile app to digitise your wardrobe: add clothes from an AI-analysed photo and get Gemini-generated outfits based on the weather and the occasion. React Native (Expo) + FastAPI + MySQL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages