> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zopio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# data-provider

> Configure and manage data providers for your application

# data-provider Command

The `data-provider` command helps you configure and manage data providers for your `zopio` application, supporting REST, GraphQL, and other API types.

## Usage

```bash theme={"system"}
zopio data-provider [options]
```

## Options

* `-t, --type <type>` - Provider type (rest | graphql | firebase) (default: "rest")
* `-m, --model <model>` - Model name (required)

## Examples

<CodeGroup>
  ```bash restapi theme={"system"}
  zopio zopio data-provider -t rest -m User
  ```

  ```bash GraphQL theme={"system"}
  zopio data-provider -t graphql -m Product
  ```

  ```bash firebase theme={"system"}
  zopio data-provider -t firebase -m Order
  ```
</CodeGroup>

## Provider Types

### REST

Generates a REST API data provider with standard CRUD operations.

```bash theme={"system"}
zopio data-provider -t rest -m <model>
```

Generated files:

```
src/data-providers/
├─ rest/
│  ├─ <model>.ts
│  └─ api-client.ts
└─ index.ts
```

### GraphQL

Generates a GraphQL data provider with queries and mutations.

```bash theme={"system"}
zopio data-provider -t graphql -m <model>
```

Generated files:

```
src/data-providers/
├─ graphql/
│  ├─ <model>/
│  │  ├─ queries.ts
│  │  └─ mutations.ts
│  └─ client.ts
└─ index.ts
```

### Firebase

Generates a Firebase/Firestore data provider.

```bash theme={"system"}
zopio data-provider -t firebase -m <model>
```

Generated files:

```
src/data-providers/
├─ firebase/
│  ├─ <model>.ts
│  └─ firebase-client.ts
└─ index.ts
```

## Internationalization Support

Data providers generated with this command include internationalization support for error messages and notifications. The translation files are automatically created in both the `dictionaries/` and `locales/` directories for all supported languages (en, tr, es, de).

Example translation structure:

```
dictionaries/
├─ en/
│  └─ data-providers.json
├─ tr/
│  └─ data-providers.json
├─ es/
│  └─ data-providers.json
└─ de/
   └─ data-providers.json
```

<Alert type="info">
  Data providers work seamlessly with the CRUD operations generated by the `crud-unified` command.
</Alert>
