{"id":26234564,"url":"https://github.com/raphox/poly-scaffold","last_synced_at":"2025-04-22T14:25:29.858Z","repository":{"id":278870689,"uuid":"937038639","full_name":"raphox/poly-scaffold","owner":"raphox","description":"Poly Scaffold is a command-line tool for generating scaffold code for various frameworks. It prompts the user for necessary inputs and generates the required files in the specified target directory.","archived":false,"fork":false,"pushed_at":"2025-03-22T20:14:21.000Z","size":303,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T16:03:24.726Z","etag":null,"topics":["javascript","nextjs","nuxtjs","react-hook-form","scaffold","tanstack-query","zod"],"latest_commit_sha":null,"homepage":"https://raphox.github.io/poly-scaffold/","language":"EJS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-22T07:19:46.000Z","updated_at":"2025-03-25T05:47:43.000Z","dependencies_parsed_at":"2025-03-12T17:39:33.095Z","dependency_job_id":null,"html_url":"https://github.com/raphox/poly-scaffold","commit_stats":null,"previous_names":["raphox/poly-scaffold"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphox%2Fpoly-scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphox%2Fpoly-scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphox%2Fpoly-scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphox%2Fpoly-scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphox","download_url":"https://codeload.github.com/raphox/poly-scaffold/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250257254,"owners_count":21400681,"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":["javascript","nextjs","nuxtjs","react-hook-form","scaffold","tanstack-query","zod"],"created_at":"2025-03-13T02:19:12.880Z","updated_at":"2025-04-22T14:25:29.850Z","avatar_url":"https://github.com/raphox.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poly Scaffold\n\nPoly Scaffold is a command-line tool for generating scaffold code for various frameworks. It prompts the user for necessary inputs and generates the required files in the specified target directory.\n\n## Motivation\n\nThroughout my journey as a developer, I have always sought tools that optimize learning and increase productivity. One of the frameworks that helped me the most in this regard was **Ruby on Rails**, especially through its **scaffold** command. It not only allowed me to quickly generate CRUD structures but also served as a practical reference for understanding how system components interact. Additionally, as new best practices and patterns emerged, the scaffold reflected these changes, keeping me up to date with modern development approaches.\n\nIn the JavaScript ecosystem, particularly with **Next.js** and **Nuxt.js**, I noticed the lack of a similar tool: one that could not only speed up CRUD creation but also serve as a guide for new developers while ensuring standardized and scalable code.\n\nThus, **Poly-Scaffold** was born. It is designed to:\n\n- **Provide a solid and structured foundation** for CRUDs across major modern JavaScript frameworks.\n- **Reduce repetitive code** when implementing common operations like creating, reading, updating, and deleting records.\n- **Maintain a clean and organized project structure**, facilitating collaboration among developers.\n- **Incorporate best practices from the ecosystem**, allowing new developers to learn and apply modern concepts while building their projects.\n- **Unify common approaches** across different frameworks, making CRUD development more consistent and predictable.\n\nBeyond leveraging each framework’s native structure, **Poly-Scaffold** enhances it with some of the most widely used libraries to improve efficiency and robustness:\n\n- **[Zod](https://github.com/colinhacks/zod)** – Schema validation to ensure data integrity.\n- **[TanStack Query](https://tanstack.com/query/latest)** – Advanced caching and asynchronous data fetching management.\n- **[Axios](https://axios-http.com/)** – Simplified API consumption with an intuitive HTTP client.\n- **Integrated Form Validation** – Adopting best practices for each framework to ensure functional and accessible forms.\n\nWith this approach, **Poly-Scaffold** does more than generate code—it establishes a modern and optimized workflow, allowing developers to focus on business logic rather than repetitive implementation details.\n\n## Features\n\n- 🏗️ **Scaffolding for CRUD operations** – Quickly generate models, services, and UI components.\n- 📦 **Multi-framework support** – Compatible with Next.js, Nuxt.js, Next.js + ShadCN, and Nuxt.js + ShadCN.\n- ⚡ **Optimized API calls** – Uses Axios and TanStack Query for efficient data fetching and caching.\n- 🎨 **Pre-styled UI components** — When using ShadCN, components come pre-styled and ready for production. Scaffolding without any advanced style features is also available, giving you total control over what you need.\n- 📚 **Type-safe validation** – Powered by Zod to ensure consistent and secure data handling.\n- 🔄 **Reusability and extensibility** – Easily customizable to fit different project requirements.\n\n## Installation\n\nTo install the dependencies, run:\n\n```bash\nnpm install -D poly-scaffold\n# or\nyarn add -D poly-scaffold\n# or\npnpm add -D poly-scaffold\n```\n\n## Usage\n\nYou can run the tool using the following command:\n\n```bash\npscaffold post title:string body:text\n```\n\n\u003ca id=\"command-line-options\"\u003e\u003c/a\u003e\n\n### Command Line Options\n\n- `--help`: Show help [boolean]\n- `--version`: Show version number [boolean]\n- `--framework, -f`: Framework to use for scaffolding [string]\n- `--resource, -r`: Resource name to scaffold [string]\n- `--target, -t`: Target path for generated files [string]\n- `--javascript, -j`: Generate JavaScript files instead of TypeScript [boolean] [default: false]\n- `--templatesPath, -p`: Specify a custom template path. Leave blank to use the default templates for the selected framework [string]\n\n### Example\n\n```bash\npscaffold post title:string description:text -t ./\n\n# Result:\n\n├── components\n│   ├── post-form.tsx\n│   └── post.tsx\n├── pages\n│   ├── _app.tsx\n│   ├── _document.tsx\n│   ├── index.tsx\n│   └── posts\n│       ├── [id]\n│       │   ├── edit.tsx\n│       │   └── index.tsx\n│       ├── index.tsx\n│       └── new.tsx\n├── providers.tsx\n└── services.ts\n```\n\nSample of generated code: [docs/sample/src](docs/samples).\n\n## Development\n\n### Adding a New Framework\n\nTo add a new framework, follow these steps:\n\n1. Define the framework in the `FRAMEWORKS` object in `src/frameworks.ts`.\n2. Implement the `initFramework` function to initialize the framework.\n\n### Error Handling\n\nThe tool handles uncaught exceptions gracefully. If an `ExitPromptError` occurs, it logs a friendly message and exits. Other errors are rethrown.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphox%2Fpoly-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphox%2Fpoly-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphox%2Fpoly-scaffold/lists"}