This is the backend for StylistExpert, a robust, rule-based expert system for fashion recommendations, built with FastAPI and Python.
- Intelligent Recommendations: Rule-based expert system with forward chaining inference
- Comprehensive API: Accepts detailed user profiles, returns tailored advice
- Test Suite: Pytest-based tests for rules and API endpoints
- FastAPI (API framework)
- Python 3.10+
- Pydantic (data validation)
- Pytest (testing)
-
Navigate to the backend directory:
cd backend -
Install dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
- Interactive docs:
/docs - Alternative docs:
/redoc
- Interactive docs:
python -m pytest test_engine.py -vGet personalized fashion recommendations.
Request Example:
{
"gender": "female",
"occasion": "formal",
"weather": "mild",
"body_type": "athletic",
"preferred_style": "classic",
"color_preference": "neutral",
"height": "average"
}Response Example:
{
"recommendations": [
{
"title": "Elegant Sheath Dress or Blazer Suit",
"items": ["Sheath dress or tailored blazer and trousers", "Heels or loafers", "Delicate jewelry"],
"explanation": "A structured dress or blazer suit projects confidence and works well for formal settings.",
"images": ["https://source.unsplash.com/800x600/?women,formal,dress"],
"confidence": 0.95,
"matched_rules": ["R2"]
}
]
}- 12+ rules for various fashion scenarios:
- Formal, casual, special events, athletic, body type, weather, style preferences
- Rules Engine: Forward chaining, confidence scoring, rule merging, fallback system
- API: FastAPI endpoints for recommendations
backend/
├── main.py # FastAPI app & rules engine
├── test_engine.py # Test suite
└── requirements.txt
- Static rule base (no ML adaptation)
- Limited cultural/regional diversity
- Basic image sourcing from Unsplash
- No real-time trend integration
Planned:
- Machine learning integration
- Computer vision outfit analysis
- Social/sharing features
- Shopping integration
- Personalization engine
- AR/VR try-on
This project is licensed under the MIT License. See the LICENSE file for details.
Nduoma Chinomso Christian
AKA Buzz Brain
Built with ❤️ for fashion lovers everywhere.