strapi2front
v0.5.3
Published
Generate TypeScript types, services, and framework actions from your Strapi schema
Readme
strapi2front
Generate TypeScript types, services, Zod schemas, and Astro Actions from your Strapi schema.
Quick Start
npx strapi2front@latest init
npx strapi2front syncFeatures
- Type Generation — TypeScript interfaces from your Strapi schema
- Service Generation — Typed CRUD functions for all content types
- Zod Schemas — Validation schemas for forms
- Astro Actions — Type-safe server actions
- File Upload — Upload helpers for Astro and browser
- JSDoc Support — JavaScript files with JSDoc annotations (no TypeScript required)
- Strapi v4 & v5 — Full support for both versions
- By-Feature Structure — Organize generated code by feature (screaming architecture)
Generated Output
src/strapi/
├── collections/
│ └── article/
│ ├── types.ts # TypeScript interfaces
│ ├── schemas.ts # Zod validation schemas
│ ├── service.ts # Data fetching functions
│ └── actions.ts # Astro Actions
├── singles/
│ └── homepage/
│ ├── types.ts
│ ├── schemas.ts
│ └── service.ts
├── components/
│ └── seo.ts
└── shared/
├── utils.ts # Utility types
├── client.ts # Strapi client
├── locales.ts # i18n support
└── upload-action.ts # File upload helpersFramework Support
| Framework | Types | Services | Schemas | Actions | | -------------- | ----- | -------- | ------- | ------- | | Astro 4+ | ✅ | ✅ | ✅ | ✅ | | Next.js | ✅ | ✅ | ✅ | 🔜 | | Nuxt | ✅ | ✅ | ✅ | 🔜 | | SvelteKit | ✅ | ✅ | ✅ | 🔜 | | TanStack Start | ✅ | ✅ | ✅ | 🔜 |
Types, Services, and Schemas work with any framework. Actions are framework-specific and more are coming soon.
Requirements
- Node.js 18+
- Strapi v4 or v5
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
MIT © Eleven Estudio
Made with ❤️ by Eleven Estudio
