# Seed Data Architecture {#seed-data-architecture}


How Gauzy seeds initial data for demo, testing, and production environments.


## Overview {#overview}


Gauzy seeds the database on first launch with essential reference data:

- Countries and currencies
- Languages
- Default roles and permissions
- Feature definitions
- Report categories
- Organization settings


## Seed Types {#seed-types}


| Type       | When Used     | Description                            |
| ---------- | ------------- | -------------------------------------- |
| Default    | Always        | Essential reference data               |
| Demo       | Demo/dev mode | Sample organizations, employees, tasks |
| Random     | Testing       | Random generated test data             |
| Production | First deploy  | Minimal bootstrap data                 |


## Seed Configuration {#seed-configuration}


Controlled via environment variables:

| Variable         | Values           | Default |
| ---------------- | ---------------- | ------- |
| `DEMO`           | `true` / `false` | `false` |
| `SEED_DEMO_DATA` | `true` / `false` | `false` |


## Seed Order {#seed-order}


Seeds execute in dependency order:





```mermaid
graph TB
    A[Countries & Currencies] --> B[Languages]
    B --> C[Roles & Permissions]
    C --> D[Features]
    D --> E[Default Tenant]
    E --> F[Default Organization]
    F --> G[Super Admin User]
    G --> H[Report Categories]
    H --> I[Demo Data if enabled]
```






## Creating Custom Seeds {#creating-custom-seeds}


```typescript
export class MySeed implements ISeedModule {
  async createDefault(dataSource: DataSource): Promise<void> {
    // Seed default data
  }

  async createRandom(
    dataSource: DataSource,
    tenants: ITenant[],
  ): Promise<void> {
    // Seed random/demo data
  }
}
```


## Related Pages {#related-pages}


- [Production Deployment](https://sourcey-gauzy.pages.dev/devops/production-deployment/index.md) — deployment guide
- [Database Migration Guide](https://sourcey-gauzy.pages.dev/architecture/database-migration-guide/index.md) — schema migrations
