Skip to content

Eleven-Estudio/strapi2front

Repository files navigation

strapi2front

Made by Eleven Estudio NPM version License

Generate TypeScript types, services, Zod schemas, and Astro Actions from your Strapi schema.

View Documentation →


Quick Start

npx strapi2front@latest init
npx strapi2front sync

Features

  • 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 helpers

Framework 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

About

Strapi2Front - The Strapi to Frontend Code Generator

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors