A digital AI asistant for African tailoring workshops
# StitchFlow Backend
## π Project Structure
StitchFlow/
β
βββ backend/ β Main backend application
β βββ main.py β Entry point (FastAPI app starts here)
β βββ __init__.py β Marks folder as a Python package
β β
β βββ api/ β API routes/endpoints
β β βββ routes.py β Defines REST endpoints (e.g., /process)
β β βββ __init__.py
β β
β βββ core/ β Core backend logic (configs, helpers)
β β βββ __init__.py
β β
β βββ services/ β Business logic and services
β βββ __init__.py
β βββ ai/ β AI-related modules
β βββ agent.py β Main StitchFlowAgent class
β βββ tools.py β Utility functions
β βββ measurement_extractor.py β Extracts measurements
β βββ fabric_logic.py β Fabric calculation logic
β βββ image_handler.py β Image processing
β βββ chat_services.py β Chat-related logic
β βββ voice.py β Voice input/output
β βββ __init__.py
β
βββ frontend/ β Frontend assets
β βββ static/ β CSS, JS, images
β βββ templates/ β HTML templates (Jinja2)
β
βββ requirements.txt β Python dependencies
## π Setup Instructions
1. **Clone the repository**
```bash
git clone
cd StitchFlow
## π Install Dependencies
From the project root (`StitchFlow/`):
pip install -r requirements.txt
## π Running the sever
From the project root (`StitchFlow/`):
uvicorn backend.main:app --reload
- The backend will start at:
127.0.0.1
- Static files are served at:
127.0.0.1 (127.0.0.1 in Bing)
- Templates are rendered via FastAPI routes.
π API Endpoints
- GET / β Loads the homepage (index.html) with a connection message.
- POST /process β Accepts user commands, parses them with StitchFlowAgent, and returns structured data.
π§© Key Components
- backend/main.py β S β¦