{"id":22552923,"url":"https://github.com/oneananda/react-native-code-generator","last_synced_at":"2025-03-28T10:24:08.406Z","repository":{"id":263172383,"uuid":"889573014","full_name":"oneananda/react-native-code-generator","owner":"oneananda","description":"A React-based application designed to provide a drag-and-drop interface for building UI components. This project generates React Native code in real-time, empowering developers to seamlessly create and export functional components for mobile apps. Ideal for developers aiming to accelerate their workflow and bridge design to production.","archived":false,"fork":false,"pushed_at":"2024-11-22T08:00:17.000Z","size":408,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T11:11:19.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oneananda.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}},"created_at":"2024-11-16T17:10:18.000Z","updated_at":"2024-11-22T08:00:20.000Z","dependencies_parsed_at":"2025-02-02T11:10:55.874Z","dependency_job_id":"0542e82c-60b1-445d-a8c1-df258bb4dbea","html_url":"https://github.com/oneananda/react-native-code-generator","commit_stats":null,"previous_names":["oneananda/react-native-code-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneananda%2Freact-native-code-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneananda%2Freact-native-code-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneananda%2Freact-native-code-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneananda%2Freact-native-code-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oneananda","download_url":"https://codeload.github.com/oneananda/react-native-code-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246010158,"owners_count":20709067,"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-12-07T18:08:01.526Z","updated_at":"2025-03-28T10:24:08.384Z","avatar_url":"https://github.com/oneananda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿---\n\n# Drag-and-Drop React Native Code Generator\n\nThis project allows users to create a React Native UI layout using a drag-and-drop interface. Users can drag elements (e.g., buttons, text boxes) onto a canvas, reposition them, modify their properties, and export the generated layout as React Native code or an image.\n\n## Features\n\n- **Drag-and-Drop**: Drag UI elements (e.g., Button, Text Box) into the canvas.\n- **Repositioning**: Move items freely within the canvas.\n- **Properties Panel**: Customize each item's color, size, and position.\n- **Export Features**:\n  - **React Native Code**: Generate the React Native JSX code for the layout.\n  - **Image Export**: Export the canvas as a `.png` image.\n- **Delete Items**: Remove items from the canvas.\n- **Keyboard Shortcuts**:\n  - `Arrow Keys`: Move the selected item.\n  - `Delete`: Remove the selected item.\n\n## Technologies Used\n\n- **React**: For building the UI.\n- **React DnD**: For drag-and-drop functionality.\n- **UUID**: For generating unique IDs for items.\n- **HTML-to-Image**: For exporting the canvas as an image.\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/oneananda/react-native-code-generator.git\n   ```\n2. Navigate to the project directory:\n   ```bash\n   cd react-native-code-generator\n   ```\n3. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n## Usage\n\n1. Start the development server:\n   ```bash\n   npm start\n   ```\n2. Open your browser and navigate to:\n   ```\n   http://localhost:3000\n   ```\n\n### How to Use\n\n1. Drag elements (e.g., **Button**, **Text Box**) from the toolbar into the canvas.\n2. Click an item to select it. The **Properties Panel** on the right will display customization options.\n3. Adjust the item's **color**, **background color**, **width**, and **height** using the properties panel.\n4. Reposition items by dragging them within the canvas.\n5. Export your layout:\n   - **React Native Code**: Copy the generated code from the bottom panel.\n   - **Canvas Image**: Click the **Export Canvas** button to download the layout as a `.png` image.\n\n### Keyboard Shortcuts\n\n| Key         | Action                      |\n|-------------|-----------------------------|\n| `Arrow Keys`| Move the selected item.     |\n| `Delete`    | Delete the selected item.   |\n\n## Project Structure\n\n```\nsrc/\n├── components/\n│   ├── DraggableElement.js    # Draggable toolbar items (e.g., Button, Text Box)\n│   ├── DropZone.js            # Canvas where items are dropped and repositioned\n├── App.js                     # Main application logic\n├── index.js                   # React entry point\n```\n\n## Dependencies\n\n- **react**: `^18.2.0`\n- **react-dnd**: `^16.0.1`\n- **react-dnd-html5-backend**: `^16.0.1`\n- **uuid**: `^9.0.0`\n- **html-to-image**: `^1.10.6`\n\n## Future Enhancements\n\n- **Undo/Redo**: Add functionality to revert or redo changes.\n- **Resizable Elements**: Enable users to resize elements directly on the canvas.\n- **Snap to Grid**: Enhance alignment by snapping items to a grid layout.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for review.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contact\n\nIf you have any questions or feedback, feel free to reach out!\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneananda%2Freact-native-code-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneananda%2Freact-native-code-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneananda%2Freact-native-code-generator/lists"}