FigmaChain  by cirediatpl

Python scripts for HTML/CSS generation from Figma designs

created 2 years ago
974 stars

Top 38.7% on sourcepulse

GitHubView on GitHub
Project Summary

FigmaChain provides Python scripts to convert Figma designs into HTML/CSS code using OpenAI's GPT-3. It targets developers seeking to accelerate front-end development by automating the translation of visual designs into functional code, offering both a direct generation script and an interactive chatbot interface.

How It Works

The project leverages the Figma RESTful API to fetch design data, specifically node IDs and file keys, along with an OpenAI API key. It then uses GPT-3, orchestrated via LangChain, to interpret the design elements and generate corresponding HTML and CSS. This approach aims to reduce manual coding effort by translating visual specifications into structured code.

Quick Start & Requirements

  • Install: pip install openai langchain streamlit dotenv
  • Prerequisites: Python 3.6+, OpenAI API key, Figma access token, Figma node IDs, Figma file key. All API keys and tokens must be set as environment variables.
  • Usage:
    • Direct generation: python generateCode.py "your input text"
    • Chatbot: streamlit run chatbot.py
  • Documentation: Figma help center for access tokens

Highlighted Details

  • Generates HTML/CSS code from Figma designs.
  • Includes a Streamlit-based chatbot for interactive code generation.
  • Saves generated code to output.html and opens it in the browser.

Maintenance & Community

The project is open-source with no specific mention of maintainers, sponsors, or community channels in the provided README.

Licensing & Compatibility

  • License: MIT License
  • Compatibility: The MIT license permits commercial use and integration with closed-source projects.

Limitations & Caveats

The effectiveness of the generated code is dependent on the quality of the GPT-3 model's interpretation of the Figma design data and the clarity of the input prompts. The project requires significant setup with multiple API keys and environment variables.

Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

screenshot-to-code by abi

0.1%
70k
Screenshot-to-code tool for generating code from visual inputs
created 1 year ago
updated 6 days ago
Feedback? Help us improve.