word-to-code / README.md
tinazone's picture
Upload 44 files
21d7fc3 verified
|
raw
history blame
3.35 kB

Word to Code

Hugging Face Spaces

This is a Next.js project that transforms natural language descriptions into visual code sketches.

πŸ€— HuggingFace Space Setup

  1. Clone the repository:
git clone https://huggingface.co/spaces/tinazone/word-to-code
cd word-to-code
  1. Set up your environment variables:

    • Go to your HuggingFace Space's Settings tab
    • Under "Repository Secrets", add a new secret:
    • The secret will be securely passed to the container at runtime
  2. Make your changes and push them back:

git add .
git commit -m "Update space"
git push

Note: When pushing, use a HuggingFace access token with write permissions as your password. Generate one from: https://huggingface.co/settings/tokens

🎨 Space Configuration


title: Word to Code - Visual Code Sketch Generator emoji: 🎨 colorFrom: blue colorTo: purple sdk: docker pinned: false app_port: 3000

Local Development

  1. Create a .env.local file in the root directory:
GEMINI_API_KEY=your_api_key_here
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev

Open http://localhost:3000 with your browser to see the result.

Features

  • Transform natural language descriptions into visual code sketches
  • Download sketches as GIF animations
  • Real-time code generation and visualization
  • Modern, responsive UI

Technical Stack

  • Next.js 14
  • React 18
  • Tailwind CSS
  • P5.js for sketching
  • FFmpeg for GIF generation
  • Gemini 2.0 for code generation

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.