{"id":13441266,"url":"https://github.com/abi/screenshot-to-code","last_synced_at":"2025-05-12T18:44:52.810Z","repository":{"id":207237770,"uuid":"718741813","full_name":"abi/screenshot-to-code","owner":"abi","description":"Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)","archived":false,"fork":false,"pushed_at":"2025-04-23T18:40:55.000Z","size":3152,"stargazers_count":69652,"open_issues_count":123,"forks_count":8593,"subscribers_count":414,"default_branch":"main","last_synced_at":"2025-04-24T00:39:09.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://screenshottocode.com","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/abi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["abi"]}},"created_at":"2023-11-14T17:53:32.000Z","updated_at":"2025-04-23T22:13:07.000Z","dependencies_parsed_at":"2024-01-29T19:12:55.442Z","dependency_job_id":"415d3cb4-1091-4987-af1c-41e2cc0b9b85","html_url":"https://github.com/abi/screenshot-to-code","commit_stats":null,"previous_names":["abi/screenshot-to-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abi%2Fscreenshot-to-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abi%2Fscreenshot-to-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abi%2Fscreenshot-to-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abi%2Fscreenshot-to-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abi","download_url":"https://codeload.github.com/abi/screenshot-to-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252526429,"owners_count":21762502,"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","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":[],"created_at":"2024-07-31T03:01:31.781Z","updated_at":"2025-05-05T15:50:48.033Z","avatar_url":"https://github.com/abi.png","language":"Python","readme":"# screenshot-to-code\n\nA simple tool to convert screenshots, mockups and Figma designs into clean, functional code using AI. Now supporting Claude Sonnet 3.7!\n\nhttps://github.com/abi/screenshot-to-code/assets/23818/6cebadae-2fe3-4986-ac6a-8fb9db030045\n\nSupported stacks:\n\n- HTML + Tailwind\n- HTML + CSS\n- React + Tailwind\n- Vue + Tailwind\n- Bootstrap\n- Ionic + Tailwind\n- SVG\n\nSupported AI models:\n\n- Claude Sonnet 3.7 - Best model!\n- GPT-4o - also recommended!\n- DALL-E 3 or Flux Schnell (using Replicate) for image generation\n\nSee the [Examples](#-examples) section below for more demos.\n\nWe also just added experimental support for taking a video/screen recording of a website in action and turning that into a functional prototype.\n\n![google in app quick 3](https://github.com/abi/screenshot-to-code/assets/23818/8758ffa4-9483-4b9b-bb66-abd6d1594c33)\n\n[Learn more about video here](https://github.com/abi/screenshot-to-code/wiki/Screen-Recording-to-Code).\n\n[Follow me on Twitter for updates](https://twitter.com/_abi_).\n\n## 🌍  Hosted Version\n\n[Try it live on the hosted version (paid)](https://screenshottocode.com).\n\n## 🛠 Getting Started\n\nThe app has a React/Vite frontend and a FastAPI backend.\n\nKeys needed:\n\n- [OpenAI API key with access to GPT-4](https://github.com/abi/screenshot-to-code/blob/main/Troubleshooting.md) or Anthropic key (optional)\n- Both are recommended so you can compare results from both Claude and GPT4o\n\nIf you'd like to run the app with Ollama open source models (not recommended due to poor quality results), [follow this comment](https://github.com/abi/screenshot-to-code/issues/354#issuecomment-2435479853).\n\nRun the backend (I use Poetry for package management - `pip install poetry` if you don't have it):\n\n```bash\ncd backend\necho \"OPENAI_API_KEY=sk-your-key\" \u003e .env\necho \"ANTHROPIC_API_KEY=your-key\" \u003e .env\npoetry install\npoetry shell\npoetry run uvicorn main:app --reload --port 7001\n```\nYou can also set up the keys using the settings dialog on the front-end (click the gear icon after loading the frontend).\n\nRun the frontend:\n\n```bash\ncd frontend\nyarn\nyarn dev\n```\n\nOpen http://localhost:5173 to use the app.\n\nIf you prefer to run the backend on a different port, update VITE_WS_BACKEND_URL in `frontend/.env.local`\n\nFor debugging purposes, if you don't want to waste GPT4-Vision credits, you can run the backend in mock mode (which streams a pre-recorded response):\n\n```bash\nMOCK=true poetry run uvicorn main:app --reload --port 7001\n```\n\n## Docker\n\nIf you have Docker installed on your system, in the root directory, run:\n\n```bash\necho \"OPENAI_API_KEY=sk-your-key\" \u003e .env\ndocker-compose up -d --build\n```\n\nThe app will be up and running at http://localhost:5173. Note that you can't develop the application with this setup as the file changes won't trigger a rebuild.\n\n## 🙋‍♂️ FAQs\n\n- **I'm running into an error when setting up the backend. How can I fix it?** [Try this](https://github.com/abi/screenshot-to-code/issues/3#issuecomment-1814777959). If that still doesn't work, open an issue.\n- **How do I get an OpenAI API key?** See https://github.com/abi/screenshot-to-code/blob/main/Troubleshooting.md\n- **How can I configure an OpenAI proxy?** - If you're not able to access the OpenAI API directly (due to e.g. country restrictions), you can try a VPN or you can configure the OpenAI base URL to use a proxy: Set OPENAI_BASE_URL in the `backend/.env` or directly in the UI in the settings dialog. Make sure the URL has \"v1\" in the path so it should look like this: `https://xxx.xxxxx.xxx/v1`\n- **How can I update the backend host that my front-end connects to?** - Configure VITE_HTTP_BACKEND_URL and VITE_WS_BACKEND_URL in front/.env.local For example, set VITE_HTTP_BACKEND_URL=http://124.10.20.1:7001\n- **Seeing UTF-8 errors when running the backend?** - On windows, open the .env file with notepad++, then go to Encoding and select UTF-8.\n- **How can I provide feedback?** For feedback, feature requests and bug reports, open an issue or ping me on [Twitter](https://twitter.com/_abi_).\n\n## 📚 Examples\n\n**NYTimes**\n\n| Original                                                                                                                                                        | Replica                                                                                                                                                         |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \u003cimg width=\"1238\" alt=\"Screenshot 2023-11-20 at 12 54 03 PM\" src=\"https://github.com/abi/screenshot-to-code/assets/23818/3b644dfa-9ca6-4148-84a7-3405b6671922\"\u003e | \u003cimg width=\"1414\" alt=\"Screenshot 2023-11-20 at 12 59 56 PM\" src=\"https://github.com/abi/screenshot-to-code/assets/23818/26201c9f-1a28-4f35-a3b1-1f04e2b8ce2a\"\u003e |\n\n**Instagram page (with not Taylor Swift pics)**\n\nhttps://github.com/abi/screenshot-to-code/assets/23818/503eb86a-356e-4dfc-926a-dabdb1ac7ba1\n\n**Hacker News** but it gets the colors wrong at first so we nudge it\n\nhttps://github.com/abi/screenshot-to-code/assets/23818/3fec0f77-44e8-4fb3-a769-ac7410315e5d\n","funding_links":["https://github.com/sponsors/abi"],"categories":["Python","AI Agent","TypeScript","others","前端开发框架及项目","⚡ Productivity","前端开发","HarmonyOS","NLP","CTF Content Creation","Repos","精选文章","App Builders","Table of Open-Source AI Agents Projects","Uncategorized","search engine"],"sub_categories":["Task","其他_文本生成、文本对话","Resources","Windows Manager","3. Pretraining","GPT-LLMs应用","Uncategorized","collection"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabi%2Fscreenshot-to-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabi%2Fscreenshot-to-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabi%2Fscreenshot-to-code/lists"}