Skip to main content
strapi2front uses a by-feature (“screaming architecture”) output structure. Each content type lives in its own folder with all related code co-located.

Structure Overview

strapi.config.ts
Generated structure:

Collections vs Singles

Content types that have multiple entries (articles, products, users, etc.)Location: collections/{singular-name}/Files:
  • types.ts - Type definitions + filters
  • schemas.ts - Create/update validation
  • service.ts - Full CRUD operations
  • actions.ts - Astro action wrappers
Example:

File Naming

All folder and file names use kebab-case derived from your Strapi content type names:
The converter uses singularName from Strapi (e.g., “article”, “blogPost”) and converts to kebab-case.

Import Patterns

strapi2front does NOT generate barrel exports (index.ts). Always import from specific files:

Multiple Imports from Same Feature

Generated File Contents

Types File

Includes:
  • Interface extending StrapiBaseEntity
  • Relations imported from other types
  • Filter interface for querying (collections only)
Includes:
  • Create schema (required fields enforced)
  • Update schema (all fields optional)
  • TypeScript types inferred from schemas
See Features > Services for complete service API.Exports:
  • {name}Service object with methods:
    • findMany() - Paginated list
    • findAll() - All entries (auto-paginated)
    • findOne() - By documentId/id
    • findBySlug() - By slug (if exists)
    • create() - Create new
    • update() - Update existing
    • delete() - Delete
    • count() - Count with filters

Components

Components generate a single file with type + schema:

Shared Files

System types used across all generated code:
Wrapper around @strapi/client with type safety:
i18n locale definitions from your Strapi instance:

Path Alias Setup

For cleaner imports, configure a path alias in your project:
tsconfig.json
Usage:

Why By-Feature?

Projects can grow to hundreds of content types without becoming unwieldy. Each content type is isolated in its own folder.
Everything related to a content type lives together. Want to see all article-related code? Look in collections/article/.No hunting across types/, services/, schemas/ folders.
Import paths clearly show relationships:
Renaming or removing a content type? Just delete/rename its folder. All related code is co-located.

Alternative Structures

strapi2front currently only supports by-feature structure. Future versions may add:
  • By-type structure - Group by file type (types/, services/, etc.)
  • Flat structure - All files in one directory
  • Custom templates - Define your own structure
Interested in other structures? Open an issue to discuss!

Output Example

With this Strapi schema:
  • Collections: Article, Author, Category
  • Singles: Homepage
  • Components: SEO, Hero
You get:

Next Steps

Using Services

Learn how to use generated services

Type Safety

Understand the type system