Fabric Analyzer is an AI-powered web application that analyzes fabric
images to provide insightful textual descriptions.
π Features
πΌ Upload your own fabric images or use curated sample images
π Choose between **Short** or **Long** analysis
π€ Powered by Google Gemini Vision API for detailed AI responses
π§ Response caching for fast navigation (Prev/Next)
β
Validates whether uploaded image is a proper fabric image
π§ Drawer and navigation UI for enhanced experience
π€ Upload and record of fabric images and related audios
π Search Similar images through a query
π€ An agentic chatbot for fabric queries and task
π οΈ Tech Stack of Frontend
React
Typescript
css
Prerequisites to use react
->Node.js(v16 or later)
->npm(comes with the node)
π οΈ Tech Stack of Backend
Fastapi
google-generative(gemini-api)
Langchain agents
MCP
Groq
Pillow
base64
π οΈ Tech Stack of Databases
-> MongoDB
π Folder Structure of Frontend
frontend/
βββ public/
β βββ 20250312_224758__10_45_28_PM.jpeg
β βββ 20250323_093907__10_24_31_PM.jpeg
β βββ 20250323_094209__10_22_53_PM.jpeg
β βββ Gemini_Generated_Image_9m5wh59m5wh59m5w.png
β βββ index.html
β βββ manifest.json
β βββ robots.txt
β
βββ src/
β βββ assets/
β βββ components/
β βββ hooks/
β βββ Pages/
β βββ Services/
β βββ utils/
β βββ services/
β
βββ App.css
βββ App.js
βββ App.test.js
βββ index.css
βββ index.js
βββ logo.svg
βββ reportWebVitals.js
βββ setupTests.js
β
π Folder Structure of Backend
backend/
βββ main.py
βββ cli.py
βββ LICENSE-PYTHON
βββ .env
βββ agent/
βββ core/
βββ routes/
βββ services/
βββ static/
βββ templates/
βββ tools/
βββ utils/
βββ pyproject.toml/
βββ README.md/
π API Flow
POST /api/validate-image β Validates if uploaded image is a fabric
POST /api/analyze-image β Runs Gemini analysis (short or long)
POST /api/regenerate β Regenerates response set for same image + mode
POST /api/chat - chatbot
GET /api/assets/images/{filename} - for getting the images
GET /api/assets/audios/{filename} - for getting the audios
GET /api/media/content - for listing the uploaded media
POST /api/search - for searching the similar images
POST /api/submit - for uploading the media
POST /api/uploads/tmp_media - for storing the media in chat
Clone the repo
git clone https://github.com/recursivezero/tz-fabric.git
cd tz-fabricποΈ Backend
cd backend
curl -sSL https://install.python-poetry.org | python3 -
poetry install - to install all the dependencies
poetry run devποΈ Frontend
cd frontend
npm install -> to download the node modules
npm install axios -> for backend integration
npm install react-icons // if react-icons is not installed
npm run devbackend/.env
PORT=8000
GEMINI_API_KEY=""
GRQ_API_KEY=""
MONGODB_URI="mongodb://localhost:27017"
frontend/.env
VITE_API_URL="http://localhost:8000"
πΌοΈ Screenshots
This project is licensed under the terms of the MIT License.










