{"id":29328756,"url":"https://github.com/ssarayu25/crafty-generator","last_synced_at":"2026-04-29T16:36:35.594Z","repository":{"id":303347779,"uuid":"1015162016","full_name":"ssarayu25/crafty-generator","owner":"ssarayu25","description":"AI-powered crochet pattern generator that transforms images and descriptions into detailed crochet patterns","archived":false,"fork":false,"pushed_at":"2025-07-07T05:32:59.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T06:34:30.628Z","etag":null,"topics":["ai","fastapi","gemini-ai","react"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssarayu25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-07T05:16:18.000Z","updated_at":"2025-07-07T05:33:03.000Z","dependencies_parsed_at":"2025-07-07T06:44:45.664Z","dependency_job_id":null,"html_url":"https://github.com/ssarayu25/crafty-generator","commit_stats":null,"previous_names":["ssarayu25/crafty-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ssarayu25/crafty-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssarayu25%2Fcrafty-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssarayu25%2Fcrafty-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssarayu25%2Fcrafty-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssarayu25%2Fcrafty-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssarayu25","download_url":"https://codeload.github.com/ssarayu25/crafty-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssarayu25%2Fcrafty-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273403937,"owners_count":25099299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","fastapi","gemini-ai","react"],"created_at":"2025-07-07T22:37:02.386Z","updated_at":"2026-04-29T16:36:35.557Z","avatar_url":"https://github.com/ssarayu25.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Crafty Generator - AI-Powered Crochet Pattern Generator\n\nTransform your crochet inspiration into detailed patterns using AI. Upload a photo and/or description to get an AI generated crochet pattern, with skill level, estimated time, materials needed, and the pattern instructions.\n\n[![React](https://img.shields.io/badge/React-18%2B-blue)](https://react.dev/)\n[![FastAPI](https://img.shields.io/badge/FastAPI-Latest-green)](https://fastapi.tiangolo.com/)\n[![Python](https://img.shields.io/badge/Python-3.8%2B-yellow)](https://www.python.org/)\n[![AI](https://img.shields.io/badge/AI-Powered-purple)](#)\n\n## Features\n\n- **Dual Input**: Upload images OR describe your project in text\n- **Model trained on 1000+ Patterns**: For accurate results\n- **Smart Analysis**: Automatic difficulty estimation, time estimates, materials extraction\n- **Downloadable**: Clean .txt files with patterns are instantly available for download\n- **Beautiful UI**: Modern React interface with pink/purple theme\n\n##  Quick Start\n\n### Prerequisites\n- [Python 3.8+](https://python.org/downloads) - Programming language for the backend\n- [Node.js 16+](https://nodejs.org/en/download) - JavaScript runtime for the frontend\n- [Git](https://git-scm.com/downloads) - Version control system\n\n### Installation\n\n1. **Clone the repository**\n```bash\ngit clone https://github.com/yourusername/crafty-generator.git\ncd crafty-generator\n```\n\n2. **Set up environment variables**\n\n**Get your Gemini API key:**\n1. Go to [Google AI Studio](https://makersuite.google.com/app/apikey)\n2. Sign in with your Google account\n3. Click \"Create API Key\"\n4. Copy the generated API key\n\n**Create your .env file:**\n```bash\n# Create .env file with your Gemini API key\necho \"GEMINI_API_KEY=your_actual_api_key_here\" \u003e .env\n```\n\n**Important:** Never share your API key or commit it to version control!\n\n## 🔑 Detailed API Key Setup\n\n### Getting Your Gemini API Key\n\n**Step 1: Go to Google AI Studio**\n1. Visit [https://makersuite.google.com/app/apikey](https://makersuite.google.com/app/apikey)\n2. Sign in with your Google account\n\n**Step 2: Create API Key**\n1. Click the **\"Create API Key\"** button\n2. Choose **\"Create API key in new project\"** (recommended)\n3. Your API key will be generated (starts with `AIzaSy`)\n4. **Copy the API key immediately** - you won't be able to see it again!\n\n**Step 3: Set Up Your Environment**\n1. In your project root directory, create a `.env` file:\n```bash\necho \"GEMINI_API_KEY=your_actual_api_key_here\" \u003e .env\n```\n\n2. Replace `your_actual_api_key_here` with your real API key\n\n**Step 4: Verify Setup**\nYour `.env` file should look like this:\n```\nGEMINI_API_KEY=AIzaSy_your_actual_key_here_32_characters_long\n```\n\n### 🔒 Security Best Practices\n\n**✅ DO:**\n- Keep your API key in the `.env` file only\n- Add `.env` to your `.gitignore` file\n- Use environment variables in your code\n- Regenerate your key if it's ever exposed\n\n**❌ DON'T:**\n- Share your API key with anyone\n- Commit your API key to version control\n- Hardcode API keys in your source code\n- Post your API key in forums or chat\n\n### 💰 API Usage \u0026 Costs\n\n**Free Tier Limits:**\n- **15 requests per minute**\n- **1,500 requests per day**\n- **1 million tokens per month**\n\n**Monitoring Usage:**\n1. Go to [Google AI Studio](https://makersuite.google.com/app/apikey)\n2. Click on your API key\n3. View usage statistics\n\n**Cost Management:**\n- Set up billing alerts in Google Cloud Console\n- Monitor your usage regularly\n- The free tier is usually sufficient for development\n\n### 🔄 Regenerating Your API Key\n\nIf your API key is compromised:\n1. Go to [Google AI Studio](https://makersuite.google.com/app/apikey)\n2. Click the trash icon next to your old key\n3. Create a new API key\n4. Update your `.env` file with the new key\n5. Restart your application\n\n3. **Set up the backend**\n```bash\ncd fastapi-template\npython -m venv .venv310\nsource .venv310/bin/activate  # On Windows: .venv310\\Scripts\\activate\npip install -r requirements.txt\n```\n\n4. **Set up the frontend**\n```bash\ncd ../crochet-decoder\nnpm install\n```\n\n5. **Start the application**\n```bash\ncd ..\n./start_yarn_master.sh\n```\n\n## Access Points\n\n- **Frontend**: http://localhost:3000\n- **Backend API**: http://localhost:8000\n- **API Documentation**: http://localhost:8000/docs\n\n## How to Use\n\n### From Homepage:\n1. Click **\"Upload Image\"** for image-based generation\n2. Click **\"Describe Project\"** for text-based generation\n3. Both buttons lead to the same unified interface\n\n### Pattern Generation:\n\n**Method 1: Image Upload**\n1. Select \"Upload Image\" tab (or click \"Upload Image\" from homepage)\n2. Upload a crochet photo\n3. Add optional description for context\n4. Generate pattern\n\n**Method 2: Text Description**\n1. Select \"Text Description\" tab (or click \"Describe Project\" from homepage)\n2. Describe your project in detail\n3. Generate pattern\n\n**Switch Between Modes:**\n- Use the tab buttons to switch between image and text input\n- Both modes available on the same page for convenience\n\n### Pattern Output\n- Materials needed\n- Difficulty level\n- Estimated completion time\n- Step-by-step instructions\n- Downloadable text file\n\n## Project Structure\n\n```\ncrafty-generator/\n├── fastapi-template/          # Backend API\n│   ├── main.py               # FastAPI application\n│   ├── pattern_generator.py  # AI pattern generation\n│   └── requirements.txt      # Python dependencies\n├── crochet-decoder/          # Frontend React app\n│   ├── src/\n│   │   ├── HomePage.js      # Landing page\n│   │   └── FileUpload.js    # Pattern generation interface\n│   └── package.json         # Node dependencies\n├── start_yarn_master.sh     # Startup script\n└── README.md # Full documentation\n```\n\n## API Endpoints\n\n- `POST /generate-pattern` - Generate pattern from image\n- `POST /generate-pattern-from-text` - Generate pattern from text\n- `GET /health` - Health check\n- `GET /models` - Available models and styles\n\n##  AI Technology\n\n- **Base Model**: Gemini AI for pattern generation\n- **Training Data**: 4496+ processed crochet patterns\n- **RAG Pipeline**: Retrieval-Augmented Generation for context\n- **Smart Analysis**: Image processing and pattern intelligence\n\n## Development\n\n### Adding New Features\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Submit a pull request\n\n### Local Development\n```bash\n# Backend\ncd fastapi-template\nsource .venv310/bin/activate\nuvicorn main:app --host 0.0.0.0 --port 8000 --reload\n\n# Frontend\ncd crochet-decoder\nnpm start\n```\n\n## Technical Details\n\n### Architecture\n- **Frontend**: React.js with Tailwind CSS\n- **Backend**: FastAPI (Python)\n- **AI Processing**: Gemini AI with RAG pipeline\n- **Communication**: RESTful API with JSON\n\n### API Examples\n\n**Generate from Text:**\n```bash\ncurl -X POST \"http://localhost:8000/generate-pattern-from-text\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"description\": \"A cozy winter scarf with cable pattern\",\n    \"style\": \"standard\",\n    \"model_type\": \"yarn_master\"\n  }'\n```\n\n**Response Format:**\n```json\n{\n  \"success\": true,\n  \"pattern\": \"CROCHET PATTERN\\n===============\\n...\",\n  \"generation_time\": \"0.05s\",\n  \"materials\": [\"Yarn\", \"Hook\", \"Needle\"],\n  \"difficulty\": \"Beginner\",\n  \"estimated_time\": \"2-4 hours\"\n}\n```\n\n##  Troubleshooting\n\n### Common Issues\n\n**Backend won't start:**\n```bash\ncd fastapi-template\nsource .venv310/bin/activate\npip install -r requirements.txt\n```\n\n**Frontend won't start:**\n```bash\ncd crochet-decoder\nnpm install\nnpm start\n```\n\n**Port conflicts:**\n- Backend uses port 8000\n- Frontend uses port 3000\n- Change ports in startup script if needed\n\n**Pattern generation fails:**\n- Check internet connection\n- Ensure Gemini API key is set in .env file\n- Verify your API key is valid at [Google AI Studio](https://makersuite.google.com/app/apikey)\n- Try refreshing and starting over\n\n**API key issues:**\n- Make sure `.env` file exists in the root directory\n- Check that your API key starts with `AIzaSy`\n- Ensure no extra spaces or quotes around the API key\n- Restart the backend after changing the .env file\n\n##  Usage Tips\n\n### For Best Results\n\n**Image Uploads:**\n- Use clear, well-lit photos\n- Show the full crochet item\n- Include close-ups of stitch details\n- Add descriptive text for context\n\n**Text Descriptions:**\n- Be specific about size (baby blanket, adult scarf, etc.)\n- Mention yarn weight (worsted, DK, etc.)\n- Include style details (cables, lace, solid, etc.)\n- Specify skill level preference\n\n**Example Good Descriptions:**\n- \"A baby blanket in soft pastels with simple stitches, about 30x40 inches\"\n- \"An adult-sized beanie with ribbed brim in chunky yarn\"\n- \"A rectangular table runner with lace edging in cotton yarn\"\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n##  License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n##  Acknowledgments\n\n- Inspired by Harvard's AC215 Yarn Master project\n- Built with FastAPI, React, and Gemini AI\n\n---\n\n**Happy Crocheting! 🧶✨**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssarayu25%2Fcrafty-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssarayu25%2Fcrafty-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssarayu25%2Fcrafty-generator/lists"}